🎨 Palette: [UX improvement] Add accessibility to UploadResumeModal close button#482
🎨 Palette: [UX improvement] Add accessibility to UploadResumeModal close button#482aafre wants to merge 1 commit into
Conversation
…umeModal close button Added `aria-label` and `focus-visible` styling to the icon-only close button in `UploadResumeModal` for better screen reader and keyboard navigation support. 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 improves the accessibility of the close button in the UploadResumeModal by adding focus states and an aria-label, while also updating the .Jules/palette.md documentation with these new guidelines. Feedback focuses on further enhancing accessibility by increasing the button's target size with padding, simplifying the aria-label for consistency, and ensuring the modal implementation includes a focus trap and Escape key handling.
| className="text-white/80 hover:text-white transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-white rounded-md" | ||
| aria-label="Close upload resume modal" |
There was a problem hiding this comment.
To improve accessibility and consistency:
- Target Size: The current button has a small hit area (24x24px). Adding padding (e.g., p-2) will increase the target size to approximately 40x40px, making it easier to click or tap.
- Conciseness: Use a concise aria-label="Close" for consistency with other project modals.
- Focus Trap: Ensure this modal implements a focus trap to keep keyboard focus within the modal's focusable elements while it is open, as required by repository accessibility standards.
| className="text-white/80 hover:text-white transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-white rounded-md" | |
| aria-label="Close upload resume modal" | |
| className="p-2 text-white/80 hover:text-white transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-white rounded-md" | |
| aria-label="Close" |
References
- For accessibility, all modals must implement a focus trap to ensure keyboard focus remains within the modal's focusable elements while it is open.
|
|
||
| ## 2025-04-19 - Accessible Close Buttons on Modals | ||
| **Learning:** Icon-only close buttons in custom modals (like `UploadResumeModal`) often lack accessible names for screen readers and lack visible focus states for keyboard users, making modal dismissal difficult for some users. | ||
| **Action:** When adding or updating custom modal close buttons (e.g., using `XMarkIcon`), explicitly add an `aria-label` and utilize explicit focus states (like `focus:outline-none focus-visible:ring-2 focus-visible:ring-white rounded-md`) to ensure proper keyboard navigation visibility and accessibility. |
There was a problem hiding this comment.
The accessibility guideline for custom modals should be more comprehensive. Beyond the close button's label and focus state, it should also mandate a minimum target size and remind developers about the focus trap and keyboard navigation requirements already established in the repository's general rules.
| **Action:** When adding or updating custom modal close buttons (e.g., using `XMarkIcon`), explicitly add an `aria-label` and utilize explicit focus states (like `focus:outline-none focus-visible:ring-2 focus-visible:ring-white rounded-md`) to ensure proper keyboard navigation visibility and accessibility. | |
| **Action:** When adding or updating custom modal close buttons (e.g., using XMarkIcon), explicitly add a concise aria-label="Close", ensure a minimum target size of 44x44px (e.g., using p-2), and utilize explicit focus states. Additionally, ensure the modal implements a focus trap and handles the Escape key for dismissal to comply with repository accessibility standards. |
References
- For accessibility, all modals must implement a focus trap to ensure keyboard focus remains within the modal's focusable elements while it is open.
- Ensure documentation, such as testing plans, is updated to reflect UI and implementation changes made in the same pull request.
|
Closing duplicate — the most recent version of this change is PR #537. |
💡 What: Added
aria-labelandfocus-visiblestyling to the icon-only close button inUploadResumeModal.🎯 Why: To ensure screen reader users understand the button's purpose and to provide a clear visual indicator for keyboard navigation users.
♿ Accessibility:
aria-label="Close upload resume modal"to the<button>.focus:outline-none focus-visible:ring-2 focus-visible:ring-white rounded-mdfor a clear focus ring.PR created automatically by Jules for task 11736001868483166360 started by @aafre