Skip to content

fix(html): make remaining mouse-only controls keyboard accessible - #42334

Closed
Ayaan Gazali (ayaangazali) wants to merge 1 commit into
microsoft:mainfrom
ayaangazali:fix-42323
Closed

fix(html): make remaining mouse-only controls keyboard accessible#42334
Ayaan Gazali (ayaangazali) wants to merge 1 commit into
microsoft:mainfrom
ayaangazali:fix-42323

Conversation

@ayaangazali

Copy link
Copy Markdown

Rationale

Four controls are still reachable only with a mouse, the same shape fixed for tabs in #41434, chips
in #42149, and expandable titles and the image diff switcher in #42310 and #42311.

locationbeforeconsequence
headerView.tsx:136<div role='button' title='Settings'>theme/settings dialog unreachable
testFilesView.tsx:84<div className='metadata-toggle' role='button'>metadata cannot be expanded
labels.tsx:31bare <span className='label' onClick>tag filter chips unreachable
actionList.tsx:115bare <div className='action-list-show-all' onClick>cannot clear the time-range filter

The first two are the worse pair: they declare role="button" and then cannot take focus, so
assistive tech is told there is a button that cannot be operated. The other two carry no role at
all, so they are not announced as controls in the first place.

All four become native buttons with a :focus-visible ring, no key handlers. The html reporter
files use --color-accent-fg, matching chip.css and tabbedPane.css; actionList.css uses
--vscode-focusBorder, matching the rest of the trace viewer. The gear also gains
aria-haspopup="dialog" and aria-expanded, and the Metadata toggle gains aria-expanded, which
neither had.

labels.tsx only becomes a button on the clickable branch. Label has an href branch that
already renders a real anchor, but LabelsClickView calls it without href, so the tag chips
always took the bare-span path.

One thing I deliberately did not change.actionList.tsx:167, the error/warning badge that
reveals the console, is also mouse-only. I made it a button, and it broke
ui-mode-trace.spec.ts:778: because the badge sits inside a treeitem, giving it an accessible
name appends that name to every action row, - treeitem "Evaluate 2ms Reveal console". That is a
regression in the accessibility tree rather than an improvement, so it needs a different approach
and is better done separately than bundled here.

Test

headerView.spec.ts gets one keyboard case for the gear: focus it, assert focus lands, press Enter,
assert aria-expanded flips. On current main it fails at toBeFocused with Received: inactive.

Green: html-reporter component tests 18, reporter-html.spec.ts 198, trace-viewer.spec.ts 113,
ui-mode-trace.spec.ts 27, flint clean.

Fixes#42323


for context, my last three PRs here were closed with the CLA check still pending, so if that is
what blocks this one too please just say so and I will get it sorted rather than have it linger.
also, reading how you structured titleSuffix in #42310 and the --vscode-focusBorder fallback in
#42311 is what made me check the token per package here instead of copying one blindly, so thanks
for that. freshman in college, learning a lot from these reviews :)

Four controls were unreachable with the keyboard, in the same way tabs,
chips, expandable titles and the image diff switcher were before microsoft#41434,
microsoft#42149, microsoft#42310 and microsoft#42311.
The settings gear and the Metadata toggle declared role="button" without
a tabIndex, so assistive tech announced a button that could not be
operated. The tag chips and the trace viewer "Show all" carried no role
at all, so they were not announced as controls in the first place. All
four now render native buttons with a focus ring.
The error and warning badge in the action list is deliberately left
alone: it sits inside a treeitem, so giving it an accessible name adds
that name to every action row, which is a regression in the tree rather
than an improvement.
CopilotAI lite review requested due to automatic review settings August 20, 2026 17:56

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for freeto 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.

[Bug]: remaining mouse-only controls in the html reporter and trace viewer

3 participants

@ayaangazali@yury-s