diff --git a/.jules/palette.md b/.jules/palette.md new file mode 100644 index 0000000..8c57b0d --- /dev/null +++ b/.jules/palette.md @@ -0,0 +1,3 @@ +## 2026-05-01 - Add context to interactive widgets lacking descriptive labels +**Learning:** Generic visual labels like `[hide]` or `[show]` on interactive widgets lack context for screen reader users when they navigate out of the visual flow. Relying purely on visual layout for context is a common accessibility trap. +**Action:** Always provide a contextual `aria-label` (e.g., `"Hide [Section Title]"`) when the visual text of a button is ambiguous or repetitive. Additionally, use `useId` to reliably map `aria-controls` to the content `id` avoiding collisions. diff --git a/src/components/wiki/wiki-collapsible.tsx b/src/components/wiki/wiki-collapsible.tsx index 5284dd8..f507721 100644 --- a/src/components/wiki/wiki-collapsible.tsx +++ b/src/components/wiki/wiki-collapsible.tsx @@ -1,6 +1,6 @@ "use client"; -import { useState } from "react"; +import { useState, useId } from "react"; interface WikiCollapsibleProps { title: string; @@ -14,6 +14,7 @@ export function WikiCollapsible({ defaultOpen = true, }: WikiCollapsibleProps) { const [isOpen, setIsOpen] = useState(defaultOpen); + const contentId = useId(); return (