Skip to content
Closed
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
4 changes: 4 additions & 0 deletions .jules/palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,7 @@
## 2024-07-13 - ๋นˆ ๋””๋ ‰ํ† ๋ฆฌ ์ƒํƒœ์˜ ์ ‘๊ทผ์„ฑ(Accessibility) ๊ฐœ์„ 
**Learning:** ์ •์  ํŒŒ์ผ ์„œ๋ฒ„์˜ ๋นˆ ๋””๋ ‰ํ† ๋ฆฌ ์ƒํƒœ๋Š” ์Šคํฌ๋ฆฐ ๋ฆฌ๋” ์‚ฌ์šฉ์ž์—๊ฒŒ ์ปจํ…์ธ  ๋ˆ„๋ฝ์œผ๋กœ ์˜คํ•ด๋ฐ›์„ ์ˆ˜ ์žˆ์œผ๋ฉฐ, ์‹œ๊ฐ์ ์œผ๋กœ๋„ ์ผ๋ฐ˜ ๋ฆฌ์ŠคํŠธ ์•„์ดํ…œ๊ณผ ์ •๋ ฌ์ด ๋งž์ง€ ์•Š๋Š” ๋ฌธ์ œ๊ฐ€ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.
**Action:** ๋นˆ ์ƒํƒœ๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ์š”์†Œ์— `role="status"`๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ ์Šคํฌ๋ฆฐ ๋ฆฌ๋”๊ฐ€ ๋ช…ํ™•ํ•˜๊ฒŒ ์ธ์ง€ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•˜๊ณ , ์•„์ด์ฝ˜๊ณผ flex ๋ ˆ์ด์•„์›ƒ์„ ํ†ตํ•ด ๋‹ค๋ฅธ ๋ฆฌ์ŠคํŠธ ์•„์ดํ…œ๊ณผ ์ผ๊ด€๋œ ์‹œ๊ฐ์  ํ๋ฆ„์„ ์ œ๊ณตํ•˜๋„๋ก ํ•ฉ๋‹ˆ๋‹ค.

## 2026-08-04 - ๋ฃจํŠธ ๋””๋ ‰ํ† ๋ฆฌ์˜ ๋นˆ ์ œ๋ชฉ/ํ—ค๋”๋กœ ์ธํ•œ ์ ‘๊ทผ์„ฑ ๋ฐ ์‚ฌ์šฉ์„ฑ ๋ฌธ์ œ
**ํ•™์Šต:** ํŒŒ์ผ ์‹œ์Šคํ…œ ๋ฃจํŠธ์™€ ๊ฐ™์ด `File.getName()`์ด ๋นˆ ๋ฌธ์ž์—ด์„ ๋ฐ˜ํ™˜ํ•˜๋Š” ๋””๋ ‰ํ† ๋ฆฌ์— ๋Œ€ํ•ด `<title>` ๋ฐ `<h1>` ํƒœ๊ทธ๊ฐ€ ๋น„์›Œ์ง€๋ฉด, ์Šคํฌ๋ฆฐ ๋ฆฌ๋” ์‚ฌ์šฉ์ž๊ฐ€ ํ˜„์žฌ ์œ„์น˜๋ฅผ ํŒŒ์•…ํ•˜๊ธฐ ์–ด๋ ต๊ณ  ์‹œ๊ฐ์ ์œผ๋กœ๋„ ํ˜ผ๋ž€์„ ์ฃผ์–ด ์ ‘๊ทผ์„ฑ(Accessibility)๊ณผ ์‚ฌ์šฉ์„ฑ(UX)์„ ํฌ๊ฒŒ ์ €ํ•ดํ•ฉ๋‹ˆ๋‹ค.
**์กฐ์น˜:** ๋””๋ ‰ํ† ๋ฆฌ ์ด๋ฆ„์ด ๋น„์–ด ์žˆ๋Š” ๊ฒฝ์šฐ(๋ฃจํŠธ ๋””๋ ‰ํ† ๋ฆฌ ๋“ฑ), ํ•ด๋‹น ๋””๋ ‰ํ† ๋ฆฌ์˜ ์ ˆ๋Œ€ ๊ฒฝ๋กœ(`absolutePath`)๋ฅผ ๋Œ€์ฒด ์ด๋ฆ„์œผ๋กœ ์‚ฌ์šฉํ•˜์—ฌ ๋นˆ ์ œ๋ชฉ/ํ—ค๋”๊ฐ€ ์ƒ์„ฑ๋˜๋Š” ๊ฒƒ์„ ๋ฐฉ์ง€ํ•จ์œผ๋กœ์จ ์ ‘๊ทผ์„ฑ ๋ฐ ์‹œ๊ฐ์  ์œ ์šฉ์„ฑ์„ ํ–ฅ์ƒ์‹œํ‚ต๋‹ˆ๋‹ค.
4 changes: 2 additions & 2 deletions src/main/kotlin/html4tree/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,12 @@ ${cssContent} </style>
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src '${styleHash}'; base-uri 'none'; form-action 'none';">
<!-- ๋ณด์•ˆ ํ–ฅ์ƒ: ๋ฆฌํผ๋Ÿฌ๋ฅผ ํ†ตํ•œ ๋””๋ ‰ํ† ๋ฆฌ ๊ฒฝ๋กœ ๋…ธ์ถœ ๋ฐฉ์ง€ -->
<meta name="referrer" content="no-referrer">
<title>${curr_dir.getName().escapeHtml()}</title>
<title>${curr_dir.name.ifEmpty { curr_dir.absolutePath }.escapeHtml()}</title>
${css}
</head>
<body>
<main>
<h1>${curr_dir.getName().escapeHtml()}</h1>
<h1>${curr_dir.name.ifEmpty { curr_dir.absolutePath }.escapeHtml()}</h1>
<nav aria-label="๋””๋ ‰ํ† ๋ฆฌ ๋ชฉ๋ก">
<ul role="list">
<li><a class="dir-link" href="./.." aria-label="์ƒ์œ„ ๋””๋ ‰ํ† ๋ฆฌ๋กœ ์ด๋™" title="์ƒ์œ„ ๋””๋ ‰ํ† ๋ฆฌ๋กœ ์ด๋™"><span class="icon" aria-hidden="true">&#x21B0;</span> <span>..</span></a></li>
Expand Down
33 changes: 33 additions & 0 deletions src/test/kotlin/html4tree/EmptyDirNameTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package html4tree

import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Rule
import org.junit.Test
import org.junit.rules.TemporaryFolder
import java.io.File
import java.nio.file.Files

class EmptyDirNameTest {
@get:Rule
val tempFolder = TemporaryFolder()

@Test
fun testProcessDirRootDirectoryMock() {
val tempDir = tempFolder.newFolder()
val mockRoot = object : File(tempDir, "mockRoot") {
override fun getName() = ""
// Mocking a root directory which has an empty name
}
mockRoot.mkdir()

process_dir(mockRoot, emptySet(), emptyArray())

val indexHtml = File(mockRoot, "index.html")
assertTrue(indexHtml.exists())

val content = indexHtml.readText()
assertTrue(content.contains("<title>${mockRoot.absolutePath.escapeHtml()}</title>"))
assertTrue(content.contains("<h1>${mockRoot.absolutePath.escapeHtml()}</h1>"))
}
}
Loading