Skip to content

🎨 Palette: Add keyboard accessibility to file header accordions#32

Merged
praxstack merged 1 commit intomainfrom
jules-12865922529425570616-5f26f015
Mar 12, 2026
Merged

🎨 Palette: Add keyboard accessibility to file header accordions#32
praxstack merged 1 commit intomainfrom
jules-12865922529425570616-5f26f015

Conversation

@praxstack
Copy link
Copy Markdown
Owner

The custom .file-header div elements used for accordion-style expand/collapse of file diffs in the AI Visual Code Review UI were missing critical accessibility features. They could only be operated via mouse clicks and were completely invisible to keyboard and screen reader users.

Changes:

  1. Semantic Meaning & Tab Order: Added role="button" and tabindex="0" attributes so screen readers identify them as interactive buttons and they are reachable via the Tab key.
  2. State Management: Added the aria-expanded attribute, which is correctly toggled between "true" and "false" when the diff is expanded or collapsed.
  3. Visual Focus: Added .file-header:focus-visible CSS with a highly visible outline (matching existing styles) to clearly indicate when the header has keyboard focus.
  4. Keyboard Interaction: Added an onkeydown handler to allow expanding/collapsing using the Enter and Space keys (with event.preventDefault() to stop Space from scrolling the page). The handler properly ignores events that bubble up from nested focusable elements like the "Include" checkbox.
  5. Journaling: Documented this custom component pattern in .Jules/palette.md to establish a convention for future nested interactive elements.

PR created automatically by Jules for task 12865922529425570616 started by @praxstack

* Adds role="button", tabindex="0", and aria-expanded attributes to the custom div .file-header to provide correct screen reader context.
* Adds explicit :focus-visible styling to the file headers to indicate keyboard focus.
* Implements an onkeydown event handler to support expanding/collapsing file headers using the Space and Enter keys, ensuring events that bubble up from child interactive elements are ignored.

Co-authored-by: praxstack <73683289+praxstack@users.noreply.github.com>
@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.

@praxstack praxstack merged commit a4b49b4 into main Mar 12, 2026
4 checks passed
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.

1 participant