The best way to control Claude Code, Codex and more from any computer or phone
fix(contracts): Space shortcuts reach clients instead of reverting to defaults (#34799)
Julius Marminge committed
Nov 11, 2026 at 23:06 UTC
31a108c195f6f720c1d3232e3fb0ae9ef1e66554
2 files changed
+22
-1
packages/contracts/src/keybindings.test.ts
+15
@@ -37,6 +37,21 @@ it.effect("drops resolved rules with commands this build does not know", () =>
37
}),
38
);
39
40
+it.effect("round-trips resolved Space shortcuts", () =>
41
+ Effect.gen(function* () {
42
+ const codec = Schema.fromJsonString(ResolvedKeybindingsConfig);
43
+ const rules = [
44
+ {
45
+ command: "composer.dictation" as const,
46
+ shortcut: { ...shortcut, key: " ", metaKey: true, modKey: false },
47
+ },
48
+ ];
49
+ const encoded = yield* Schema.encodeEffect(codec)(rules);
50
+ const parsed = yield* decode(codec, encoded);
51
+ assert.deepEqual(parsed, rules);
52
+ }),
53
+);
54
+
55
it.effect("drops malformed resolved rule entries", () =>
56
Effect.gen(function* () {
57
const parsed = yield* decode(ResolvedKeybindingsConfig, [
packages/contracts/src/keybindings.ts
+7
-1
@@ -154,8 +154,14 @@ export const KeybindingsConfig = Schema.Array(KeybindingRule).check(
154
);
155
export type KeybindingsConfig = typeof KeybindingsConfig.Type;
156
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
+
163
export const KeybindingShortcut = Schema.Struct({
158
- key: KeybindingValue,
164
+ key: KeybindingShortcutKey,
165
metaKey: Schema.Boolean,
166
ctrlKey: Schema.Boolean,
167
shiftKey: Schema.Boolean,