From 892c83827a1f0fa5d4a70986ed5680e762935ede Mon Sep 17 00:00:00 2001 From: seonghobae <8172694+seonghobae@users.noreply.github.com> Date: Tue, 22 Sep 2026 20:54:33 +0000 Subject: [PATCH 01/10] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20=EC=8B=9C?= =?UTF-8?q?=EA=B0=81=EC=A0=81=20Hover=20=ED=94=BC=EB=93=9C=EB=B0=B1=20?= =?UTF-8?q?=EB=B3=B5=EC=9B=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ๐Ÿ’ก What: `:last-child` ์„ ํƒ์ž๋ฅผ ์‹œ๋งจํ‹ฑ ํด๋ž˜์Šค(`.entry-label`)๋กœ ๊ต์ฒดํ•˜์—ฌ ์ˆจ๊ฒจ์ง„ ์Šคํฌ๋ฆฐ ๋ฆฌ๋”์šฉ ํ…์ŠคํŠธ ์ถ”๊ฐ€๋กœ ์ธํ•ด ๊นจ์กŒ๋˜ ์‹œ๊ฐ์  Hover ํ”ผ๋“œ๋ฐฑ ๋ณต์› ๐ŸŽฏ Why: ์‹œ๊ฐ์ ์œผ๋กœ ์ˆจ๊ฒจ์ง„ ์ ‘๊ทผ์„ฑ ํ…์ŠคํŠธ()๊ฐ€ DOM์˜ ๋งˆ์ง€๋ง‰ ์š”์†Œ๋กœ ์ถ”๊ฐ€๋˜๋ฉด์„œ, `:last-child`์— ์ ์šฉ๋˜๋˜ Hover ์‹œ ๋ฐ‘์ค„ ํšจ๊ณผ๊ฐ€ ํ™”๋ฉด์— ๋ณด์ด์ง€ ์•Š๋Š” ๋ฒ„๊ทธ๋ฅผ ํ•ด๊ฒฐ ๐Ÿ“ธ Before/After: ํ•ด๋‹น ์—†์Œ (์‹œ๊ฐ์  ๋ณ€๊ฒฝ) โ™ฟ Accessibility: ์‹œ๊ฐ์  Hover ํšจ๊ณผ๋ฅผ ๋ณต์›ํ•˜๋ฉด์„œ ์Šคํฌ๋ฆฐ ๋ฆฌ๋”์šฉ ์ˆจ๊ฒจ์ง„ ํ…์ŠคํŠธ ์ ‘๊ทผ์„ฑ์„ ์œ ์ง€ --- .jules/palette.md | 3 + src/main/kotlin/html4tree/main.kt | 6 +- src/main/kotlin/html4tree/main.kt.orig | 529 ++++++++++++++++++ .../GeneratedIndexReadabilityTest.kt | 4 +- .../GeneratedIndexReadabilityTest.kt.orig | 199 +++++++ 5 files changed, 736 insertions(+), 5 deletions(-) create mode 100644 src/main/kotlin/html4tree/main.kt.orig create mode 100644 src/test/kotlin/html4tree/GeneratedIndexReadabilityTest.kt.orig diff --git a/.jules/palette.md b/.jules/palette.md index 604d7810..9609c093 100644 --- a/.jules/palette.md +++ b/.jules/palette.md @@ -73,3 +73,6 @@ ## 2026-08-17 - ๋ธŒ๋ผ์šฐ์ € ๋ฒˆ์—ญ๊ณผ ํ™”๋ฉด ํŒ๋…๊ธฐ์˜ ํ˜ธํ™˜์„ฑ์„ ์œ„ํ•œ ํ…์ŠคํŠธ ์ฒ˜๋ฆฌ **Learning:** `aria-label` ์†์„ฑ์œผ๋กœ ์ง€์ •๋œ ํ™”๋ฉด ํŒ๋…๊ธฐ์šฉ ๋Œ€์ฒด ํ…์ŠคํŠธ๋Š” Chrome Translate ๋“ฑ ๋ธŒ๋ผ์šฐ์ € ๋ฒˆ์—ญ ๋„๊ตฌ์— ์˜ํ•ด ๋ฒˆ์—ญ๋˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ๊ฐ€ ๋งŽ์Šต๋‹ˆ๋‹ค. ์ด๋กœ ์ธํ•ด ๋ฌธ์„œ ์–ธ์–ด๊ฐ€ ๋ณ€ํ™˜๋˜์–ด๋„ ์Šคํฌ๋ฆฐ ๋ฆฌ๋”์—์„œ๋Š” ์›๋ณธ ์–ธ์–ด(์˜ˆ: ์˜์–ด)๋กœ ์ฝํ˜€ ๋‹ค๊ตญ์–ด ์ ‘๊ทผ์„ฑ์ด ์ €ํ•˜๋ฉ๋‹ˆ๋‹ค. **Action:** ํ™”๋ฉด ํŒ๋…๊ธฐ๋ฅผ ์œ„ํ•œ ์ˆจ๊ฒจ์ง„ ์„ค๋ช… ํ…์ŠคํŠธ๋ฅผ ์ œ๊ณตํ•  ๋•Œ `aria-label` ๋Œ€์‹  CSS `.visually-hidden` ํด๋ž˜์Šค๋ฅผ ์ ์šฉํ•œ `` ์š”์†Œ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ, ๋ธŒ๋ผ์šฐ์ €๊ฐ€ ์ผ๋ฐ˜ ํ…์ŠคํŠธ๋กœ ์ธ์‹ํ•˜๊ณ  ๋ฒˆ์—ญํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•˜์—ฌ ๋‹ค๊ตญ์–ด ์ ‘๊ทผ์„ฑ ํ˜ธํ™˜์„ฑ์„ ํ™•๋ณดํ•˜์‹ญ์‹œ์˜ค. +## 2024-05-18 - Fix visual hover feedback regression caused by visually-hidden elements +**Learning:** Using structural pseudo-classes like `:last-child` is fragile when accessibility elements (like ``) are added to the end of a container. It breaks visual styles such as hover underlines which target the wrong element. +**Action:** Use semantic classes (e.g., `.entry-label`) instead of structural pseudo-classes to reliably target visible elements for styling. diff --git a/src/main/kotlin/html4tree/main.kt b/src/main/kotlin/html4tree/main.kt index 0972fa2c..3bfcbfe1 100644 --- a/src/main/kotlin/html4tree/main.kt +++ b/src/main/kotlin/html4tree/main.kt @@ -56,7 +56,7 @@ a:hover, a:focus-visible { outline: 2px solid #0969da; outline-offset: -2px; } -a:hover span:last-child, a:focus-visible span:last-child { +a:hover .entry-label, a:focus-visible .entry-label { text-decoration: underline; } @media (prefers-reduced-motion: reduce) { @@ -429,7 +429,7 @@ fun process_dir(curr_dir: File, excludeSet: Set? = null, dirFiles: Array

${directoryName.escapeHtml()}