fix: avoid false hotkey conflicts after platform normalization - #347
Open
CialloKing wants to merge 2 commits into
Open
CialloKing wants to merge 2 commits into
CialloKing wants to merge 2 commits into
Conversation
This branch has not been deployed
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.
Summary
Fix false hotkey conflicts when multiple bindings of one command resolve to the same physical shortcut on the current platform.
Motivation
A command with both
Mod+KandCtrl+Kcurrently conflicts with itself on Windows/Linux. On macOS, the same happens withMod+KandMeta+K. The command is then never dispatched, and conflict diagnostics can repeat the same command ID.Semantic normalization correctly preserves
Modfor portable settings. However, candidate collection also needs to deduplicate bindings after platform resolution, separately for each command.openspec/specs/plugin-commands-events/spec.md.Changes
packages/plugin-runtime: track resolved shortcuts per command incandidatesByHotkey(). Both conflict queries and keyboard dispatch use the corrected candidate set.Testing
Local environment: Windows, Node 24.16.0, pnpm 9.15.4.
pnpm exec vitest run packages/plugin-runtime/test/hotkey-scope.test.ts: 11/11 pass after the fix.pnpm typecheckpnpm check:apipnpm buildpnpm build:electron-demoaction_required; no verification jobs have started.apps/electron-demo/test/plugin-host-broker.test.tsoccur before and after the fix: 9 require Windows symlink privileges; 1 assumesO_NONBLOCKexists. Before the fix, the 5 hotkey regressions also fail (887/902 pass).spawnSync("pnpm", ...)bundling step returns a null status on this Windows environment. Electron's binary download also timed out; no native Electron acceptance is claimed.Contribution Notes
license/clapassed; CLA Assistant confirms all committers have signed.GOVERNANCE.mdsection 6.2.