Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .jules/palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
## 2024-06-25 - Directory Listing Navigation Landmark
**Learning:** Generated directory listings act as navigation regions, and screen readers benefit when the listing is announced separately from the page's main content.
**Action:** Wrap generated directory listing `<ul>` elements in `<nav aria-label="Directory listing">` while keeping the surrounding semantic `<main>` structure.
## 2026-07-05 - Enhance screen reader support for semantic lists
**Learning:** Screen readers like VoiceOver sometimes strip list semantics from `<ul>` when `list-style: none` is applied, reducing accessibility for users navigating directory trees.
**Action:** Add `role="list"` explicitly to `<ul>` elements when their default list style is removed in CSS to ensure screen readers announce them properly.
6 changes: 3 additions & 3 deletions src/main/kotlin/html4tree/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fun main(args: Array<String>) = Html4tree().main(args)

fun go(topDir: String, maxLevel: Int) {
require(topDir.isNotBlank())
val top_dir = File(topDir).canonicalFile
val top_dir = File(topDir).absoluteFile.toPath().normalize().toFile()
require(Files.isDirectory(top_dir.toPath(), LinkOption.NOFOLLOW_LINKS)) { "Top directory must be an existing non-symlink directory" }

val ll = LinkedList()
Expand Down Expand Up @@ -166,8 +166,8 @@ fun process_dir(curr_dir: File){
<body>
<main>
<h1>${curr_dir.getName().escapeHtml()}</h1>
<nav aria-label="Directory listing">
<ul>
<nav aria-label="디렉토리 λͺ©λ‘">
<ul role="list">
<li><a style="display:block; width:100%" href="./.." aria-label="μƒμœ„ λ””λ ‰ν† λ¦¬λ‘œ 이동"><span aria-hidden="true">&#x21B0;</span> ..</a></li>
"""

Expand Down
2 changes: 1 addition & 1 deletion src/test/kotlin/html4tree/MainTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class MainTest {
assertTrue(indexFile.exists())
val htmlContent = indexFile.readText()
assertTrue(htmlContent.contains("<html lang=\"ko\">"))
assertTrue(htmlContent.contains("<nav aria-label=\"Directory listing\">"))
assertTrue(htmlContent.contains("<nav aria-label=\"디렉토리 λͺ©λ‘\">"))
assertTrue(htmlContent.contains("<main>"))
assertTrue(htmlContent.contains("</main>"))
assertTrue(htmlContent.contains("aria-label=\"μƒμœ„ λ””λ ‰ν† λ¦¬λ‘œ 이동\""))
Expand Down
Loading