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
6 changes: 3 additions & 3 deletions .jules/palette.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## 2026-04-21 - Added UI focus states and semantic accessibility
**Learning:** In React apps, dynamically changing states like loading indicators need `aria-live="polite"` to ensure screen readers announce them properly without being overly disruptive. Focus states are also often overlooked in generic styles.
**Action:** Always check for `aria-live` on loading components and `focus-visible` on interactive elements during UI audits.
## 2025-06-25 - Skip to Main Content Implementation
**Learning:** React 19 apps using Tailwind CSS require careful skip-link focus management. When targeting a main content area with an `id`, ensuring the target element has `tabIndex={-1}` is critical for programmatic focus, but combining it with `focus:outline-none` prevents an unsightly visual focus ring on the entire container when sighted keyboard users trigger it.
**Action:** When adding skip links, always apply `tabIndex={-1}` and `focus:outline-none` to the target `<main>` container to ensure semantic keyboard navigation without visual degradation.
6 changes: 6 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ function App() {

return (
<div className="flex h-screen bg-gray-900 text-white">
<a
href="#main-content"
className="sr-only focus-visible:not-sr-only focus-visible:absolute focus-visible:z-50 focus-visible:p-4 focus-visible:bg-blue-600 focus-visible:text-white"
>
Skip to main content
</a>
<Sidebar
effectCategories={effectCategories}
selectedEffect={selectedEffect}
Expand Down
4 changes: 2 additions & 2 deletions src/components/ContentView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const ContentView: React.FC<ContentViewProps> = ({
console.log(`[ContentView] Rendering effect: ${selectedEffect || 'None'}, isLoading: ${isLoading}`);

return (
<div className="flex-1 flex flex-col p-4">
<main id="main-content" tabIndex={-1} className="flex-1 flex flex-col p-4 focus:outline-none">
<div className="flex justify-between items-center mb-4">
<h1 className="text-2xl font-bold">
{effectData ? effectData.name : 'Select an Effect'}
Expand Down Expand Up @@ -100,6 +100,6 @@ export const ContentView: React.FC<ContentViewProps> = ({
)}
</div>
</div>
</div>
</main>
);
};