Skip to content

fix(hub-ui): preserve keystrokes while recording shortcuts - #406

Queued
SaKaNa-Y wants to merge 1 commit into
devframes:mainfrom
SaKaNa-Y:fix/shortcut-recording-capture
Queued

SaKaNa-Y wants to merge 1 commit into
devframes:mainfrom
SaKaNa-Y:fix/shortcut-recording-capture

Conversation

@SaKaNa-Y

Copy link
Copy Markdown
Contributor

Important

Please take a moment to read this. Thank you!

I should include a brief explanation of the problem in my own words in every PR. If that explanation is missing, please @mention me and do not merge this PR until I have added it. You may also leave this PR unaddressed (because this means I have not fulfilled my responsibilities as the author).

If my explanation is unclear or difficult to follow, please ask me to clarify or provide reproduction steps or supporting evidence.

I welcome suggestions and counterarguments, especially questions about anything I may have overlooked. (Your feedback helps me learn and improve. 🙏)

I hold myself to this standard for every PR, regardless of its size.

Summary

When editing a shortcut, pressing an already-bound combination executes its command before the recorder can receive it. For example, edit Toggle Command Palette, record Cmd+Shift+J without saving, then press its original Cmd+K: the palette opens and the recorder retains Cmd+Shift+J. This also happens when editing the command's own binding, so it does not depend on duplicate assignments.

The window capture listener stops propagation before the input's keydown handler runs. Skip command execution when the event's composed path contains the shortcut recorder. This reaches inputs inside shadow roots and avoids realm-specific element checks for popup windows.

window keydown
  recorder in composed path → let the input record the key
  otherwise → resolve and execute the matching command

Shortcut conflict warnings and saving behavior are unchanged.

Evidence

  • Before: all three regression cases failed because the command ran during recording.
  • After: listener tests cover ordinary, shadow-retargeted, and popup event paths, plus normal execution outside the recorder. The focused shortcut suites passed all 13 tests.
  • Manual browser verification in the source playground: Cmd+K updates the recorder without opening the palette; after cancelling, Cmd+K opens the palette normally. Popup coverage is a listener fixture, not a manual popup browser test.
  • pnpm lint and pnpm knip passed.
  • pnpm test --run: 142 test files passed; 1572 tests passed, 9 skipped.
  • pnpm typecheck: 40 tasks passed.
  • pnpm build: 28 tasks passed, using cached outputs on the final run after the test command's build.

Merge Danger

Door: two-way; no persisted data or API changes.

Blast Radius: shortcut recording. The early return applies only to events whose composed path contains the recorder's existing class.

@vercel

vercel Bot commented Sep 24, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
devframe Skipped Skipped Sep 24, 2026 2:13pm UTC

@SaKaNa-Y
SaKaNa-Y marked this pull request as ready for review September 25, 2026 03:08
@coldtea-pr-lens

coldtea-pr-lens Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

◈ PR Lens

🟢 +0 new · 🟠 ~1 changed · 🔴 -0 removed · 0 flows · 2 files · commit e5a7de0


Architecture

Architecture diagram for devframes/devframe at e5a7de0

1 component touched across 4 lanes.

Open the interactive canvas


Data flow

No data-flow sequence changed in this PR.


View

  • Architecture lens
  • Data flow lens
  • Expand every detail

Tip

Click the link under each diagram to open it on a canvas you can zoom, pan and step through

🪧 More tips
  • Run npx skills add coldteadotai/pr-lens, then tell your coding agent: "Diagram the change you just made with PR Lens and attach it to the pull request."
  • Run npx @coldtea/pr-lens-cli analyze --base origin/main on a branch, then npx @coldtea/pr-lens-cli render .pr-lens/graph.json. Same lenses, your own model key, before the pull request exists
  • Untick Architecture lens or Data flow lens under View to hide a diagram, or tick Expand every detail to open every section. The comment redraws in a few seconds
  • The diagrams are links. Click one to open it on the canvas, then press W or click play to walk through the change
  • Open a diagram on the canvas, then press W or click play to walk through the change one step at a time
  • The CLI's render reads .github/pr-lens.yml and applies your renames, exclusions and lane pins at draw time
  • Set github.comment.collapsed: true in .github/pr-lens.yml to fold the comment behind one View architecture and data flow row. Drawing still runs on every push
  • Set github.draw: on-demand in .github/pr-lens.yml and PR Lens stops drawing every push. Comment @pr-lens draw on a pull request when you want that one drawn
  • Add .github/workflows/pr-lens.yml with coldteadotai/pr-lens/packages/action@v0 and your model provider's key as its api-key to run PR Lens from your own CI. Any /chat/completions endpoint works
  • Push a commit and the comment redraws for the new head. A slow older run never overwrites a newer one
  • Switch GitHub to dark mode and the diagrams follow. The moving dots are this pull request's data in motion

Thanks for using PR Lens! It's built by Coldtea, free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

@SaKaNa-Y

Copy link
Copy Markdown
Contributor Author

This change removes interference from existing shortcuts when adding a new shortcut.

@antfu
antfu added this pull request to the merge queue Sep 25, 2026
@antfu
antfu removed this pull request from the merge queue due to a manual request Sep 25, 2026
@antfu
antfu added this pull request to the merge queue Sep 25, 2026
@antfu
antfu removed this pull request from the merge queue due to the queue being cleared Sep 25, 2026
@antfu
antfu added this pull request to the merge queue Sep 25, 2026

This branch was previously deployed

1 inactive deployment
Preview — e5a7de02 Deployed Sep 24, 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.

2 participants