diff --git a/.jules/palette.md b/.jules/palette.md index c05638899..e9d7a2949 100644 --- a/.jules/palette.md +++ b/.jules/palette.md @@ -1,3 +1,6 @@ ## 2024-05-19 - Replace HTML disabled with aria-disabled="true" for Accessible Tooltips **Learning:** Native HTML `disabled` attributes completely hide elements from screen readers and block all pointer/hover events, preventing tooltips from functioning for disabled elements. **Action:** Replace `disabled` with `aria-disabled="true"`, enforce block click handlers via `e.preventDefault()`, and add a title tooltip directly to the element to maintain full tooltip accessibility and keyboard focus support for visually impaired and mouse users. +## 2024-08-14 - Accessible Tooltips for Icon-only Buttons +**Learning:** Icon-only buttons using only `aria-label` are accessible to screen readers, but sighted mouse users miss out on crucial context because no native tooltip is shown. +**Action:** Always add a `title` attribute matching the `aria-label` to icon-only buttons (like Zoom In/Out, Pagination, or Remove actions) to provide a native browser tooltip for mouse users. diff --git a/apps/desktop/src/features/score/ScoreView.tsx b/apps/desktop/src/features/score/ScoreView.tsx index 72732450f..53cab32fc 100644 --- a/apps/desktop/src/features/score/ScoreView.tsx +++ b/apps/desktop/src/features/score/ScoreView.tsx @@ -198,6 +198,7 @@ export function ScoreView({ song, projectId, onSongUpdate }: ScoreViewProps) { onClick={projectId ? () => void handleRemove(projectId, attachment) : undefined} disabled={!projectId} aria-label={`${t("scoreRemove")}: ${attachment.fileName}`} + title={`${t("scoreRemove")}: ${attachment.fileName}`} className="size-10 border-rose-300/25 text-rose-200 hover:bg-rose-400/10" >