🎨 Palette: [UX improvement] - Fix accessibility and contrast in UploadResumeModal#438
🎨 Palette: [UX improvement] - Fix accessibility and contrast in UploadResumeModal#438aafre wants to merge 1 commit into
Conversation
…dResumeModal
* **💡 What:**
* Added an `aria-label` to the Close icon button in the `UploadResumeModal`.
* Added keyboard `focus-visible` styles to the Close and Cancel buttons.
* Improved the hover state contrast of the Cancel button.
* Updated the file input to use `sr-only peer` instead of `hidden` so it receives keyboard focus, and styled the adjacent `<label>` with `peer-focus-visible` to display the focus ring.
* **🎯 Why:**
* Icon-only buttons need an `aria-label` for screen reader users to understand their purpose.
* The file input was hidden from the DOM tab order using `className="hidden"`, meaning keyboard users could not focus on it to upload files.
* The "Cancel" button's hover state lacked contrast and didn't clearly indicate focus for keyboard users.
* **♿ Accessibility:**
* Screen readers now announce "Close modal".
* Keyboard users can now tab to the "Choose File" button, see the focus ring, and activate it with Space/Enter.
* Focus visibility is ensured for all interactive elements in the modal footer and header.
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. |
There was a problem hiding this comment.
Code Review
This pull request enhances the accessibility and keyboard navigation of the UploadResumeModal component by adding focus rings to buttons, including an ARIA label for the close button, and updating the file input to be screen-reader accessible. Feedback was provided to correct the styling of the file input label, specifically replacing the ineffective disabled:opacity-50 utility with peer-disabled variants to correctly reflect the state of the associated input during parsing.
| <label | ||
| htmlFor="resume-file-input" | ||
| className="btn-primary inline-flex items-center gap-2 px-6 py-3 cursor-pointer disabled:opacity-50" | ||
| className="btn-primary inline-flex items-center gap-2 px-6 py-3 cursor-pointer disabled:opacity-50 peer-focus-visible:ring-2 peer-focus-visible:ring-accent peer-focus-visible:ring-offset-2 peer-focus-visible:outline-none" |
There was a problem hiding this comment.
The disabled:opacity-50 utility is ineffective on a element because labels do not support the :disabled pseudo-class. Since the associated input is a sibling with the peer class, you should use peer-disabled:opacity-50 to correctly reflect the disabled state visually. Additionally, adding peer-disabled:cursor-not-allowed improves the user experience by signaling that the element is inactive while parsing is in progress, and peer-focus-visible:outline-none is redundant as labels do not have a default focus outline.
| className="btn-primary inline-flex items-center gap-2 px-6 py-3 cursor-pointer disabled:opacity-50 peer-focus-visible:ring-2 peer-focus-visible:ring-accent peer-focus-visible:ring-offset-2 peer-focus-visible:outline-none" | |
| className="btn-primary inline-flex items-center gap-2 px-6 py-3 cursor-pointer peer-disabled:opacity-50 peer-disabled:cursor-not-allowed peer-focus-visible:ring-2 peer-focus-visible:ring-accent peer-focus-visible:ring-offset-2" |
🎨 Palette: [UX improvement] - Fix accessibility and contrast in UploadResumeModal
aria-labelto the Close icon button in theUploadResumeModal.focus-visiblestyles to the Close and Cancel buttons.sr-only peerinstead ofhiddenso it receives keyboard focus, and styled the adjacent<label>withpeer-focus-visibleto display the focus ring.aria-labelfor screen reader users to understand their purpose.className="hidden", meaning keyboard users could not focus on it to upload files.PR created automatically by Jules for task 11032632034912310741 started by @aafre