Skip to content

fix: restore lines background with configurable color - #502

Open
oosuhada wants to merge 1 commit into
git-goods:mainfrom
oosuhada:fix/issue-492-lines-background
Open

fix: restore lines background with configurable color#502
oosuhada wants to merge 1 commit into
git-goods:mainfrom
oosuhada:fix/issue-492-lines-background

Conversation

@oosuhada

@oosuhada oosuhada commented Aug 27, 2026

Copy link
Copy Markdown

์š”์•ฝ

  • GitHub ํŽ˜์ด์ง€์˜ ๋ฐฐ๊ฒฝ์ƒ‰์ด Line SVG๋ฅผ ํ†ตํ•ด ๋น„์น˜์ง€ ์•Š๋„๋ก ๊ณต๊ฐœ /lines/{username} endpoint์˜ ๊ธฐ๋ณธ ๋ฐฐ๊ฒฝ์„ ํฐ์ƒ‰์œผ๋กœ ๋ณต์›ํ–ˆ์Šต๋‹ˆ๋‹ค.
  • background-color query parameter๋ฅผ ์ถ”๊ฐ€ํ•ด ๋‹คํฌ๋ชจ๋“œ๋‚˜ ๋‹ค๋ฅธ ๋ฐฐ๊ฒฝ์—์„œ๋„ ์›ํ•˜๋Š” ์ƒ‰์ƒ์„ ์ง์ ‘ ์ง€์ •ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ–ˆ์Šต๋‹ˆ๋‹ค.
    • ๊ธฐ๋ณธ: /lines/{username} โ†’ white
    • ๋‹คํฌ ๋ฐฐ๊ฒฝ: /lines/{username}?background-color=0d1117
    • ํˆฌ๋ช… ๋ฐฐ๊ฒฝ: /lines/{username}?background-color=transparent
  • #0d1117 ํ˜•ํƒœ๋„ ์ง€์›ํ•˜๋ฉฐ URL์—์„œ๋Š” #๋ฅผ %23์œผ๋กœ ์ธ์ฝ”๋”ฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • SVG attribute injection์„ ๋ฐฉ์ง€ํ•˜๊ธฐ ์œ„ํ•ด white, transparent, 3/4/6/8์ž๋ฆฌ hex ์ƒ‰์ƒ๋งŒ ํ—ˆ์šฉํ•ฉ๋‹ˆ๋‹ค.
  • ๋‚ด๋ถ€ /lines/{username}/only-pets endpoint๋Š” ๊ธฐ์กด์˜ ํˆฌ๋ช… ๋ฐฐ๊ฒฝ ๋™์ž‘์„ ์œ ์ง€ํ•ฉ๋‹ˆ๋‹ค.
  • ๊ณ ์ • width, height, viewBox๋ฅผ ๋‹ค์‹œ ์ถ”๊ฐ€ํ•˜์ง€ ์•Š์•„ ๊ธฐ์กด ๋ฐ˜์‘ํ˜• SVG ํฌ๊ธฐ ์กฐ์ ˆ ๋™์ž‘๋„ ์œ ์ง€ํ•ฉ๋‹ˆ๋‹ค.

ํ…Œ์ŠคํŠธ

  • ./gradlew test --tests 'org.gitanimals.render.domain.UserTest' --console=plain
  • git diff --check
  • ๊ธฐ๋ณธ transparent ๋™์ž‘, white, custom hex, explicit transparent, ์ž˜๋ชป๋œ ์ƒ‰์ƒ ์ž…๋ ฅ์„ ํšŒ๊ท€ ํ…Œ์ŠคํŠธ๋กœ ๊ฒ€์ฆํ–ˆ์Šต๋‹ˆ๋‹ค.
  • ๊ธฐ์กด ํฐ์ƒ‰ rect๊ฐ€ ์™ธ๋ถ€ 1200x150 viewport ์ „์ฒด๋ฅผ ์ฑ„์šฐ๋Š” ๊ฒƒ๋„ headless Chrome์—์„œ ํ™•์ธํ–ˆ์Šต๋‹ˆ๋‹ค.

Summary

  • restore a white default background for the public /lines/{username} endpoint so GitHub page colors do not show through
  • add a background-color query parameter so users can choose a background that fits dark mode or other surfaces
    • default: /lines/{username} โ†’ white
    • dark background: /lines/{username}?background-color=0d1117
    • transparent background: /lines/{username}?background-color=transparent
  • support #0d1117 as well; # can be URL-encoded as %23
  • restrict values to white, transparent, or 3/4/6/8 digit hex colors to avoid SVG attribute injection
  • preserve the existing transparent behavior of the internal /lines/{username}/only-pets endpoint
  • preserve responsive SVG sizing without restoring fixed width, height, or viewBox attributes

Test

  • ./gradlew test --tests 'org.gitanimals.render.domain.UserTest' --console=plain
  • git diff --check
  • regression coverage for the default transparent domain behavior, white, custom hex, explicit transparent, and invalid color input
  • previously verified in headless Chrome that the white background rect fills an external 1200x150 viewport

Fixes #492

@oosuhada
oosuhada requested a review from devxb as a code owner August 27, 2026 12:27
@oosuhada oosuhada changed the title fix: add explicit white background to lines svg fix: restore lines background with configurable color Aug 27, 2026
@oosuhada
oosuhada force-pushed the fix/issue-492-lines-background branch from 3044c33 to 7472902 Compare August 28, 2026 08:44
@devxb

devxb commented Aug 29, 2026

Copy link
Copy Markdown
Member

์•ˆ๋…•ํ•˜์„ธ์š” @oosuhada ๋‹˜
๊ธฐ์—ฌ ๊ฐ์‚ฌ๋“œ๋ฆฝ๋‹ˆ๋‹ค ใ…Žใ…Ž
์ปค๋ฐ‹ ๋กœ๊ทธ์— ๋ณ€๊ฒฝ์‚ฌํ•ญ์™ธ์˜ ์ปค๋ฐ‹๋“ค์ด ํ•จ๊ป˜ ์˜จ ๊ฒƒ ๊ฐ™์€๋ฐ์š”.

์ปค๋ฐ‹๊ณผ ์ถฉ๋Œ์„ ํ•ด๊ฒฐํ•ด์ฃผ์‹ค ์ˆ˜ ์žˆ์œผ์‹ ๊ฐ€์š”?

@oosuhada
oosuhada force-pushed the fix/issue-492-lines-background branch from 7472902 to 36e4970 Compare August 30, 2026 01:16
@oosuhada

oosuhada commented Aug 30, 2026

Copy link
Copy Markdown
Author

์•ˆ๋…•ํ•˜์„ธ์š” @devxb ๋‹˜, ํ™•์ธ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. fork ์ชฝ commit history๊ฐ€ upstream๊ณผ ๋‹ค๋ฅด๊ฒŒ ์—ฐ๊ฒฐ๋˜์–ด unrelated commits๊ฐ€ ํ•จ๊ป˜ ํฌํ•จ๋œ ์ƒํƒœ์˜€์Šต๋‹ˆ๋‹ค. upstream/main ๊ธฐ์ค€์œผ๋กœ history๋ฅผ ๋‹ค์‹œ ์ •๋ฆฌํ•˜๊ณ  1๊ฐœ์˜ commit์œผ๋กœ ์ •๋ฆฌํ–ˆ์Šต๋‹ˆ๋‹ค. ํ˜„์žฌ conflict ์—†์ด ๋ณ€๊ฒฝ์‚ฌํ•ญ๋„ #492 ๊ด€๋ จ 5๊ฐœ ํŒŒ์ผ๋งŒ ๋‚จ์•„ ์žˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์‹œ ํ•œ๋ฒˆ ํ™•์ธ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lines view background appears gray (transparent) - white background missing

2 participants