🎨 Palette: Improve accessibility of Upload and Link Insertion modals#400
🎨 Palette: Improve accessibility of Upload and Link Insertion modals#400aafre wants to merge 2 commits into
Conversation
Added critical accessibility attributes to `UploadResumeModal` and `LinkInsertionModal`: - Added explicit `type="button"` to all interactive buttons to prevent implicit form submissions. - Added explicit `role="dialog"` and `aria-modal="true"` wrapper properties. - Configured proper `aria-labelledby` IDs for screen readers to announce modal titles contextually. - Implemented robust `focus-visible` states using Tailwind for explicit keyboard navigation affordances. - Appended `aria-label`s on icon-only buttons (e.g. `XMarkIcon`). Co-authored-by: aafre <8656674+aafre@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. |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on a crucial accessibility improvement across the application's modal components. By refining the semantic structure and interaction patterns of the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request significantly improves the accessibility of the UploadResumeModal and LinkInsertionModal components. The changes, such as adding ARIA attributes (role, aria-modal, aria-labelledby), providing explicit labels for icon-only buttons, ensuring visible focus states for keyboard users, and setting type="button" on buttons to prevent default form behaviors, are all excellent and follow best practices for accessible web development.
I have one suggestion regarding the use of any in UploadResumeModal.tsx to further improve type safety. Overall, this is a great set of improvements.
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| const [parseResult, setParseResult] = useState<any>(null); |
There was a problem hiding this comment.
Instead of disabling the ESLint rule for no-explicit-any, it would be better to provide a proper type for the parseResult state. This improves type safety and maintainability.
The ParseResponse interface, which is the correct type for this state, is defined in useResumeParser.ts. You can export it from that file and import it here.
Suggested changes:
-
In
resume-builder-ui/src/hooks/useResumeParser.ts, export the interface:export interface ParseResponse { // ... contents of the interface }
-
Then, in this file (
UploadResumeModal.tsx), you can import the type and update the state definition, which would allow you to replace the current lines with:import { useResumeParser, type ParseResponse } from '../hooks/useResumeParser'; // ... const [parseResult, setParseResult] = useState<ParseResponse | null>(null);
Added critical accessibility attributes to `UploadResumeModal` and `LinkInsertionModal`: - Added explicit `type="button"` to all interactive buttons to prevent implicit form submissions. - Added explicit `role="dialog"` and `aria-modal="true"` wrapper properties. - Configured proper `aria-labelledby` IDs for screen readers to announce modal titles contextually. - Implemented robust `focus-visible` states using Tailwind for explicit keyboard navigation affordances. - Appended `aria-label`s on icon-only buttons (e.g. `XMarkIcon`). Co-authored-by: aafre <8656674+aafre@users.noreply.github.com>
💡 What: Improved the accessibility and semantic HTML structure of the
UploadResumeModalandLinkInsertionModalcomponents.🎯 Why: To ensure screen readers can accurately interpret modal focus states and context, to provide clear visual focus indicators for keyboard-only users, and to prevent unintended default form submission behaviors by explicitly defining button types.
♿ Accessibility: Added
role="dialog",aria-modal="true",aria-labelledbyto modal wrappers; addedaria-labelto icon-only close buttons; added explicittype="button"to interactive elements; addedfocus-visible:ring-2 focus-visible:ring-accentfor clear focus rings.PR created automatically by Jules for task 2012128871318110399 started by @aafre