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 @@
## 2024-04-22 - Missing ARIA Labels on Icon-Only Buttons
**Learning:** Common pattern found across UI components (`graph-tab.tsx`, `code-block-codemirror.tsx`) where icon-only buttons using `HugeiconsIcon` are missing `aria-label` attributes. While they often include a `title` attribute for mouse users, screen readers require the `aria-label` for proper accessibility context.
**Action:** When adding new icon-only buttons, consistently include `aria-label` alongside `title`.
3 changes: 3 additions & 0 deletions src/components/editor/extensions/code-block-codemirror.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ const CodeMirrorComponent = ({
>
<button
type="button"
aria-label="Select language"
className="flex items-center gap-1 focus:outline-none"
>
{React.createElement("selectedcontent")}
Expand Down Expand Up @@ -477,6 +478,7 @@ const CodeMirrorComponent = ({
isLineWrapped ? "text-primary" : "text-muted-foreground",
)}
title="Toggle Line Wrap"
aria-label="Toggle Line Wrap"
>
<HugeiconsIcon icon={TextWrapIcon} size={14} />
</button>
Expand All @@ -485,6 +487,7 @@ const CodeMirrorComponent = ({
onClick={handleCopy}
className="rounded p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"
title="Copy Code"
aria-label="Copy Code"
>
{copied ? (
<HugeiconsIcon
Expand Down
4 changes: 4 additions & 0 deletions src/components/graph-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1319,6 +1319,7 @@ interface ForceGraphInstance {
variant="ghost"
size="icon"
title="Reset settings"
aria-label="Reset settings"
onClick={() => setPanel(DEFAULT_PANEL)}
className="size-7"
>
Expand All @@ -1328,6 +1329,7 @@ interface ForceGraphInstance {
variant="ghost"
size="icon"
title="Close panel"
aria-label="Close panel"
onClick={() => setPaneOpen(false)}
className="size-7"
>
Expand Down Expand Up @@ -1431,6 +1433,8 @@ interface ForceGraphInstance {
<Button
variant="ghost"
size="icon"
title="Delete group"
aria-label="Delete group"
onClick={() => {
const next = panel.groups.filter(
(_, i) => i !== index,
Expand Down