Skip to content

🎨 Palette: Keyboard Accessibility for Brainstorming Options - #8

Merged
pakorn269 merged 1 commit into
mainfrom
palette/brainstorming-keyboard-a11y-4681468131147141390
Mar 15, 2026
Merged

pakorn269 merged 1 commit into
mainfrom
palette/brainstorming-keyboard-a11y-4681468131147141390

Conversation

@pakorn269

Copy link
Copy Markdown
Owner

This PR improves the keyboard accessibility and screen-reader experience for the visual brainstorming tool.

💡 What

  • Automatically injects tabindex="0" and role="button" into any [data-choice] element rendered in the brainstorming frame.
  • Adds a global keydown listener to handle Enter and Space key presses on focused choices, mapping them to clicks.
  • Adds clear :focus-visible outlines to interactive elements (.option, .card, .mock-button).

🎯 Why

LLM-generated content fragments often omit a11y attributes. Instead of relying on subagents to consistently write accessible HTML for their choices, we can robustly guarantee keyboard accessibility at the frame level. This ensures all visual brainstorming options are accessible to screen readers and keyboard users immediately upon rendering.

♿ Accessibility

  • Elements correctly identify as buttons.
  • Keyboard focus is visually obvious.
  • Keyboard users can activate choices without a mouse.

PR created automatically by Jules for task 4681468131147141390 started by @pakorn269

💡 What: Automatically add `tabindex="0"` and `role="button"` to `[data-choice]` elements. Add keyboard listener for Enter/Space to trigger click, and `:focus-visible` styles.
🎯 Why: Brainstorming options were missing keyboard accessibility. Screen readers didn't announce them as interactive, and keyboard users couldn't activate them or see what was focused.
♿ Accessibility:
- Added semantic `role="button"`
- Added `tabindex="0"` for sequential keyboard navigation
- Added keyboard interaction (`Enter` and `Space`) to activate choices
- Added visible focus indicators (`:focus-visible`)

Co-authored-by: pakorn269 <[email protected]>
@google-labs-jules

Copy link
Copy Markdown

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

Copilot AI review requested due to automatic review settings March 14, 2026 02:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Improves keyboard accessibility and focus visibility for the brainstorming companion frame by automatically making [data-choice] elements keyboard-focusable and activatable via Enter/Space, plus adding :focus-visible outlines for common interactive UI classes.

Changes:

  • Auto-injects tabindex="0" and role="button" on [data-choice] elements, including after DOM mutations via MutationObserver.
  • Adds a global keydown handler to map Enter/Space to click on focused choices.
  • Adds :focus-visible outline styling for .option, .card, and .mock-button.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
skills/brainstorming/scripts/helper.js Adds automatic accessibility attribute injection and global keyboard activation handling for [data-choice].
skills/brainstorming/scripts/frame-template.html Adds focus-visible outline styles for common interactive classes used in injected content.
.Jules/palette.md Records the accessibility approach/learning for future reference.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread skills/brainstorming/scripts/helper.js Resolved
Comment thread skills/brainstorming/scripts/helper.js Resolved
@pakorn269
pakorn269 merged commit 03b4c6b into main Mar 15, 2026
4 checks passed
@pakorn269
pakorn269 deleted the palette/brainstorming-keyboard-a11y-4681468131147141390 branch March 15, 2026 11:00
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