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
4 changes: 4 additions & 0 deletions .jules/palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@
## 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.

## 2024-07-03 - Smooth Micro-Interactions in Generated HTML
**Learning:** Adding CSS transitions to interactive elements (like anchor tags) in raw generated HTML enhances the perceived quality and smoothness of the interface. However, using `transition: all` is inefficient, and not accommodating users who prefer reduced motion is an accessibility violation.
**Action:** When adding transitions, specify the exact properties (e.g., `background-color`, `outline-color`) and always include a `@media (prefers-reduced-motion: reduce)` block to disable transitions (`transition: none`) for users who have requested it at the OS level.
6 changes: 6 additions & 0 deletions src/main/kotlin/html4tree/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,19 @@ fun process_dir(curr_dir: File){
text-decoration: none;
color: #0366d6;
border-radius: 4px;
transition: background-color 0.2s ease, outline-color 0.2s ease;
}
a:hover, a:focus-visible {
background-color: #f6f8fa;
text-decoration: underline;
outline: 2px solid #0366d6;
outline-offset: -2px;
}
@media (prefers-reduced-motion: reduce) {
a {
transition: none;
}
}
</style>
"""

Expand Down
2 changes: 2 additions & 0 deletions src/test/kotlin/html4tree/MainTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ class MainTest {
assertFalse(htmlContent.contains("test.ignore"))
assertTrue(htmlContent.contains("Content-Security-Policy"))
assertTrue(htmlContent.contains("default-src 'none'; style-src 'unsafe-inline';"))
assertTrue(htmlContent.contains("transition: background-color 0.2s ease, outline-color 0.2s ease;"))
assertTrue(htmlContent.contains("@media (prefers-reduced-motion: reduce)"))
}

@Test
Expand Down