Skip to content

Commit ca10122

Browse files
fix(contracts): Space shortcuts reach clients instead of reverting to defaults
The space token resolves to the key " ", but KeybindingShortcut.key reused the trimmed KeybindingValue, so it crossed the wire as "" and clients dropped the rule. Shortcut keys now keep their whitespace. Fixes #32007 AI-assisted; verified with the tests and tools listed above.
1 parent 928d05d commit ca10122

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎packages/contracts/src/keybindings.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,14 @@ export const KeybindingsConfig = Schema.Array(KeybindingRule).check(
154154
);
155155
export type KeybindingsConfig = typeof KeybindingsConfig.Type;
156156

157+
// Untrimmed: the `space` token resolves to the key " ".
158+
const KeybindingShortcutKey = Schema.String.check(
159+
Schema.isMinLength(1),
160+
Schema.isMaxLength(MAX_KEYBINDING_VALUE_LENGTH),
161+
);
162+
157163
export const KeybindingShortcut = Schema.Struct({
158-
key: KeybindingValue,
164+
key: KeybindingShortcutKey,
159165
metaKey: Schema.Boolean,
160166
ctrlKey: Schema.Boolean,
161167
shiftKey: Schema.Boolean,

0 commit comments

Comments
 (0)