Skip to content

🎨 Palette: Improve accessibility of WikiCollapsible#50

Open
aicoder2009 wants to merge 2 commits intomainfrom
palette/wiki-collapsible-a11y-10941853414844228866
Open

🎨 Palette: Improve accessibility of WikiCollapsible#50
aicoder2009 wants to merge 2 commits intomainfrom
palette/wiki-collapsible-a11y-10941853414844228866

Conversation

@aicoder2009
Copy link
Copy Markdown
Owner

🎨 Palette: Improve WikiCollapsible accessibility

💡 What:
Added screen-reader accessibility to the WikiCollapsible component by generating a unique ID (useId) to link the toggle button (aria-controls) to the content area (id). Additionally, added aria-expanded to reflect state, and a descriptive aria-label providing 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:

  • Adds useId for guaranteed unique element ids.
  • Links the toggle button to the expandable content via aria-controls.
  • Indicates state using aria-expanded.
  • Clarifies intent with a descriptive aria-label.

PR created automatically by Jules for task 10941853414844228866 started by @aicoder2009

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>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
opencitation Ready Ready Preview, Comment May 1, 2026 6:05pm

Copilot AI review requested due to automatic review settings May 1, 2026 11:36
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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()-generated id and wire it via aria-controls from the toggle button.
  • Add aria-expanded and a contextual aria-label for 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>}
@aicoder2009 aicoder2009 closed this May 1, 2026
@aicoder2009 aicoder2009 reopened this May 1, 2026
Sign up for free to 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.

2 participants