Skip to content

🎨 Palette: [UX improvement] Add ARIA labels to assistant icon buttons#145

Open
Cukurikik wants to merge 1 commit into
mainfrom
palette/a11y-assistant-buttons-690885304004379964
Open

🎨 Palette: [UX improvement] Add ARIA labels to assistant icon buttons#145
Cukurikik wants to merge 1 commit into
mainfrom
palette/a11y-assistant-buttons-690885304004379964

Conversation

@Cukurikik
Copy link
Copy Markdown
Collaborator

@Cukurikik Cukurikik commented Mar 27, 2026

💡 What: Added aria-label attributes to the 5 icon-only buttons (Attach file, Send Image to Vision Model, Voice Input, Cancel, and Send message) in the Assistant page input area.
🎯 Why: Icon-only buttons without aria-label attributes are completely inaccessible to screen reader users, who will just hear "button" without context. Adding labels makes the interface more inclusive and intuitive for non-visual users.
📸 Before/After: Visuals remain unchanged.
♿ Accessibility: Improved screen reader navigation and clarity by giving explicit names to icon-only actions.


PR created automatically by Jules for task 690885304004379964 started by @Cukurikik

Summary by CodeRabbit

  • Bug Fixes
    • Improved screen reader support for input controls in the assistant interface, enhancing accessibility for users with assistive technologies.

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 27, 2026

📝 Walkthrough

Walkthrough

Added aria-label attributes to five action buttons in the assistant input console for improved accessibility: attachment, image-to-vision, voice input, and conditional "Cancel request" and "Send message" buttons. No functional logic or UI state transitions were modified.

Changes

Cohort / File(s) Summary
Accessibility Enhancements
src/app/assistant/page.tsx
Added aria-label attributes to attachment, image-to-vision, voice input, and conditional send/cancel buttons to improve screen reader support.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 With labels of care, the buttons now speak,
Screen readers rejoice at accessibility's peak,
No logic was changed, just kindness so true,
Every assistant user now knows what to do! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding ARIA labels to assistant icon buttons for accessibility improvement.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch palette/a11y-assistant-buttons-690885304004379964

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/app/assistant/page.tsx (2)

443-443: Add title attribute for consistency.

The Cancel button should include a title attribute matching the aria-label for consistency with the attachment, image, and voice buttons (lines 413-421). This provides tooltip feedback for mouse users.

♻️ Proposed fix
-                    aria-label="Cancel request"
+                    aria-label="Cancel request"
+                    title="Cancel request"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/app/assistant/page.tsx` at line 443, The Cancel button element that
currently has aria-label="Cancel request" should also include a title="Cancel
request" attribute for consistency with the other toolbar buttons (attachment,
image, voice) so mouse users see the same tooltip; locate the button JSX in
src/app/assistant/page.tsx that uses aria-label="Cancel request" and add the
matching title attribute to the same element.

451-451: Add title attribute for consistency.

The Send button should include a title attribute matching the aria-label for consistency with the attachment, image, and voice buttons (lines 413-421). This provides tooltip feedback for mouse users.

♻️ Proposed fix
-                    aria-label="Send message"
+                    aria-label="Send message"
+                    title="Send message"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/app/assistant/page.tsx` at line 451, The Send button element that
currently has aria-label="Send message" should also include a title attribute
for consistency with the attachment/image/voice buttons; update the Send button
(the element with aria-label "Send message") to add title="Send message" so
mouse users get the same tooltip feedback as the other buttons.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/app/assistant/page.tsx`:
- Line 444: Implement a real cancel handler using AbortController: create and
store an AbortController instance (e.g., in a React ref like
requestAbortControllerRef) when starting the request in the function that sends
the request (e.g., sendRequest/fetchAssistantResponse), pass controller.signal
into the fetch/axios call there, and wire the Cancel button's onClick to call
requestAbortControllerRef.current?.abort() and then clear/reset any loading
state and controller ref; also ensure the request promise catch handles
AbortError specifically to avoid showing an error toast. Reference the onClick
placeholder in page.tsx, the request-sending function
(sendRequest/fetchAssistantResponse), and a requestAbortControllerRef (or
similar) when making these changes.

---

Nitpick comments:
In `@src/app/assistant/page.tsx`:
- Line 443: The Cancel button element that currently has aria-label="Cancel
request" should also include a title="Cancel request" attribute for consistency
with the other toolbar buttons (attachment, image, voice) so mouse users see the
same tooltip; locate the button JSX in src/app/assistant/page.tsx that uses
aria-label="Cancel request" and add the matching title attribute to the same
element.
- Line 451: The Send button element that currently has aria-label="Send message"
should also include a title attribute for consistency with the
attachment/image/voice buttons; update the Send button (the element with
aria-label "Send message") to add title="Send message" so mouse users get the
same tooltip feedback as the other buttons.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 47642480-7d01-41d4-b09c-b8f9e5226e55

📥 Commits

Reviewing files that changed from the base of the PR and between 4a0187c and 82d0f00.

📒 Files selected for processing (1)
  • src/app/assistant/page.tsx

{isLoading ? (
<button
aria-label="Cancel request"
onClick={() => {/* Implement Cancel */}}
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.

⚠️ Potential issue | 🟠 Major

Cancel handler is not implemented.

The onClick handler contains only a placeholder comment. Users can click this button while a request is loading, but nothing happens. This creates a confusing experience where a prominent "Cancel" button appears non-functional.

Do you want me to generate an implementation for request cancellation using AbortController, or would you prefer to track this as a separate issue?

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/app/assistant/page.tsx` at line 444, Implement a real cancel handler
using AbortController: create and store an AbortController instance (e.g., in a
React ref like requestAbortControllerRef) when starting the request in the
function that sends the request (e.g., sendRequest/fetchAssistantResponse), pass
controller.signal into the fetch/axios call there, and wire the Cancel button's
onClick to call requestAbortControllerRef.current?.abort() and then clear/reset
any loading state and controller ref; also ensure the request promise catch
handles AbortError specifically to avoid showing an error toast. Reference the
onClick placeholder in page.tsx, the request-sending function
(sendRequest/fetchAssistantResponse), and a requestAbortControllerRef (or
similar) when making these changes.

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