fix(a11y): add aria-pressed to date preset and day-of-week toggle buttons#1913
fix(a11y): add aria-pressed to date preset and day-of-week toggle buttons#1913bluzername wants to merge 1 commit intopaperclipai:masterfrom
Conversation
Toggle buttons that switch between options (like radio buttons but styled as button groups) was missing aria-pressed attribute. Screen reader users cannot tell which option is currently selected - they only hear "button" without knowing if it's the active one. Added aria-pressed to two places: - Costs page date range presets (7d, 30d, 90d, custom) - ScheduleEditor day-of-week selector (Mon, Tue, Wed, etc) Both use the variant change (secondary/default vs ghost/outline) for visual indication, but that is not announced by assistive technology. aria-pressed make screen readers announce "pressed" or "not pressed" for each button.
Greptile SummaryThis PR adds Confidence Score: 5/5Safe to merge — two one-line ARIA additions with no logic or visual risk. Both changes are a single attribute added to existing JSX props; they don't alter any logic, state, or rendering. No P0/P1 issues exist. The only open item is a process concern (missing thinking path in the PR description), which doesn't affect code correctness. No files require special attention. Important Files Changed
Prompt To Fix All With AIThis is a comment left during a code review.
Path: ui/src/pages/Costs.tsx
Line: 557
Comment:
**PR description is missing a thinking path and risks section**
Per CONTRIBUTING.md, PR descriptions should include a **thinking path** — a top-down chain of reasoning from the project level down to the specific change — as well as explicit details on risks (even if there are none). For example:
> - Paperclip orchestrates AI agents for zero-human companies
> - Humans and assistive-technology users interact with the web UI
> - Screen-reader users rely on ARIA attributes to understand widget state
> - Toggle button groups in the UI were missing `aria-pressed`, so their active state was invisible to screen readers
> - This PR adds `aria-pressed` to the date-preset and day-of-week toggle groups
> - **Risks:** None — ARIA attributes are purely additive and have no effect on visual rendering or logic
Please add both sections to the PR description so reviewers have the full context the guide asks for.
**Context Used:** CONTRIBUTING.md has a guide for a good PR message ... ([source](https://app.greptile.com/review/custom-context?memory=instruction-0))
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(a11y): add aria-pressed to toggle bu..." | Re-trigger Greptile |
| variant={preset === key ? "secondary" : "ghost"} | ||
| size="sm" | ||
| onClick={() => setPreset(key)} | ||
| aria-pressed={preset === key} |
There was a problem hiding this comment.
PR description is missing a thinking path and risks section
Per CONTRIBUTING.md, PR descriptions should include a thinking path — a top-down chain of reasoning from the project level down to the specific change — as well as explicit details on risks (even if there are none). For example:
- Paperclip orchestrates AI agents for zero-human companies
- Humans and assistive-technology users interact with the web UI
- Screen-reader users rely on ARIA attributes to understand widget state
- Toggle button groups in the UI were missing
aria-pressed, so their active state was invisible to screen readers- This PR adds
aria-pressedto the date-preset and day-of-week toggle groups- Risks: None — ARIA attributes are purely additive and have no effect on visual rendering or logic
Please add both sections to the PR description so reviewers have the full context the guide asks for.
Context Used: CONTRIBUTING.md has a guide for a good PR message ... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/src/pages/Costs.tsx
Line: 557
Comment:
**PR description is missing a thinking path and risks section**
Per CONTRIBUTING.md, PR descriptions should include a **thinking path** — a top-down chain of reasoning from the project level down to the specific change — as well as explicit details on risks (even if there are none). For example:
> - Paperclip orchestrates AI agents for zero-human companies
> - Humans and assistive-technology users interact with the web UI
> - Screen-reader users rely on ARIA attributes to understand widget state
> - Toggle button groups in the UI were missing `aria-pressed`, so their active state was invisible to screen readers
> - This PR adds `aria-pressed` to the date-preset and day-of-week toggle groups
> - **Risks:** None — ARIA attributes are purely additive and have no effect on visual rendering or logic
Please add both sections to the PR description so reviewers have the full context the guide asks for.
**Context Used:** CONTRIBUTING.md has a guide for a good PR message ... ([source](https://app.greptile.com/review/custom-context?memory=instruction-0))
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Thinking Path
Problem
The app has button groups that work like toggles - you click one button to select it and the others become unselected. Visually this work fine because the active button change to a different variant (filled vs outlined). But for screen reader users, ALL buttons sound exactly the same - just "button, 7 days", "button, 30 days", etc with no way to tell which one is currently active.
I searched the entire UI codebase for
aria-pressedand found zero results. This attribute is what screen readers need to announce "7 days, pressed" vs "30 days, not pressed" for toggle button groups.What I changed
Added
aria-pressed={isActive}to two toggle button groups:Costs.tsx - Date range preset buttons (7d, 30d, 90d, Custom). Screen reader now announce which date range is selected.
ScheduleEditor.tsx - Day of week selector (Mon, Tue, Wed...). Screen reader now announce which day is selected for weekly schedule.
How to test
2 files, 2 lines added.