Skip to content

Alt-click focus behavior - #3872

Merged
mitul-s merged 7 commits into
mainfrom
c+ms/fix-alt-hover-c934
Aug 28, 2026
Merged

mitul-s merged 7 commits into
mainfrom
c+ms/fix-alt-hover-c934

Conversation

@mitul-s

@mitul-s mitul-s commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

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 altHeld and stopped hover from updating. useAltHeld now calls preventDefault on Alt (except in inputs, textareas, and contenteditable) so the menu bar does not take over. Listeners run in capture. pointermove.altKey recovers 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 in trace-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 changeset was run to create a changelog for this PR
    • Use the correct semver bump type: patch for bug fixes, minor for new features, major for breaking changes.
    • Use pnpm changeset --empty if you are changing documentation or workbench apps
  • 🔒 DCO sign-off passes (run git commit --signoff on your commits)
  • 📝 Ping @vercel/workflow in a comment once the PR is ready, and the above checklist is complete
Open in Web Open in Cursor 

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

cursor Bot commented Aug 27, 2026

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel

vercel Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview, v0 Aug 28, 2026 6:32pm
example-nextjs-workflow-webpack Ready Ready Preview, v0 Aug 28, 2026 6:32pm
example-workflow Ready Ready Preview, v0 Aug 28, 2026 6:32pm
workbench-astro-workflow Ready Ready Preview, v0 Aug 28, 2026 6:32pm
workbench-express-workflow Ready Ready Preview, v0 Aug 28, 2026 6:32pm
workbench-fastify-workflow Ready Ready Preview, v0 Aug 28, 2026 6:32pm
workbench-hono-workflow Ready Ready Preview, v0 Aug 28, 2026 6:32pm
workbench-nestjs-workflow Ready Ready Preview, v0 Aug 28, 2026 6:32pm
workbench-nitro-workflow Ready Ready Preview, v0 Aug 28, 2026 6:32pm
workbench-nuxt-workflow Ready Ready Preview, v0 Aug 28, 2026 6:32pm
workbench-python-workflow Ready Ready Preview, v0 Aug 28, 2026 6:32pm
workbench-sveltekit-workflow Ready Ready Preview, v0 Aug 28, 2026 6:32pm
workbench-tanstack-start-workflow Ready Ready Preview, v0 Aug 28, 2026 6:32pm
workbench-vite-workflow Ready Ready Preview, v0 Aug 28, 2026 6:32pm
workflow-docs Ready Ready Preview, v0 Aug 28, 2026 6:32pm
workflow-swc-playground Ready Ready Preview, v0 Aug 28, 2026 6:32pm
workflow-tarballs Ready Ready Preview, v0 Aug 28, 2026 6:32pm
workflow-web Ready Ready Preview, v0 Aug 28, 2026 6:32pm

@changeset-bot

changeset-bot Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a73a5ed

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@workflow/web-shared Patch
@workflow/web Patch
@workflow/cli Patch
@workflow/nitro Patch
workflow Patch
@workflow/world-testing Patch
@workflow/nuxt Patch
@workflow/core Patch
@workflow/builders Patch
@workflow/next Patch
@workflow/vitest Patch
@workflow/astro Patch
@workflow/nest Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite Patch

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

@mitul-s
mitul-s marked this pull request as ready for review August 27, 2026 22:44
@mitul-s
mitul-s requested a review from a team as a code owner August 27, 2026 22:44
@github-actions

github-actions Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Sim World

Simulated world deterministic testing for races. Traces

🟠 world-sim scenario book — 1 fail of 41 total

fence=per-spec

scenario outcome events virt replay violations
✅ smoke-no-steps completed 3 0ms ok 0
✅ smoke-one-step completed 6 0ms ok 0
✅ hook-at-step-started completed 12 0ms ok 0
✅ hook-at-step-completed completed 12 0ms ok 0
✅ hook-at-hook-created completed 12 0ms ok 0
✅ deadline-hook-wins completed 7 1.0h ok 0
✅ deadline-expires completed 7 1.0h ok 0
✅ long-sleep completed 11 30.0d ok 0
✅ hook-never-arrives stalled 3 0ms skipped 0
✅ step-retries-twice completed 10 2.0s ok 0
✅ parallel-steps completed 9 0ms ok 0
✅ hook-on-execution-state completed 12 0ms ok 0
✅ peek-hook-before-branch completed 12 0ms ok 0
✅ peek-hook-after-branch completed 12 0ms ok 0
✅ peek-hook-at-registration completed 12 0ms ok 0
✅ race-hook-before-probe completed 12 0ms ok 0
✅ race-hook-after-probe completed 12 0ms ok 0
✅ race-duplicate-delivery completed 13 0ms ok 0
✅ attr-hook-before-step completed 11 0ms ok 0
✅ attr-hook-after-step completed 11 0ms ok 0
✅ attr-from-step-body completed 13 0ms ok 0
✅ fork-hook-after-timeout completed 14 1.0m ok 0
✅ fork-hook-before-timeout completed 14 1.0m ok 0
✅ count-hook-after-timeout completed 17 1.0m ok 0
✅ count-hook-before-timeout completed 20 1.0m ok 0
✅ stale-read-step-count-fork completed 20 1.0m ok 0
✅ stale-read-equal-step-counts completed 14 1.0m ok 0
✅ step-vs-step-fork completed 12 0ms ok 0
✅ step-vs-step-fork-fenced completed 12 0ms ok 0
✅ fence-catches-benign-direction completed 12 5ms ok 0
✅ in-flight-before-decision completed 17 1.0m ok 0
❌ in-flight-before-decision-counted completed 17 1.0m ok 0
✅ in-flight-after-decision completed 19 2.0m ok 0
✅ stale-read-step-count-fork-fenced completed 20 1.0m ok 0
✅ fork-hook-wins completed 13 1.0m ok 0
✅ fork-timeout-wins completed 13 1.0m ok 0
✅ unclaimed-payload-under-fork completed 17 1.0m ok 0
✅ claimed-payload-under-fork completed 17 1.0m ok 0
✅ writers-independent-step-bodies completed 12 0ms ok 0
✅ writers-scripted-tempo completed 12 0ms ok 0
✅ cancel-mid-step cancelled 7 0ms skipped 0

Full trace: world-sim.txt

pointermove was copying e.altKey, so Chrome's post-preventDefault
pointermove with altKey false cleared the flag on Alt press.

@karthikscale3 karthikscale3 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.

nice

@github-actions

Copy link
Copy Markdown
Contributor

No backport to stable for 4d5852b (AI decision).

This fixes the trace viewer's Alt+hover delta overlay, but that functionality does not exist on stable: git grep altHeld|altKey origin/stable -- packages/web-shared returns nothing and origin/stable:packages/web-shared/src/components/trace-viewer/trace-viewer.tsx has no Alt handling at all. The commit therefore fixes a main-only feature and has nothing to repair on the maintenance line.

To override, re-run the Backport to stable workflow manually via workflow_dispatch and paste this commit SHA into the ref input:

4d5852b901951b8cac3948e5478e8922dc60a8ce

This branch was successfully deployed

18 active deployments
Preview – workflow-swc-playground — a73a5ed3 Deployed Aug 28, 2026 by vercel[bot]
Preview – example-nextjs-workflow-webpack — a73a5ed3 Deployed Aug 28, 2026 by vercel[bot]
Preview – example-nextjs-workflow-turbopack — a73a5ed3 Deployed Aug 28, 2026 by vercel[bot]
Preview – workflow-docs — a73a5ed3 Deployed Aug 28, 2026 by vercel[bot]
Preview – workbench-sveltekit-workflow — a73a5ed3 Deployed Aug 28, 2026 by vercel[bot]
Preview – workbench-nestjs-workflow — a73a5ed3 Deployed Aug 28, 2026 by vercel[bot]
Preview – workbench-nuxt-workflow — a73a5ed3 Deployed Aug 28, 2026 by vercel[bot]
Preview – workbench-astro-workflow — a73a5ed3 Deployed Aug 28, 2026 by vercel[bot]
Preview – workbench-fastify-workflow — a73a5ed3 Deployed Aug 28, 2026 by vercel[bot]
Preview – workbench-express-workflow — a73a5ed3 Deployed Aug 28, 2026 by vercel[bot]
Preview – example-workflow — a73a5ed3 Deployed Aug 28, 2026 by vercel[bot]
Preview – workbench-tanstack-start-workflow — a73a5ed3 Deployed Aug 28, 2026 by vercel[bot]
Preview – workbench-vite-workflow — a73a5ed3 Deployed Aug 28, 2026 by vercel[bot]
Preview – workbench-hono-workflow — a73a5ed3 Deployed Aug 28, 2026 by vercel[bot]
Preview – workbench-nitro-workflow — a73a5ed3 Deployed Aug 28, 2026 by vercel[bot]
Preview – workflow-tarballs — a73a5ed3 Deployed Aug 28, 2026 by vercel[bot]
Preview – workflow-web — a73a5ed3 Deployed Aug 28, 2026 by vercel[bot]
Preview – workbench-python-workflow — a73a5ed3 Deployed Aug 28, 2026 by vercel[bot]
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.

3 participants