🎨 Palette: Improve accessibility of WikiCollapsible#50
🎨 Palette: Improve accessibility of WikiCollapsible#50aicoder2009 wants to merge 2 commits intomainfrom
Conversation
Added ARIA labels and a generated unique ID to properly associate the toggle button with its expandable content area. Provides context for screen reader users navigating past generic visual cues like `[hide]` / `[show]`. Recorded critical learning in `.jules/palette.md`. Co-authored-by: aicoder2009 <127642633+aicoder2009@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Pull request overview
Improves the accessibility of the WikiCollapsible UI component by adding ARIA relationships/state so screen readers can understand what the toggle controls and whether it’s expanded.
Changes:
- Add
useId()-generatedidand wire it viaaria-controlsfrom the toggle button. - Add
aria-expandedand a contextualaria-labelfor the show/hide button. - Add a palette learning note documenting the accessibility rationale.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/components/wiki/wiki-collapsible.tsx |
Adds ARIA attributes (aria-controls, aria-expanded, aria-label) and a generated content id to improve screen-reader context. |
.jules/palette.md |
Documents the accessibility learning/action taken for ambiguous interactive labels. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -22,11 +23,14 @@ export function WikiCollapsible({ | |||
| <button | |||
| onClick={() => setIsOpen(!isOpen)} | |||
| @@ -22,11 +23,14 @@ export function WikiCollapsible({ | |||
| <button | |||
| </button> | ||
| </div> | ||
| {isOpen && <div className="px-4 py-3">{children}</div>} | ||
| {isOpen && <div id={contentId} className="px-4 py-3">{children}</div>} |
🎨 Palette: Improve WikiCollapsible accessibility
💡 What:
Added screen-reader accessibility to the
WikiCollapsiblecomponent by generating a unique ID (useId) to link the toggle button (aria-controls) to the content area (id). Additionally, addedaria-expandedto reflect state, and a descriptivearia-labelproviding missing context (e.g., "Hide Book Fields" instead of just the visual[hide]).🎯 Why:
When a screen reader user navigates out of context (like scanning a list of buttons), generic labels like
[hide]or[show]provide no information about what is being hidden or shown. Explicit ARIA controls and labels significantly improve the usability of interactive regions for assistive technologies.♿ Accessibility:
useIdfor guaranteed unique elementids.aria-controls.aria-expanded.aria-label.PR created automatically by Jules for task 10941853414844228866 started by @aicoder2009