-
Notifications
You must be signed in to change notification settings - Fork 1
🎨 Palette: Improve accessibility of sidebar buttons #147
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 @@ | ||
| ## 2024-05-22 - [Hiding visual characters from screen readers] | ||
| **Learning:** Icon-only buttons or buttons using characters like `×` or `×` as icons can be confusing for screen reader users if not properly labeled. The character itself might be announced as "multiplication sign" or similar. | ||
| **Action:** Always provide an explicit `aria-label` for such buttons and wrap the visual character in a `<span>` with `aria-hidden="true"`. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -119,7 +119,7 @@ export function ConversationsSidebar({ | |
| onClick={onClose} | ||
| aria-label="Close chats panel" | ||
| > | ||
| × | ||
| <span aria-hidden="true">×</span> | ||
| </button> | ||
| </div> | ||
| )} | ||
|
|
@@ -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" | ||
| > | ||
| {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. Missing User Feedback on Deletion FailureIf try {
await handleDeleteConversation(id);
} catch (err) {
// Show error to user, e.g., set an error state and display a message
}This will improve the user experience and make error handling more robust. |
||
|
|
@@ -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" | ||
| > | ||
| No | ||
| </button> | ||
|
|
@@ -221,8 +223,9 @@ export function ConversationsSidebar({ | |
| setConfirmDeleteId(conv.id); | ||
| }} | ||
| title="Delete conversation" | ||
| aria-label="Delete conversation" | ||
| > | ||
| × | ||
| <span aria-hidden="true">×</span> | ||
| </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.
For better accessibility, consider adding the
aria-busyattribute. This will indicate to screen reader users that this button is in a loading state while the delete operation is in progress.