Skip to content

fix(site/src/pages/AuditPage): toggle audit log diffs with a real disclosure button - #31858

Merged
bartekgatzcoder merged 1 commit into
mainfrom
a11y/nested-interactive-3
Nov 10, 2026
Merged

bartekgatzcoder merged 1 commit into
mainfrom
a11y/nested-interactive-3

Conversation

@jeremyruppel

Copy link
Copy Markdown
Collaborator

The audit log row header was a <div role="button" tabIndex={0} aria-expanded> that contained the description links and the request details tooltip trigger, so axe reports nested-interactive on every expandable row.

The chevron is now a real disclosure button (CollapsibleTrigger around a <button aria-label="View changes">), which gets aria-expanded and aria-controls from Radix and handles Enter and Space natively. The header div keeps its click handler as a mouse-only shortcut, with no role, tab stop, or key handler. The button stops propagation so a click toggles once.

Closes DEQ-28
Closes DEQ-106
Closes DEQ-211
Closes DEQ-250
Closes DEQ-317
Closes DEQ-392
Closes DEQ-438

Ticket Surface
DEQ-28, DEQ-106, DEQ-211, DEQ-250, DEQ-317, DEQ-392, DEQ-438 Audit log (/audit) expandable rows
Decision log
  • Kept the row-wide click for mouse users, matching current behavior, with an oxlint-disable-next-line jsx-a11y/click-events-have-key-events comment, as ModuleCard does (fix(site/src/pages/TemplateBuilder): use shared Checkbox in ModuleCard #30540). Keyboard users use the disclosure button. Dropping the row click would avoid the comment but shrink the mouse target to the 24px chevron.
  • The button's name is a static "View changes"; the expanded state comes from aria-expanded.
  • Replaced the two fireEvent.keyDown tests in AuditPage.test.tsx, which exercised the removed row key handler, with one userEvent test that toggles the button with Enter, Space, and a click and checks it toggles once each time.
  • Verified with axe-core in Storybook (pages/AuditPage/AuditLogRow WithDiff, WithOrganization, NoDiff): nested-interactive goes from 1 node to 0 in the diff stories. A target-size hit on the request details tooltip trigger in WithOrganization also clears, since it no longer sits inside the oversized row button.
  • Related nested-interactive fixes: fix(site/src): move the Autocomplete clear button out of the trigger #31856 (Autocomplete), fix(site/src/pages/TemplatesPage): link template names instead of making rows buttons #31857 (templates list).

🤖 Generated by Coder Agents on behalf of @jeremyruppel.

…closure button

The audit log row header was a div with role="button" that contained
links and the request details tooltip trigger, which axe reports as
nested-interactive. The chevron is now a CollapsibleTrigger button, and
clicking elsewhere on the row stays as a mouse-only shortcut.
@linear-code

linear-code Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

@bartekgatzcoder bartekgatzcoder left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean fix: the row header is no longer a focusable role=button wrapping links, and the chevron is a real Radix CollapsibleTrigger button with working aria-expanded/aria-controls. Verified in Storybook (axe: no nested-interactive on WithDiff, WithOrganization, LongDiffRow; Tab reaches "View changes" with a visible ring; Enter, Space, and row click each toggle once), and AuditPage.test.tsx passes. Nits: AuditLogRow.tsx:228 p-0 border-0 bg-transparent text-inherit cursor-pointer duplicate preflight/base styles; onClick={toggle} at :74 is now attached to no-diff rows too (harmless, toggle returns early); the row-click shortcut has no test.

🤖 Generated by Coder Agents on behalf of @bartekgatzcoder.

@bartekgatzcoder
bartekgatzcoder merged commit 8f4731f into main Nov 10, 2026
72 of 75 checks passed
@bartekgatzcoder
bartekgatzcoder deleted the a11y/nested-interactive-3 branch November 10, 2026 16:03
@bartekgatzcoder
bartekgatzcoder temporarily deployed to main November 10, 2026 16:03 — with GitHub Actions Inactive
bartekgatzcoder pushed a commit that referenced this pull request Nov 10, 2026
…template cards (#31865)

The base template card in the template builder was a `<div role="radio"
tabIndex={0}>` with its own Enter and Space handling, and it contained
the "View details" link, so axe reports `nested-interactive` on every
card.

The card now uses the shared `RadioGroupItem` in place of the hand-drawn
indicator, labelled by the template name, and `BaseInfraSelectStep`
wraps the grid in the shared `RadioGroup` controlled by
`selectedBaseId`. The group gets one Tab stop with arrow-key navigation.
The card keeps its click handler as a mouse-only shortcut with no role,
tab stop, or key handler, matching `ModuleCard` (#30540).

Closes DEQ-50
Closes DEQ-60
Closes DEQ-61
Closes DEQ-166
Closes DEQ-197
Closes DEQ-205
Closes DEQ-242
Closes DEQ-445
Closes DEQ-452

| Ticket | Surface |
|---|---|
| DEQ-50, DEQ-60, DEQ-61, DEQ-166, DEQ-197, DEQ-205, DEQ-242, DEQ-445,
DEQ-452 | Template builder, step 1 (pick a base template) |

<details>
<summary>Decision log</summary>

- The radio has no change handler. Clicks, Space, and Radix's arrow-key
selection all reach the card as clicks, so the card's `onClick` is the
only caller of `onSelect` and a selection is never counted twice.
Covered by `TemplateCard.test.tsx`.
- Kept the card-wide click for mouse users with an
`oxlint-disable-next-line jsx-a11y/click-events-have-key-events`
comment, as `ModuleCard` does.
- The selected radio now uses the shared style (gray border, 10px dot)
instead of the custom one (white border, 8px dot). Size and position are
unchanged. Focus moves from a ring around the whole card to a ring
around the radio, offset against the card surface.
- Clicking "View details" still selects the card on the way out, as
before and as in `ModuleCard`.
- `TemplateCard` stories render inside a `RadioGroup` decorator, which
the radio needs.
- Verified with axe-core in Storybook: `TemplateCard` Default and
Selected go from `nested-interactive` and `target-size` (1 node each) to
0. `TemplateBuilderPageView` Default goes from 2 nodes each to 0. A
pre-existing `link-in-text-block` hit in the page subtitle remains.
- Related `nested-interactive` fixes: #31856 (`Autocomplete`), #31857
(templates list), #31858 (audit log).

</details>

🤖 Generated by Coder Agents on behalf of @jeremyruppel.
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 10, 2026

This branch was previously deployed

1 inactive deployment
main — e0cc2837 Deployed Nov 10, 2026 by bartekgatzcoder via cla #253503
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants