🎨 Palette: Add aria-label to delete conversation button#488
Conversation
Added an `aria-label` attribute to the icon-only "×" button in `ConversationsSidebar` that deletes conversations. This ensures the button is properly accessible to screen readers, providing context that was previously only available via the `title` tooltip or visual context.
|
👋 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. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
| setConfirmDeleteId(conv.id); | ||
| }} |
There was a problem hiding this comment.
There is no guard against opening a new delete confirmation dialog while a delete operation is already in progress (deletingId). This could lead to inconsistent UI state if the user rapidly clicks delete on multiple conversations.
Recommended solution:
Add a check to prevent setting a new confirmation while a delete is ongoing:
if (!deletingId) setConfirmDeleteId(conv.id);There was a problem hiding this comment.
Code Review
This pull request improves accessibility by adding an aria-label to the delete button in the ConversationsSidebar and documenting this practice in the project's learning palette. The review feedback suggests enhancing the label by including the conversation title to provide better context for screen reader users, ensuring they can distinguish which specific conversation is being deleted.
| setConfirmDeleteId(conv.id); | ||
| }} | ||
| title="Delete conversation" | ||
| aria-label="Delete conversation" |
There was a problem hiding this comment.
Since this button is repeated for every conversation in the list, using a static aria-label makes it difficult for screen reader users to distinguish which conversation each button refers to. Including the conversation title in the label provides necessary context for the destructive action.
| aria-label="Delete conversation" | |
| aria-label={`Delete conversation: ${conv.title}`} |
💡 What
Added an
aria-labelattribute to the icon-only "×" button used for deleting conversations in theConversationsSidebarcomponent.🎯 Why
Icon-only buttons rely on explicit labels for accessibility. While a
titleattribute existed, relying solely ontitleis insufficient for robust screen reader support. Adding anaria-labelensures the purpose of the button ("Delete conversation") is clearly announced to users relying on assistive technologies.📸 Before/After
Not a visual change.
♿ Accessibility
Improved screen reader accessibility by providing an explicit programmatic label for a destructive action button.
PR created automatically by Jules for task 7777317479155683889 started by @Dexploarer