-
Notifications
You must be signed in to change notification settings - Fork 1
🎨 Palette: Add ARIA labels to conversation delete buttons #479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| ## 2025-04-24 - Dynamic ARIA Labels in Lists | ||
| **Learning:** When adding ARIA labels to repeating elements in a list (like delete/confirmation buttons in a sidebar chat list), injecting dynamic context (e.g., `conv.title`) is essential for screen reader users to distinguish which item they are acting upon, rather than hearing repeating identical labels. | ||
| **Action:** Always look for and utilize existing dynamic data (like titles or IDs) within mapping functions to create unique, descriptive ARIA labels for list item actions. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -199,6 +199,7 @@ export function ConversationsSidebar({ | |
| className="px-1.5 py-0.5 text-[10px] border border-danger bg-danger text-white cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed" | ||
| onClick={() => void handleConfirmDelete(conv.id)} | ||
| disabled={deletingId === conv.id} | ||
| aria-label={`Confirm delete conversation: ${conv.title}`} | ||
| > | ||
| {deletingId === conv.id ? "..." : "Yes"} | ||
| </button> | ||
|
Comment on lines
199
to
205
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The async handler Recommendation: try {
await handleConfirmDelete(conv.id);
} catch (err) {
// Show error to user
}Alternatively, handle errors inside |
||
|
|
@@ -207,6 +208,7 @@ export function ConversationsSidebar({ | |
| className="px-1.5 py-0.5 text-[10px] border border-border bg-card text-muted cursor-pointer hover:border-accent hover:text-accent disabled:opacity-50 disabled:cursor-not-allowed" | ||
| onClick={() => setConfirmDeleteId(null)} | ||
| disabled={deletingId === conv.id} | ||
| aria-label={`Cancel delete conversation: ${conv.title}`} | ||
| > | ||
| No | ||
| </button> | ||
|
|
@@ -221,6 +223,7 @@ export function ConversationsSidebar({ | |
| setConfirmDeleteId(conv.id); | ||
| }} | ||
| title="Delete conversation" | ||
| aria-label={`Delete conversation: ${conv.title}`} | ||
| > | ||
| × | ||
| </button> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
aria-labelfor the confirmation button should reflect the current state of the deletion process. WhendeletingId === conv.id, the button text changes to "...", but the label remains "Confirm delete...". Updating the label to indicate that deletion is in progress provides better context for screen reader users.