Skip to content

🎨 Palette: Improve MatchPreviewModal Accessibility & Keyboard Navigation - #89

Open
jspann21 wants to merge 1 commit into
mainfrom
palette-a11y-match-preview-modal-11510507886073752544
Open

🎨 Palette: Improve MatchPreviewModal Accessibility & Keyboard Navigation#89
jspann21 wants to merge 1 commit into
mainfrom
palette-a11y-match-preview-modal-11510507886073752544

Conversation

@jspann21

@jspann21 jspann21 commented Aug 2, 2026

Copy link
Copy Markdown
Owner

💡 What: Improved the accessibility of the MatchPreviewModal.

  1. Added a global keydown event listener for the Escape key that closes the modal.
  2. Added role="dialog" and aria-modal="true" to the modal's container element.
  3. Added a native HTML title attribute to the candidate titles in the selection list.

🎯 Why:
Custom modal components (built with divs rather than native <dialog> elements) lack native keyboard and screen-reader behaviors.

  • Without an Escape key listener, keyboard users are forced to tab to the "Cancel" button.
  • Without ARIA attributes, screen reader users may not realize their focus is trapped within a modal context.
  • The titles in the match list use CSS truncation (truncate), meaning long titles were permanently cut off. Adding the title attribute enables a native OS tooltip so users can read the full text before confirming a match.

📸 Before/After:
(Visual changes are minimal, primarily consisting of the native OS tooltip appearing when hovering over truncated titles in the list)

Accessibility:

  • Ensures screen readers announce the component as an active dialog (role="dialog", aria-modal="true").
  • Enables standard keyboard-dismissal patterns (Escape to close).
  • Makes truncated text readable via standard tooltip mechanisms.

PR created automatically by Jules for task 11510507886073752544 started by @jspann21

…reviewModal

Added an explicit `Escape` keydown listener to `MatchPreviewModal` to allow users to dismiss it using the keyboard. Included `role="dialog"` and `aria-modal="true"` to ensure screen readers properly announce the container as a modal. Also added a `title` attribute to the truncated candidate titles so users can view the full text on hover.

Co-authored-by: jspann21 <179991454+jspann21@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.

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