Skip to content

fix: give icon tooltip triggers a button role and name - #30819

Draft
aqandrew wants to merge 1 commit into
mainfrom
fix/icon-tooltip-trigger-names
Draft

aqandrew wants to merge 1 commit into
mainfrom
fix/icon-tooltip-trigger-names

Conversation

@aqandrew

Copy link
Copy Markdown
Contributor

🤖 This PR was created by Coder Agents on behalf of @aqandrew.

Fixes the button-role-name-missing (WCAG 4.1.2) findings in DEQ-541 items 1 to 3. These tooltip triggers were attached straight to a bare svg or img, so they had no role or accessible name.

Part of DEQ-541 (items 1 to 3). Item 4 (build timeline bars) is handled separately with DEQ-232.

Location Element Fix
Build timeline Stage info icons (init, plan, ...) <button aria-label="About <stage>">
All logs Log source icons <button aria-label="<source name>"> on the first line of each run from the same source
History sidebar Build reason info icon Reason added to the build link's accessible name (sr-only)

Adds Vitest coverage in AgentLogs.test.tsx, WorkspaceTimings.test.tsx and WorkspaceBuildData.test.tsx. All three fail without the fix. Adds SourceIconFocused and StageInfoFocused stories so Pixel captures the focus ring and the tooltip opened from the keyboard.

Implementation notes and review decisions

Scope. The original plan grouped every button-role-name-missing ticket for icon tooltip triggers. Most of them were already handled elsewhere, so this PR covers only what was left:

Mapping axe selectors to components

  • Item 1, section:nth-of-type(9) info icon in History: WorkspaceBuildData (rendered by HistorySidebar and WorkspaceBuildPageView).
  • Item 2, img alt="" and the dashed-line div with data-state: the source icon in AgentLogs.
  • Item 3, lucide-info next to provisioning and agent stage labels: StagesChart.

Decisions

  • History build reason: no button. In both sidebars the whole build row is a link, so a <button> inside it would be nested interactive content (axe nested-interactive), and clicking it would also follow the link. Instead the icon is aria-hidden and the reason is sr-only text in the link's accessible name ("start by admin, build reason: CLI"). Tradeoff: sighted keyboard users still can't open the visual tooltip, as before. Showing the reason as visible text, or opening the tooltip when the link has focus, would need a design decision.
  • Log source continuation lines (the dashed connector) are now aria-hidden and have no tooltip. Before, every line had a hover trigger. Making each line a button would add a tab stop per log line. Mouse users now hover the first icon of a run to see the source name.
  • No shared icon-trigger component yet. The two new buttons repeat the focus-ring classes from fix(site/src): make text-only tooltip triggers keyboard focusable #30403. fix(site/src): make tooltips with links keyboard and screen reader accessible #30424 is rewriting Tooltip/InfoTooltip, so a shared primitive (or a side prop on InfoTooltip) is better done after it merges. InfoTooltip doesn't fit StagesChart as is: it uses a fixed side="right" and 12/16px icons, while this icon is 14px with the tooltip below.
  • Removed m-0 border-0 bg-transparent p-0 cursor-pointer from the new buttons, because Tailwind preflight and index.css already apply them.
  • Known nit: the log source button's name and tooltip description are the same text, so screen readers may read the source name twice.

Verification

  • pnpm lint:types, biome check, and make pre-commit (via the hook) pass.
  • Unit tests: AgentLogs, WorkspaceBuildData, WorkspaceTimings. Each new test was confirmed to fail against the original components.
  • Storybook tests: AgentLogs, WorkspaceTimings, WorkspaceBuildData, AgentRow, Workspace, WorkspaceBuildPageView (82 tests) pass.
  • The frontend-deep-review and frontend-review audits were run, and their blocking and should-fix findings were fixed or recorded above.
  • Not checked: the workspace page in a real browser with a screen reader.

Fixes the remaining axe button-role-name-missing findings in DEQ-541
(items 1 to 3). Tooltip triggers attached directly to a bare svg or img
had no role or name.

- Build timeline stage info icons are now buttons named "About <stage>".
- All logs source icons are now buttons named after the log source. Only
  the first line of each run from the same source is a trigger;
  continuation lines are decorative, so long logs don't add a tab stop
  per line.
- History build reason icons sit inside the build link, so the reason is
  added to the link's accessible name instead of a nested control.
@linear-code

linear-code Bot commented Oct 14, 2026

Copy link
Copy Markdown

DEQ-541

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant