From c4dd2c753d444f2bd16f0781010440051a7bb828 Mon Sep 17 00:00:00 2001
From: seonghobae <8172694+seonghobae@users.noreply.github.com>
Date: Wed, 22 Jul 2026 03:26:52 +0000
Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20=EB=B9=88=20=EB=94=94?=
=?UTF-8?q?=EB=A0=89=ED=86=A0=EB=A6=AC=20=EC=9D=B4=EB=A6=84=20=ED=8F=B4?=
=?UTF-8?q?=EB=B0=B1=20=EC=B6=94=EA=B0=80=20(=EC=A0=91=EA=B7=BC=EC=84=B1?=
=?UTF-8?q?=20=EA=B0=9C=EC=84=A0)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
빈 이름(예: 파일 시스템 루트)을 가진 디렉토리의 경우 `title`과 `h1` 태그가 비어 있어 스크린 리더 접근성에 심각한 문제를 초래하는 것을 수정했습니다. 이제 절대 경로를 폴백으로 사용합니다.
---
.jules/palette.md | 4 ++++
src/main/kotlin/html4tree/main.kt | 5 +++--
src/test/kotlin/html4tree/MainTest.kt | 18 ++++++++++++++++++
3 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/.jules/palette.md b/.jules/palette.md
index 9a12c9d..6e95b05 100644
--- a/.jules/palette.md
+++ b/.jules/palette.md
@@ -48,3 +48,7 @@
## 2024-08-01 - 네이티브 브라우저 UI의 다크 모드 지원 강제
**학습:** CSS 미디어 쿼리(`@media (prefers-color-scheme: dark)`)를 통해 다크 모드를 지원하더라도, 브라우저의 네이티브 UI 요소(스크롤바, 기본 폼 컨트롤, 기본 백그라운드 등)는 테마 변경을 인식하지 못해 어두운 테마 환경에서 밝은 스크롤바가 표시되는 등 시각적 불일치를 초래합니다.
**조치:** 항상 HTML 문서의 `
` 영역에 `` 메타 태그를 명시적으로 추가하여 브라우저 수준에서 사용자의 시스템 테마(다크 모드 등)를 완전히 상속받아 일관성 있는 네이티브 UI를 렌더링하도록 보장하십시오.
+
+## 2026-07-22 - Empty Directory Name Fallback
+**Learning:** When generating HTML for directory structures, directories with empty names (like filesystem roots) result in empty and
tags, causing a severe accessibility issue for screen readers.
+**Action:** Always provide a fallback (like absolute path) for empty directory names to ensure semantic elements are populated and accessible.
diff --git a/src/main/kotlin/html4tree/main.kt b/src/main/kotlin/html4tree/main.kt
index b455862..3ac50b2 100644
--- a/src/main/kotlin/html4tree/main.kt
+++ b/src/main/kotlin/html4tree/main.kt
@@ -243,6 +243,7 @@ fun write_index_file(curr_dir: File, content: String) {
fun process_dir(curr_dir: File, excludeSet: Set? = null, dirFiles: Array? = null){
val exclude: Set = excludeSet ?: process_ignore_file(curr_dir)
+ val dirName = if (curr_dir.name.isEmpty()) curr_dir.absolutePath else curr_dir.name
val cssContent = """
body {
@@ -327,12 +328,12 @@ ${cssContent}
- ${curr_dir.getName().escapeHtml()}
+ ${dirName.escapeHtml()}
${css}
-