fix(defineShortcuts): defer standalone shortcuts that prefix a chain#266
Merged
Conversation
…(76ee176) A standalone shortcut that is also the first key of a chained shortcut (f and f-h) is now held back until the chain completes, the chain delay elapses, or a non-completing key arrives - so pressing f no longer fires the standalone and swallows the chain. The held shortcut is re-resolved before firing so a state change (e.g. focus into an input) is honored. Adds cached chained/standard/prefix computeds and the upstream tests. The one call-order assertion is rewritten via mock.invocationCallOrder, since b24ui's test setup does not register jest-extended matchers. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JS8ypVfQSFzYVZzkTHhURb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Syncs upstream nuxt/ui commit
76ee176— fix(defineShortcuts): defer standalone shortcuts that prefix a chain (#5654).What
When a standalone shortcut (
f) is also the first key of a chained shortcut (f-h), pressingfused to fire the standalone immediately and swallow the chain. The fix holds the standalone back (pendingShortcut+pendingTimerviauseTimeoutFn) until one of:The held shortcut is re-resolved just before firing, so a state change in the meantime (e.g. focus moved into an input, disabling it) is honored. Also adds cached
chainedShortcuts/standardShortcuts/chainPrefixescomputeds so each keydown doesn't re-filter the shortcut list.b24ui's composable matched upstream exactly, so the runtime hunks applied verbatim.
Deviation — test matcher
b24ui's vitest setup registers only
vitest-axe/matchers(nojest-extended), sotoHaveBeenCalledBeforeisn't available. The single call-order assertion was rewritten asexpect(f.mock.invocationCallOrder[0]).toBeLessThan(x.mock.invocationCallOrder[0]). Everything else (the 5 new regression tests + thedocument.body.innerHTML = ''teardown) is verbatim.Verify (
CI=true)dev:prepare·lint·typecheck·test·build— all green. Suite 5477 passed / 6 skipped (+10 across the two projects). No snapshot changes.Ledger: cursor advanced to
76ee176; previous entry71c623breconciled to PR #265.🤖 Generated with Claude Code
Generated by Claude Code