Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .Jules/palette.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 2025-02-23 - Dynamic ARIA Labels on Icon-only Buttons
**Learning:** Icon-only interactive elements like notification bells often lack context-aware ARIA attributes. A static `aria-label="Notifications"` does not communicate crucial dynamic state (e.g., whether there are unread notifications) to assistive technologies.
**Action:** When creating or updating icon-only buttons that convey state visually (e.g., with a badge or unread count), ensure the `aria-label` dynamically reflects that state (e.g., `"Notifications, 3 unread"` instead of just `"Notifications"`).
Binary file added notification_bell_screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/components/notifications/notification-bell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export function NotificationBell() {
variant="ghost"
size="icon"
className="relative text-foreground/70 hover:text-foreground hover:bg-accent/10"
aria-label={count > 0 ? `Notifications, ${count} unread` : "Notifications"}
>
<Bell className="w-5 h-5" />
{count > 0 && (
Expand Down