Skip to content

🎨 Palette: Add accessibility attributes to Duplicate and Upload modals#506

Closed
aafre wants to merge 1 commit into
mainfrom
palette-ux-modals-12082853777398001689
Closed

🎨 Palette: Add accessibility attributes to Duplicate and Upload modals#506
aafre wants to merge 1 commit into
mainfrom
palette-ux-modals-12082853777398001689

Conversation

@aafre
Copy link
Copy Markdown
Owner

@aafre aafre commented May 2, 2026

  • What: Added aria-label to the close button in UploadResumeModal.tsx. Added role="dialog", aria-modal="true", aria-labelledby, and Escape key support to DuplicateResumeModal.tsx.
  • Why: To improve keyboard navigation and screen reader support for these modals.
  • Before/After: N/A (no visual changes).
  • Accessibility: Improved screen reader support by adding necessary ARIA attributes and improved keyboard navigation by adding Escape key support to close the modal.

PR created automatically by Jules for task 12082853777398001689 started by @aafre

Co-authored-by: aafre <8656674+aafre@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.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enhances the accessibility of the DuplicateResumeModal and UploadResumeModal components by adding ARIA attributes, backdrop click-to-close functionality, and 'Escape' key support. Feedback focuses on optimizing the 'Escape' key event listener to only attach when the modal is active, implementing a focus trap for both modals to meet accessibility requirements, and ensuring UploadResumeModal includes the same interaction improvements as the duplicate modal.

Comment on lines +27 to +35
useEffect(() => {
const handleKeyDown = (e: KeyboardEvent) => {
if (e.key === 'Escape' && isOpen) {
onCancel();
}
};
document.addEventListener('keydown', handleKeyDown);
return () => document.removeEventListener('keydown', handleKeyDown);
}, [isOpen, onCancel]);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The keydown event listener is currently attached to the document even when the modal is closed (since the component remains mounted but returns null at line 37). It is more efficient to only attach the listener when isOpen is true.

Suggested change
useEffect(() => {
const handleKeyDown = (e: KeyboardEvent) => {
if (e.key === 'Escape' && isOpen) {
onCancel();
}
};
document.addEventListener('keydown', handleKeyDown);
return () => document.removeEventListener('keydown', handleKeyDown);
}, [isOpen, onCancel]);
useEffect(() => {
if (!isOpen) return;
const handleKeyDown = (e: KeyboardEvent) => {
if (e.key === 'Escape') {
onCancel();
}
};
document.addEventListener('keydown', handleKeyDown);
return () => document.removeEventListener('keydown', handleKeyDown);
}, [isOpen, onCancel]);

<div
className="bg-white rounded-lg shadow-xl max-w-md w-full mx-4"
onClick={(e) => e.stopPropagation()}
role="dialog"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This modal is missing a focus trap, which is required by the general rules to ensure keyboard focus remains within the modal's focusable elements while it is open. This prevents users from accidentally tabbing out of the modal into the background content.

References
  1. For accessibility, all modals must implement a focus trap to ensure keyboard focus remains within the modal's focusable elements while it is open.

<button
onClick={handleCloseModal}
className="text-white/80 hover:text-white transition-colors"
aria-label="Close dialog"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While adding aria-label to the close button is a good improvement, this modal is still missing several critical accessibility and UX features that were implemented in DuplicateResumeModal.tsx in this PR. To ensure consistency and full accessibility, please consider adding:

  • role="dialog" and aria-modal="true" to the modal container.
  • aria-labelledby linked to the modal title.
  • Escape key support to close the modal.
  • 'Click outside to close' functionality on the backdrop.
  • A focus trap (as required by the repository rules).
References
  1. For accessibility, all modals must implement a focus trap to ensure keyboard focus remains within the modal's focusable elements while it is open.

@aafre
Copy link
Copy Markdown
Owner Author

aafre commented May 25, 2026

Closing duplicate — the most recent version of this change is PR #533.

@aafre aafre closed this May 25, 2026
@google-labs-jules
Copy link
Copy Markdown
Contributor

Closing duplicate — the most recent version of this change is PR #533.

Understood. Acknowledging that this work is a duplicate and stopping work on 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