Skip to content

🎨 Palette: [UX improvement] 디렉토리 이름 누락 시 폴백 제공 - #371

Closed
seonghobae wants to merge 5 commits into
masterfrom
palette-ux-empty-name-fallback-5514475800644737525
Closed

🎨 Palette: [UX improvement] 디렉토리 이름 누락 시 폴백 제공#371
seonghobae wants to merge 5 commits into
masterfrom
palette-ux-empty-name-fallback-5514475800644737525

Conversation

@seonghobae

@seonghobaeseonghobae commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

💡 What: 디렉토리 이름(getName)이 비어 있을 때 절대 경로(absolutePath)를 폴백으로 사용하도록 수정했습니다.
🎯 Why: 파일 시스템 루트 등에서 이름이 비어 있으면

및 <title> 태그가 비어 화면 판독기 및 사용자에게 혼란을 줍니다.
📸 Before/After: 해당 없음
♿ Accessibility: 빈 제목 요소 방지를 통해 화면 판독기 사용자에게 명확한 컨텍스트(위치)를 제공합니다.


PR created automatically by Jules for task 5514475800644737525 started by @seonghobae

Summary by CodeRabbit

  • 접근성 개선

    • 디렉터리 이름이 비어 있는 경우 절대 경로를 표시 이름으로 사용합니다.
    • 페이지 제목과 현재 위치 헤더에서 루트 디렉터리 및 사용자 지정 마운트 지점을 더 쉽게 식별할 수 있습니다.
    • 경로 내 특수 문자가 안전하게 표시됩니다.
  • 테스트

    • 빈 디렉터리 이름과 절대 경로 표시를 검증하는 테스트를 추가했습니다.

@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitaiBot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

process_dir는 디렉토리 이름이 비어 있으면 절대 경로를 표시 이름으로 사용합니다. 생성된 HTML의 <title><h1>은 이 값을 HTML 이스케이프하여 표시합니다. 테스트는 파일 생성과 두 HTML 요소의 내용을 검증합니다.

Changes

빈 디렉토리 표시 이름

Layer / File(s)Summary
표시 이름 폴백 및 HTML 출력
src/main/kotlin/html4tree/main.kt, src/test/kotlin/html4tree/MainTest.kt, .jules/palette.md
process_dir는 빈 디렉토리 이름에 absolutePath를 사용합니다. <title><h1>은 이 값을 HTML 이스케이프하여 출력합니다. 테스트는 index.html 생성과 절대 경로 표시를 검증합니다. 변경 기록도 추가합니다.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers:copilot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ Passed제목은 디렉토리 이름이 없을 때 폴백을 제공하는 주요 변경 사항을 정확히 요약합니다.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch palette-ux-empty-name-fallback-5514475800644737525

Comment @coderabbitai help to get the list of available commands.

@seonghobaeChatGPT Codex Connector

Copy link
Copy Markdown
CollaboratorAuthor

@coderabbitai review
@cwl-noema-review
@opencode-agent

Review the exact live head only. Verify an empty directory getName falls back to a stable absolute-path representation for both h1 and title without exposing an unintended host path beyond the existing local-output contract, preserves HTML escaping and ordinary names, and includes root/empty-name regressions. Require current JVM tests, configured coverage, security gates, and zero unresolved threads. Review only; do not update the branch, merge, release, or alter protections.

@coderabbitai

Copy link
Copy Markdown

Rate Limit Exceeded

@seonghobae have exceeded the limit for the number of chat messages per hour. Please wait 12 minutes and 6 seconds before sending another message.

@google-labs-jules

Copy link
Copy Markdown

@coderabbitai review
@cwl-noema-review
@opencode-agent

Review the exact live head only. Verify an empty directory getName falls back to a stable absolute-path representation for both h1 and title without exposing an unintended host path beyond the existing local-output contract, preserves HTML escaping and ordinary names, and includes root/empty-name regressions. Require current JVM tests, configured coverage, security gates, and zero unresolved threads. Review only; do not update the branch, merge, release, or alter protections.

Acknowledged.

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/main/kotlin/html4tree/main.kt (1)

349-354: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

이스케이프 결과를 한 번만 계산하십시오.

displayDirName.escapeHtml()<title><h1>에서 각각 실행됩니다. 빈 이름의 fallback은 긴 절대 경로일 수 있으므로 같은 문자열을 두 번 순회합니다. 이스케이프 결과를 한 번 계산하고 두 요소에서 재사용하십시오.

수정 예시
 val displayDirName = curr_dir.name.ifBlank { curr_dir.absolutePath }
+ val escapedDisplayDirName = displayDirName.escapeHtml()
...
- <title>${displayDirName.escapeHtml()}</title>+ <title>${escapedDisplayDirName}</title>
...
- <h1>${displayDirName.escapeHtml()}</h1>+ <h1>${escapedDisplayDirName}</h1>

As per coding guidelines, Avoid intermediate string allocations in hot paths; preserve single-pass escaping with lazy StringBuilder usage.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/main/kotlin/html4tree/main.kt` around lines 349 - 354, Update the HTML
generation around the <title> and <h1> elements to compute
displayDirName.escapeHtml() once and reuse that escaped value in both places.
Preserve the existing fallback behavior and single-pass escaping, avoiding any
additional repeated traversal or unnecessary intermediate string allocation.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/test/kotlin/html4tree/MainTest.kt`:
- Around line 151-163: Update testProcessDirWithEmptyName to create the
temporary directory under a path containing HTML-special characters, ensuring
escaping is exercised. Replace expected values that call escapeHtml() with fixed
strings representing the correctly escaped absolute path, and keep asserting
both the title and h1 output.
---
Nitpick comments:
In `@src/main/kotlin/html4tree/main.kt`:
- Around line 349-354: Update the HTML generation around the <title> and <h1>
elements to compute displayDirName.escapeHtml() once and reuse that escaped
value in both places. Preserve the existing fallback behavior and single-pass
escaping, avoiding any additional repeated traversal or unnecessary intermediate
string allocation.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1631b105-5a38-4fc2-a14e-299ac41f196a

📥 Commits

Reviewing files that changed from the base of the PR and between f403888 and a4d984b.

📒 Files selected for processing (3)
  • .jules/palette.md
  • src/main/kotlin/html4tree/main.kt
  • src/test/kotlin/html4tree/MainTest.kt

Comment on lines +151 to +163
@Test
fun testProcessDirWithEmptyName() {
val fakeRoot = object : File(tempDir, "fakeRoot") {
override fun getName() = ""
}
fakeRoot.mkdir()
process_dir(fakeRoot)
val indexFile = File(fakeRoot, "index.html")
assertTrue(indexFile.exists())
val htmlContent = indexFile.readText()
assertTrue(htmlContent.contains("<title>${fakeRoot.absolutePath.escapeHtml()}</title>"))
assertTrue(htmlContent.contains("<h1>${fakeRoot.absolutePath.escapeHtml()}</h1>"))
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

HTML 이스케이프 검증을 구현과 분리하십시오.

현재 기대값이 fakeRoot.absolutePath.escapeHtml()를 다시 호출합니다. process_dir가 이스케이프를 생략해도 임시 경로에 특수 문자가 없으면 테스트가 통과할 수 있습니다. 특수 문자가 포함된 디렉토리 경로를 사용하고 예상 HTML에 고정된 이스케이프 결과를 검증하십시오.

수정 예시
- val fakeRoot = object : File(tempDir, "fakeRoot") {+ val fakeRoot = object : File(tempDir, "fake&root") {
override fun getName() = ""
}
...
- assertTrue(htmlContent.contains("<title>${fakeRoot.absolutePath.escapeHtml()}</title>"))- assertTrue(htmlContent.contains("<h1>${fakeRoot.absolutePath.escapeHtml()}</h1>"))+ val expectedPath = fakeRoot.absolutePath.replace("&", "&amp;")+ assertTrue(htmlContent.contains("<title>$expectedPath</title>"))+ assertTrue(htmlContent.contains("<h1>$expectedPath</h1>"))
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@Test
funtestProcessDirWithEmptyName() {
val fakeRoot =object:File(tempDir, "fakeRoot") {
overridefungetName() =""
}
fakeRoot.mkdir()
process_dir(fakeRoot)
val indexFile =File(fakeRoot, "index.html")
assertTrue(indexFile.exists())
val htmlContent = indexFile.readText()
assertTrue(htmlContent.contains("<title>${fakeRoot.absolutePath.escapeHtml()}</title>"))
assertTrue(htmlContent.contains("<h1>${fakeRoot.absolutePath.escapeHtml()}</h1>"))
}
`@Test`
funtestProcessDirWithEmptyName() {
val fakeRoot =object:File(tempDir, "fake&root") {
overridefungetName() =""
}
fakeRoot.mkdir()
process_dir(fakeRoot)
val indexFile =File(fakeRoot, "index.html")
assertTrue(indexFile.exists())
val htmlContent = indexFile.readText()
val expectedPath = fakeRoot.absolutePath.replace("&", "&amp;")
assertTrue(htmlContent.contains("<title>$expectedPath</title>"))
assertTrue(htmlContent.contains("<h1>$expectedPath</h1>"))
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/test/kotlin/html4tree/MainTest.kt` around lines 151 - 163, Update
testProcessDirWithEmptyName to create the temporary directory under a path
containing HTML-special characters, ensuring escaping is exercised. Replace
expected values that call escapeHtml() with fixed strings representing the
correctly escaped absolute path, and keep asserting both the title and h1
output.

@seonghobaeChatGPT Codex Connector

Copy link
Copy Markdown
CollaboratorAuthor

Closing as superseded by #395. Both PRs address the same empty root-directory name accessibility gap, but this branch writes File.absolutePath into generated public HTML, disclosing host filesystem layout. #395 uses a deterministic generic / title and heading, preserves the accessibility improvement, and avoids that exposure. Review/check evidence from this branch does not transfer to #395; the newer PR must pass its own current-head gates.

@google-labs-jules

Copy link
Copy Markdown

Closing as superseded by #395. Both PRs address the same empty root-directory name accessibility gap, but this branch writes File.absolutePath into generated public HTML, disclosing host filesystem layout. #395 uses a deterministic generic / title and heading, preserves the accessibility improvement, and avoids that exposure. Review/check evidence from this branch does not transfer to #395; the newer PR must pass its own current-head gates.

Understood. Acknowledging that this work is now obsolete and stopping work on this task.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@seonghobae