diff --git a/.jules/palette.md b/.jules/palette.md index 604d7810..3d8d0e63 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` 클래스를 적용한 `` 요소를 사용하여, 브라우저가 일반 텍스트로 인식하고 번역할 수 있도록 하여 다국어 접근성 호환성을 확보하십시오. +## 2026-08-18 - 스크린 리더용 숨김 텍스트가 호버 밑줄에 포함되는 현상 방지 +**Learning:** 파일 서버 탐색 시 `` 내부에 스크린 리더를 위한 시각적 숨김 텍스트(`파일`)가 추가되면서, 기존 CSS의 `span:last-child` 선택자가 표시되는 파일 이름(가운데 span) 대신 이 숨겨진 span을 대상으로 지정하게 되어 파일 이름에 호버(hover) 시 밑줄(underline)이 생기지 않는 UX 결함이 발생했습니다. +**Action:** 숨겨진 설명 텍스트가 마크업 마지막에 위치할 수 있으므로, `:last-child` 같은 구조적 가상 클래스 대신 구체적인 클래스 선택자(예: `span:not(.visually-hidden):not(.icon)`)를 사용하거나, 이 경우 항상 두 번째 span이 표시되는 텍스트임을 활용하여 `span:nth-child(2)`를 사용해 시각적인 호버 효과가 화면 판독기용 숨김 텍스트에 의해 깨지지 않도록 해야 합니다. diff --git a/src/main/kotlin/html4tree/main.kt b/src/main/kotlin/html4tree/main.kt index 0972fa2c..c984b715 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 span:nth-child(2), a:focus-visible span:nth-child(2) { text-decoration: underline; } @media (prefers-reduced-motion: reduce) { diff --git a/src/test/kotlin/html4tree/GeneratedIndexReadabilityTest.kt b/src/test/kotlin/html4tree/GeneratedIndexReadabilityTest.kt index 5897ce6d..03a8d22e 100644 --- a/src/test/kotlin/html4tree/GeneratedIndexReadabilityTest.kt +++ b/src/test/kotlin/html4tree/GeneratedIndexReadabilityTest.kt @@ -147,7 +147,7 @@ class GeneratedIndexReadabilityTest { assertTrue( style.contains( """ - a:hover span:last-child, a:focus-visible span:last-child { + a:hover span:nth-child(2), a:focus-visible span:nth-child(2) { text-decoration: underline; } """.trimIndent()