From 68f3184d3feba2d6e2fe17d2300993dab284216d Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Sun, 15 Feb 2026 11:21:38 -0800 Subject: [PATCH] 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 --- apps/web/src/keybindings.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/apps/web/src/keybindings.ts b/apps/web/src/keybindings.ts index c876f8bc81..1a6d7b4886 100644 --- a/apps/web/src/keybindings.ts +++ b/apps/web/src/keybindings.ts @@ -1,4 +1,4 @@ -import type { KeybindingCommand, KeybindingsConfig } from "@t3tools/contracts"; +import type { KeybindingCommand, KeybindingRule, KeybindingsConfig } from "@t3tools/contracts"; export interface ShortcutEventLike { key: string; @@ -14,13 +14,8 @@ export interface ShortcutMatchContext { [key: string]: boolean; } -export interface ResolvedTerminalKeybinding { - key: string; - command: KeybindingCommand; - when?: string | undefined; -} - -export type ResolvedTerminalKeybindings = ResolvedTerminalKeybinding[]; +export type ResolvedTerminalKeybinding = KeybindingRule; +export type ResolvedTerminalKeybindings = KeybindingsConfig; export const DEFAULT_TERMINAL_KEYBINDINGS: ResolvedTerminalKeybindings = [ { key: "mod+j", command: "terminal.toggle" }, @@ -312,7 +307,7 @@ function resolveContext(options: ShortcutMatchOptions | undefined): ShortcutMatc } function normalizeConfiguredKeybinding( - keybinding: KeybindingsConfig[number], + keybinding: KeybindingRule, ): ResolvedTerminalKeybinding | null { const key = keybinding.key.trim(); if (key.length === 0) return null;