diff --git a/.jules/palette.md b/.jules/palette.md index 7b223901..8c4156d7 100644 --- a/.jules/palette.md +++ b/.jules/palette.md @@ -52,3 +52,7 @@ ## 2024-07-13 - 빈 디렉토리 상태의 접근성(Accessibility) 개선 **Learning:** 정적 파일 서버의 빈 디렉토리 상태는 스크린 리더 사용자에게 컨텐츠 누락으로 오해받을 수 있으며, 시각적으로도 일반 리스트 아이템과 정렬이 맞지 않는 문제가 있었습니다. **Action:** 빈 상태를 나타내는 요소에 `role="status"`를 추가하여 스크린 리더가 명확하게 인지할 수 있도록 하고, 아이콘과 flex 레이아웃을 통해 다른 리스트 아이템과 일관된 시각적 흐름을 제공하도록 합니다. + +## 2026-08-06 - 파일 경로 기반 제목 표시줄의 접근성 개선 +**학습:** 디렉토리 이름이 비어있는 경우(예: 루트 디렉토리나 커스텀 마운트 포인트),

태그가 비어 있게 되어 화면 판독기 사용자가 현재 페이지의 컨텍스트를 이해할 수 없게 되며, 시각적으로도 페이지 제목이 누락되어 혼란을 초래합니다. +**조치:** UI 요소(.name)에 표시할 디렉토리 이름이 비어있는 경우, 항상 절대 경로(.absolutePath)와 같은 의미 있는 폴백(fallback) 값을 제공하여 화면 판독기와 일반 사용자 모두 페이지의 위치를 명확히 알 수 있도록 보장하십시오. diff --git a/src/main/kotlin/html4tree/main.kt b/src/main/kotlin/html4tree/main.kt index f52a1468..6529654d 100644 --- a/src/main/kotlin/html4tree/main.kt +++ b/src/main/kotlin/html4tree/main.kt @@ -326,6 +326,7 @@ fun process_dir(curr_dir: File, excludeSet: Set<String>? = null, dirFiles: Array val exclude: Set<String> = excludeSet ?: process_ignore_file(curr_dir) + val displayDirName = curr_dir.name.ifBlank { curr_dir.absolutePath } val index_top = """<!doctype html> <html lang="ko"> <head> @@ -336,12 +337,12 @@ fun process_dir(curr_dir: File, excludeSet: Set<String>? = null, dirFiles: Array <meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src '${STYLE_HASH}'; base-uri 'none'; form-action 'none';"> <!-- 보안 향상: 리퍼러를 통한 디렉토리 경로 노출 방지 --> <meta name="referrer" content="no-referrer"> - <title>${curr_dir.getName().escapeHtml()} + ${displayDirName.escapeHtml()}
-

${curr_dir.getName().escapeHtml()}

+

${displayDirName.escapeHtml()}