| author | |
| committer | |
| log | ab0933a41ae3a69632ea68809700a040bde26c22 |
| tree | f10f5b554e8ed3b67616140732139a16830cd5b8 |
| parent | b92a8122876458a67cc225f75c1d31bd3e33dc30 |
| signature | Signed by PGP key B5690EEEBB952194 |
2 files changed, 0 insertions(+), 42 deletions(-)
apps/web/src/keybindings.test.ts-16| ... | @@ -19,7 +19,6 @@ import { | ... | @@ -19,7 +19,6 @@ import { |
| 19 | isTerminalSplitVerticalShortcut, | 19 | isTerminalSplitVerticalShortcut, |
| 20 | isTerminalToggleShortcut, | 20 | isTerminalToggleShortcut, |
| 21 | resolveShortcutCommand, | 21 | resolveShortcutCommand, |
| 22 | shouldShowModelPickerJumpHints, | ||
| 23 | shouldShowThreadJumpHintsForModifiers, | 22 | shouldShowThreadJumpHintsForModifiers, |
| 24 | shortcutLabelForCommand, | 23 | shortcutLabelForCommand, |
| 25 | terminalDeleteShortcutData, | 24 | terminalDeleteShortcutData, |
| ... | @@ -541,21 +540,6 @@ describe("model picker navigation helpers", () => { | ... | @@ -541,21 +540,6 @@ describe("model picker navigation helpers", () => { |
| 541 | assert.strictEqual(modelPickerJumpIndexFromCommand("modelPicker.jump.3"), 2); | 540 | assert.strictEqual(modelPickerJumpIndexFromCommand("modelPicker.jump.3"), 2); |
| 542 | assert.isNull(modelPickerJumpIndexFromCommand("thread.jump.1")); | 541 | assert.isNull(modelPickerJumpIndexFromCommand("thread.jump.1")); |
| 543 | }); | 542 | }); |
| 544 | |||
| 545 | it("shows jump hints only while the model picker context is active", () => { | ||
| 546 | assert.isFalse( | ||
| 547 | shouldShowModelPickerJumpHints(event({ metaKey: true }), DEFAULT_BINDINGS, { | ||
| 548 | platform: "MacIntel", | ||
| 549 | context: { modelPickerOpen: false }, | ||
| 550 | }), | ||
| 551 | ); | ||
| 552 | assert.isTrue( | ||
| 553 | shouldShowModelPickerJumpHints(event({ metaKey: true }), DEFAULT_BINDINGS, { | ||
| 554 | platform: "MacIntel", | ||
| 555 | context: { modelPickerOpen: true }, | ||
| 556 | }), | ||
| 557 | ); | ||
| 558 | }); | ||
| 559 | }); | 543 | }); |
| 560 | 544 | ||
| 561 | describe("chat/editor shortcuts", () => { | 545 | describe("chat/editor shortcuts", () => { |
apps/web/src/keybindings.ts-26| ... | @@ -329,32 +329,6 @@ export function modelPickerJumpIndexFromCommand(command: string): number | null | ... | @@ -329,32 +329,6 @@ export function modelPickerJumpIndexFromCommand(command: string): number | null |
| 329 | return index === -1 ? null : index; | 329 | return index === -1 ? null : index; |
| 330 | } | 330 | } |
| 331 | 331 | ||
| 332 | export function shouldShowModelPickerJumpHints( | ||
| 333 | event: ShortcutEventLike, | ||
| 334 | keybindings: ResolvedKeybindingsConfig, | ||
| 335 | options?: ShortcutMatchOptions, | ||
| 336 | ): boolean { | ||
| 337 | return shouldShowModelPickerJumpHintsForModifiers(event, keybindings, options); | ||
| 338 | } | ||
| 339 | |||
| 340 | export function shouldShowModelPickerJumpHintsForModifiers( | ||
| 341 | modifiers: ShortcutModifierStateLike, | ||
| 342 | keybindings: ResolvedKeybindingsConfig, | ||
| 343 | options?: ShortcutMatchOptions, | ||
| 344 | ): boolean { | ||
| 345 | const platform = resolvePlatform(options); | ||
| 346 | |||
| 347 | for (const command of MODEL_PICKER_JUMP_KEYBINDING_COMMANDS) { | ||
| 348 | const shortcut = findEffectiveShortcutForCommand(keybindings, command, options); | ||
| 349 | if (!shortcut) continue; | ||
| 350 | if (matchesShortcutModifiers(modifiers, shortcut, platform)) { | ||
| 351 | return true; | ||
| 352 | } | ||
| 353 | } | ||
| 354 | |||
| 355 | return false; | ||
| 356 | } | ||
| 357 | |||
| 358 | export function isTerminalToggleShortcut( | 332 | export function isTerminalToggleShortcut( |
| 359 | event: ShortcutEventLike, | 333 | event: ShortcutEventLike, |
| 360 | keybindings: ResolvedKeybindingsConfig, | 334 | keybindings: ResolvedKeybindingsConfig, |