Implement correctly
Build Accordion without breaking its behavior
# Implement Accordion in your agent ## Objective Implement Accordion for this verified behavior: A vertical set of headings that reveals or hides each associated content section. ## Prerequisites - Inspect the repository, design system, and existing tests first. - Preserve unrelated changes and keep the file scope bounded. - Confirm that Accordion matches the need before writing code. ## Required behavior - Activating a header reveals or hides its associated content while exposing expanded state. - Arrow keys move through related items according to their visual orientation. ## States to cover - Refunds collapsed - Refunds expanded ## Accessibility - ARIA role: heading > button[aria-expanded][aria-controls] + region - The primary control or named region for Accordion has a stable accessible name from visible text or an explicit programmatic label; placeholder text and tooltips are not names. - Focus remains on the header button when its panel opens or closes. - Each expanded panel closes by activating its own header when the product allows collapse. - Heading level, button name, expanded state, and controlled relationship are exposed. - Tab reaches every header button - Enter or Space toggles a section - Optional arrow keys move between headers ## When not to use - All content is short enough to show directly - The sections are primary destinations that need URLs ## Acceptance criteria - Every header is a real button inside a meaningful heading - Expanded state matches visible content - Single or multiple expansion is intentional - Opening and closing never moves focus unexpectedly ## Guardrails - Show the proposed changes before any external action. - Do not publish, send, delete, pay for, or change remote state without explicit authorization. - Preserve unrelated changes and stop if the scope becomes ambiguous. ## Output format - Outcome or verdict. - Files or actions involved. - Checks run and observable evidence. - Remaining blockers or limitations.
- @radix-ui/react-accordion
- Requires · Access to the repository, design system, and tests
Why it works
- The need is tied to canonical behavior before any technical choice.
- States, accessibility, and non-goals prevent a merely visual implementation.
- Acceptance criteria and the output format make verification observable.
Try next
Verify Accordion on a real journey
# Verify Accordion after implementation ## Objective Audit the Accordion implementation against its behavior, states, and accessibility requirements without changing it automatically. ## Checks - Replay the smallest representative journey. - Check keyboard behavior, focus, accessible name, and announcements. - Tie each gap to a specific acceptance criterion. ## Guardrails - Show the proposed changes before any external action. - Do not publish, send, delete, pay for, or change remote state without explicit authorization. - Preserve unrelated changes and stop if the scope becomes ambiguous. ## Output format - Outcome or verdict. - Files or actions involved. - Checks run and observable evidence. - Remaining blockers or limitations.
sha256:711280266c8e17e9d48287fea4e77abe16c58c9e6a89077fe44d728c8279ebe5