Uh oh!
There was an error while loading. Please reload this page.
Alt-click focus behavior - #3872
Conversation
Chrome's Alt menu-bar handling blurred the page and cleared the overlay flag, which also killed span hover until the window was refocused.
Drop the event union, reducer, and timeline mouse-move graft. The hook listens for keys, blur, and window pointermove itself and returns only altHeld.
Cursor Agent can help with this pull request. Just |
🦋 Changeset detectedLatest commit: a73a5ed The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Sim WorldSimulated world deterministic testing for races. Traces 🟠 world-sim scenario book — 1 fail of 41 total
Full trace: |
pointermove was copying e.altKey, so Chrome's post-preventDefault pointermove with altKey false cleared the flag on Alt press.
No backport to This fixes the trace viewer's Alt+hover delta overlay, but that functionality does not exist on To override, re-run the Backport to stable workflow manually via |
Description
After you click a span in the trace, holding Alt no longer showed the selected-to-hovered delta. Other spans also lost hover until you switched out of Chrome and back.
Chrome treats Alt as a menu-bar shortcut. That blurs the page, which cleared
altHeldand stopped hover from updating.useAltHeldnow callspreventDefaulton Alt (except in inputs, textareas, and contenteditable) so the menu bar does not take over. Listeners run in capture.pointermove.altKeyrecovers if keydown was missed. Blur still clears the flag so the overlay cannot stick after Alt+Tab.The new hook is
packages/web-shared/src/components/trace-viewer/components/use-alt-held.ts. The only other change is wiring it intrace-viewer.tsx.How did you test your changes?
No unit tests. The failure is Chrome stealing Alt after a click, which jsdom cannot reproduce. Manual check: select a span, keep the cursor in the timeline, hold Alt, hover another span. The delta overlay should appear without leaving the tab. Typing in the search box with Option on macOS should still compose characters.
PR Checklist - Required to merge
pnpm changesetwas run to create a changelog for this PRpatchfor bug fixes,minorfor new features,majorfor breaking changes.pnpm changeset --emptyif you are changing documentation or workbench appsgit commit --signoffon your commits)@vercel/workflowin a comment once the PR is ready, and the above checklist is complete