Skip to content

fix(vite-task): keep keyboard focus in task details - #656

Open
SaKaNa-Y wants to merge 5 commits into
vitejs:mainfrom
SaKaNa-Y:fix/vite-task-detail-focus
Open

SaKaNa-Y wants to merge 5 commits into
vitejs:mainfrom
SaKaNa-Y:fix/vite-task-detail-focus

Conversation

@SaKaNa-Y

@SaKaNa-Y SaKaNa-Y commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Open a task with Enter in Vite Task's List or Graph. The detail panel covers the other tasks, but the opening button keeps keyboard focus. Pressing Tab and Enter can then select a different task while you are reading the first task's plan.

Give the panel an accessible dialog name and focus its task heading on open. Tab and Shift+Tab cycle inside the dialog. The dependency menu opens inside it so keyboard users can select a related task. Closing the dialog returns focus to the task that opened it, or to Search if that button is unavailable.

Evidence

Action in Chromium Before After
Open app build from List, then use Tab Focus stayed on the opener. Tab reached app clean, and Enter opened its plan. The heading received focus. Tab stayed inside details. Escape returned to app build.
Open app build from Graph, then use Tab Tab reached config build, and Enter opened its plan. Tab and Shift+Tab wrapped between dialog controls. Activating Close returned to the graph node.

With a dependency focused in the open menu, one press of Escape closed the dialog and returned focus to the original task. Enter on the same dependency opened its details with focus inside the dialog. Closing those details also returned focus to the original task.

The deep-link test returned focus to Search. Clicking the backdrop returned focus to the clicked task. An earlier Chromium check on f8505f0e also removed the opening button before closing and observed focus on Search.

Merge Danger

Door: Two-way. A revert restores the previous keyboard behavior.

Blast Radius: Keyboard navigation in Vite Task details, including the dependency menu in List and Graph.

Change Risk: Medium. A focus error can interrupt dependency navigation or leave focus on the wrong control when the dialog closes. Users can close and reopen the dialog. Browser coverage used Chromium.

Focus the task heading when details open and keep keyboard navigation inside the dialog, including its dependency menu. Remember the original task across dependency navigation so closing the dialog restores focus to its button or to Search.

Cover List, Graph, menu dismissal, deep links and backdrop clicks in the browser.
@pkg-pr-new

pkg-pr-new Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@vitejs/devtools

npm i https://pkg.pr.new/@vitejs/devtools@656

@vitejs/devtools-kit

npm i https://pkg.pr.new/@vitejs/devtools-kit@656

@vitejs/devtools-oxc

npm i https://pkg.pr.new/@vitejs/devtools-oxc@656

@vitejs/devtools-rolldown

npm i https://pkg.pr.new/@vitejs/devtools-rolldown@656

@vitejs/devtools-vite

npm i https://pkg.pr.new/@vitejs/devtools-vite@656

@vitejs/devtools-vite-task

npm i https://pkg.pr.new/@vitejs/devtools-vite-task@656

@vitejs/devtools-vitest

npm i https://pkg.pr.new/@vitejs/devtools-vitest@656

commit: 360adca

Floating Vue can focus the popup after Escape has already closed it. Tie its deferred autofocus to the current open state so keyboard users can reopen the menu from the same button.
Keep dependency navigation inside the detail dialog and let the focus trap recover focus when a selected control disappears. Remove the menu-specific Escape handler and the heading focus override when switching tasks.
@SaKaNa-Y
SaKaNa-Y marked this pull request as ready for review December 5, 2026 07:20
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