@devries-cameron20 / t3code Mirror · read-only / commits / 53c367420c
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 25, 18:30 UTC

Align web keybinding types with shared contract aliases

- Reuse `KeybindingRule` and `KeybindingsConfig` directly for resolved keybinding types - Update normalization helper to accept `KeybindingRule` for consistent typing

Julius Marminge committed Feb 15, 2026 at 11:21 UTC 53c367420cac82f7c5baba55bad29432f77a9633
1 file changed +4 -9
apps/web/src/keybindings.ts
+4 -9
@@ -1,4 +1,4 @@
1 -import type { KeybindingCommand, KeybindingsConfig } from "@t3tools/contracts";
1 +import type { KeybindingCommand, KeybindingRule, KeybindingsConfig } from "@t3tools/contracts";
2
3 export interface ShortcutEventLike {
4 key: string;
@@ -14,13 +14,8 @@ export interface ShortcutMatchContext {
14 [key: string]: boolean;
15 }
16
17 -export interface ResolvedTerminalKeybinding {
18 - key: string;
19 - command: KeybindingCommand;
20 - when?: string | undefined;
21 -}
22 -
23 -export type ResolvedTerminalKeybindings = ResolvedTerminalKeybinding[];
17 +export type ResolvedTerminalKeybinding = KeybindingRule;
18 +export type ResolvedTerminalKeybindings = KeybindingsConfig;
19
20 export const DEFAULT_TERMINAL_KEYBINDINGS: ResolvedTerminalKeybindings = [
21 { key: "mod+j", command: "terminal.toggle" },
@@ -312,7 +307,7 @@ function resolveContext(options: ShortcutMatchOptions | undefined): ShortcutMatc
307 }
308
309 function normalizeConfiguredKeybinding(
315 - keybinding: KeybindingsConfig[number],
310 + keybinding: KeybindingRule,
311 ): ResolvedTerminalKeybinding | null {
312 const key = keybinding.key.trim();
313 if (key.length === 0) return null;