🎨 Palette: Add accessibility attributes to WikiCollapsible#43
🎨 Palette: Add accessibility attributes to WikiCollapsible#43aicoder2009 wants to merge 2 commits intomainfrom
Conversation
Added `useId` to generate dynamic aria-controls mappings. Added `aria-expanded` and `focus-visible` styles to the toggle button. Documented critical UX learning in `.jules/palette.md`. Co-authored-by: aicoder2009 <[email protected]>
|
👋 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. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Improves WikiCollapsible accessibility by adding ARIA attributes and focus-visible styling, and documents an internal Palette accessibility guideline for interactive widgets.
Changes:
- Add
useId()-generated IDs to link the toggle button to collapsible content via ARIA attributes. - Add
aria-expandedand focus-visible outline styles to the toggle button. - Introduce a Palette note documenting the preferred ARIA ID-mapping pattern.
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-expanded, aria-controls), stable IDs via useId, and focus-visible styling for the collapsible toggle. |
| .jules/palette.md | Documents a guideline for using useId() to avoid ARIA ID collisions in interactive widgets. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <div className="flex items-center justify-between px-4 py-2 border-b border-wiki-border-light bg-wiki-tab-bg"> | ||
| <span className="font-medium text-sm">{title}</span> | ||
| <button | ||
| onClick={() => setIsOpen(!isOpen)} |
| aria-expanded={isOpen} | ||
| aria-controls={isOpen ? contentId : undefined} | ||
| className="text-wiki-link text-sm hover:underline focus-visible:outline-dotted focus-visible:outline-1 focus-visible:outline-wiki-text focus-visible:outline-offset-2" |
| <div className="border border-wiki-border-light bg-wiki-offwhite"> | ||
| <div className="flex items-center justify-between px-4 py-2 border-b border-wiki-border-light bg-wiki-tab-bg"> | ||
| <span className="font-medium text-sm">{title}</span> | ||
| <button |
💡 What: Updated the
WikiCollapsiblecomponent to use React'suseIdto associate the toggle button with the collapsible content viaaria-controls. Also addedaria-expandedand visible focus states.🎯 Why: Screen reader users previously lacked programmatic association between the toggle button and the content it controls, and keyboard users lacked clear visual focus styling when navigating to the button.
♿ Accessibility: Improves accessibility (WCAG 4.1.2 Name, Role, Value and 2.4.7 Focus Visible) for interactive elements across the platform.
PR created automatically by Jules for task 12792432945553153807 started by @aicoder2009