🎨 Palette: Improve FocusButton accessibility#308
🎨 Palette: Improve FocusButton accessibility#308google-labs-jules[bot] wants to merge 4 commits intomainfrom
Conversation
- Added `aria-pressed` state to time preset buttons.
- Added `aria-pressed` state to sound toggle button.
- Refactored greeting `<Span>` to act as an accessible button with `role="button"`, `tabIndex={0}`, `aria-pressed`, `aria-label`, and `onKeyDown` support.
|
👋 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. |
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
- Added `aria-pressed` state to time preset buttons.
- Added `aria-pressed` state to sound toggle button.
- Refactored greeting `<Span>` to act as an accessible button with `role="button"`, `tabIndex={0}`, `aria-pressed`, `aria-label`, and `onKeyDown` support.
- Add `bubbles: true` to the `KeyboardEvent` generated in tests. - This ensures the `onKeyDown` handler fires properly and registers the mock calls, satisfying code coverage requirements.
- Add `tasks: { tasks: [], totalCount: 0, hasNextPage: false, nextPage: null }` to test mocks to prevent unwanted list rendering during UI tests.
- Reverted earlier unmount additions. Tests now complete successfully and achieve appropriate test coverage for the previous accessibility enhancements.
|


This PR implements micro-UX accessibility improvements to the
FocusButtoncomponent to make it more usable for screen reader and keyboard-only users.Changes:
aria-pressedattribute to time preset buttons (presetMin1, presetMin2, presetMin3) to indicate the active selection to screen readers.aria-pressedattribute to the sound toggle button.<Span>that toggles the video greeting now has proper button semantics (role="button",tabIndex={0}), ARIA states (aria-pressed,aria-label), and handles keyboard interaction (EnterandSpacekeys) viaonKeyDown.PR created automatically by Jules for task 13639169483460575839 started by @ibsukru