fix(keys): reject key chords with empty segments around + - #907
Open
nityanand123gupta wants to merge 1 commit into
Open
fix(keys): reject key chords with empty segments around +#907nityanand123gupta wants to merge 1 commit into
nityanand123gupta wants to merge 1 commit into
Conversation
|
@nityanand123gupta is attempting to deploy a commit to the Modem Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
PR author is not in the allowed authors list. |
Author
|
Hi! The PR is currently waiting for workflow approval and Vercel authorization. Could a maintainer please approve the pending workflows when convenient? Thanks! |
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.
Problem
parseKeyChordfiltered out empty segments after splitting a chord on+, so malformed bindings were silently reinterpreted as different, real shortcuts:Fix
+/+chord before segment validation (since splitting it produces two empty segments that must stay valid).+instead of filtering it out.ctrl + s) continue to parse as before.Testing
Ran locally (not just written blind):
bun test src/extension-api/keys.test.ts src/ui/lib/keymap.test.ts— 36/36 passing, including new coverage for all four malformed cases, the literal-plus compatibility cases, and the keymap-level "malformed chord doesn't claim the real shortcut" case.bun run typecheck— clean.bun run lint— 0 warnings/errors.bun run format:checkon the changed files — clean (the repo-wideformat:checkcurrently reports ~1000 pre-existing unrelated files; scoped to my 4 changed files only).Added a patch Changeset per the contribution convention.
Fixes #906