Skip to content

🎨 Palette: [UX improvement] Improve ProjectUpload accessibility#82

Merged
madara88645 merged 1 commit intomainfrom
palette-upload-a11y-7728302375148618639
Mar 20, 2026
Merged

🎨 Palette: [UX improvement] Improve ProjectUpload accessibility#82
madara88645 merged 1 commit intomainfrom
palette-upload-a11y-7728302375148618639

Conversation

@madara88645
Copy link
Owner

💡 What: Added full keyboard navigation support, ARIA states, and an Escape key listener to the ProjectUpload modal.
🎯 Why: Previously, users relying on keyboard navigation could not easily trigger the upload file picker by tabbing to the drag-and-drop zone. Furthermore, the loading spinner was invisible to screen readers, and the modal lacked the standard Escape key functionality to close it.
📸 Before/After:
(UI visibly looks identical, improvements are invisible/semantic)
♿ Accessibility:

  • Added role="button" and tabIndex={0} to the .upload-zone div to make it focusable.
  • Added onKeyDown to handle Enter or Space key presses to trigger the file picker.
  • Added aria-live="polite" and aria-busy="true" to the analyzing state to announce upload status.
  • Implemented Escape key logic to close the modal for better keyboard operation.

PR created automatically by Jules for task 7728302375148618639 started by @madara88645

- Added Escape key support to close the modal.
- Made the file drop zone keyboard-accessible by adding role="button", tabIndex={0}, and an onKeyDown handler for Enter/Space keys.
- Prevented the nested inner "Select Folder" button from double-focusing.
- Added aria-live="polite" and aria-busy="true" to the "Analyzing Project..." state for screen reader announcements.
Copilot AI review requested due to automatic review settings March 20, 2026 00:05
@google-labs-jules
Copy link

👋 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.

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the accessibility and keyboard usability of the ProjectUpload modal in the explorer UI, targeting keyboard-only navigation and screen reader announcements during the analysis/upload flow.

Changes:

  • Added a global Escape key listener to close the upload modal (when not analyzing).
  • Made the upload drop-zone keyboard-focusable and activatable via Enter/Space, with ARIA labeling.
  • Improved screen reader behavior for the analyzing state (live region + spinner hidden from AT).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +9 to +13
const handleKeyDown = (e) => {
if (e.key === 'Escape' && isModalOpen && !isAnalyzing) {
setIsModalOpen(false);
}
};
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

The Escape key handler is attached to window unconditionally, which means it will fire alongside other global Escape listeners (e.g., SearchBar closes and clears on Escape). When the upload modal is open, pressing Escape will likely clear the search state in the background as well. Consider only registering the listener while the modal is open and/or handling Escape at the modal level (so it doesn’t interfere with unrelated global shortcuts).

Suggested change
const handleKeyDown = (e) => {
if (e.key === 'Escape' && isModalOpen && !isAnalyzing) {
setIsModalOpen(false);
}
};
// Only attach the Escape handler while the modal is open and not analyzing
if (!isModalOpen || isAnalyzing) {
return;
}
const handleKeyDown = (e) => {
if (e.key === 'Escape') {
setIsModalOpen(false);
}
};

Copilot uses AI. Check for mistakes.
multiple
/>
<button className="upload-select-btn">Select Folder</button>
<button className="upload-select-btn" tabIndex={-1} aria-hidden="true">Select Folder</button>
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

aria-hidden="true" is applied to an interactive <button>. Even with tabIndex={-1}, this is still clickable and can be programmatically focused, which conflicts with WAI-ARIA guidance (hidden content shouldn’t be interactive). If the button is purely decorative, consider rendering a non-interactive element (e.g., <span>/<div>) styled like a button; if it’s meant to be interactive, it shouldn’t be aria-hidden and should remain keyboard-accessible.

Suggested change
<button className="upload-select-btn" tabIndex={-1} aria-hidden="true">Select Folder</button>
<span className="upload-select-btn">Select Folder</span>

Copilot uses AI. Check for mistakes.
Comment on lines +98 to +103
onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
fileInputRef.current?.click();
}
}}
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

The keyboard handler checks for e.key === ' ' for Space. Some browsers / environments may report Space as 'Spacebar' (legacy) or you may prefer checking e.code === 'Space' for consistency. Expanding the check improves robustness of Space-to-activate behavior for the upload zone.

Copilot uses AI. Check for mistakes.
@madara88645 madara88645 merged commit 7ce8ba5 into main Mar 20, 2026
10 checks passed
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.

2 participants