🎨 Palette: Add keyboard accessibility to file header accordions#32
🎨 Palette: Add keyboard accessibility to file header accordions#32
Conversation
* 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>
|
👋 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 custom
.file-headerdiv 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:
role="button"andtabindex="0"attributes so screen readers identify them as interactive buttons and they are reachable via the Tab key.aria-expandedattribute, which is correctly toggled between"true"and"false"when the diff is expanded or collapsed..file-header:focus-visibleCSS with a highly visibleoutline(matching existing styles) to clearly indicate when the header has keyboard focus.onkeydownhandler to allow expanding/collapsing using theEnterandSpacekeys (withevent.preventDefault()to stop Space from scrolling the page). The handler properly ignores events that bubble up from nested focusable elements like the "Include" checkbox..Jules/palette.mdto establish a convention for future nested interactive elements.PR created automatically by Jules for task 12865922529425570616 started by @praxstack