88} from "@t3tools/contracts" ;
99import {
1010 formatShortcutLabel ,
11- isChatNewShortcut ,
12- isChatNewLocalShortcut ,
1311 isDiffToggleShortcut ,
1412 modelPickerJumpCommandForIndex ,
1513 modelPickerJumpIndexFromCommand ,
@@ -22,7 +20,7 @@ import {
2220 isTerminalToggleShortcut ,
2321 resolveShortcutCommand ,
2422 shouldShowModelPickerJumpHints ,
25- shouldShowThreadJumpHints ,
23+ shouldShowThreadJumpHintsForModifiers ,
2624 shortcutLabelForCommand ,
2725 terminalDeleteShortcutData ,
2826 terminalNavigationShortcutData ,
@@ -498,31 +496,35 @@ describe("thread navigation helpers", () => {
498496
499497 it ( "shows jump hints only when configured modifiers match" , ( ) => {
500498 assert . isTrue (
501- shouldShowThreadJumpHints ( event ( { metaKey : true } ) , DEFAULT_BINDINGS , {
499+ shouldShowThreadJumpHintsForModifiers ( event ( { metaKey : true } ) , DEFAULT_BINDINGS , {
502500 platform : "MacIntel" ,
503501 } ) ,
504502 ) ;
505503 assert . isFalse (
506- shouldShowThreadJumpHints ( event ( { metaKey : true , shiftKey : true } ) , DEFAULT_BINDINGS , {
507- platform : "MacIntel" ,
508- } ) ,
504+ shouldShowThreadJumpHintsForModifiers (
505+ event ( { metaKey : true , shiftKey : true } ) ,
506+ DEFAULT_BINDINGS ,
507+ {
508+ platform : "MacIntel" ,
509+ } ,
510+ ) ,
509511 ) ;
510512 assert . isTrue (
511- shouldShowThreadJumpHints ( event ( { ctrlKey : true } ) , DEFAULT_BINDINGS , {
513+ shouldShowThreadJumpHintsForModifiers ( event ( { ctrlKey : true } ) , DEFAULT_BINDINGS , {
512514 platform : "Linux" ,
513515 } ) ,
514516 ) ;
515517 } ) ;
516518
517519 it ( "never shows jump hints while the terminal is focused, even with an unrestricted binding" , ( ) => {
518520 assert . isFalse (
519- shouldShowThreadJumpHints ( event ( { metaKey : true } ) , DEFAULT_BINDINGS , {
521+ shouldShowThreadJumpHintsForModifiers ( event ( { metaKey : true } ) , DEFAULT_BINDINGS , {
520522 platform : "MacIntel" ,
521523 context : { terminalFocus : true } ,
522524 } ) ,
523525 ) ;
524526 assert . isTrue (
525- shouldShowThreadJumpHints ( event ( { metaKey : true } ) , DEFAULT_BINDINGS , {
527+ shouldShowThreadJumpHintsForModifiers ( event ( { metaKey : true } ) , DEFAULT_BINDINGS , {
526528 platform : "MacIntel" ,
527529 context : { terminalFocus : false } ,
528530 } ) ,
@@ -558,28 +560,32 @@ describe("model picker navigation helpers", () => {
558560
559561describe ( "chat/editor shortcuts" , ( ) => {
560562 it ( "matches chat.new shortcut" , ( ) => {
561- assert . isTrue (
562- isChatNewShortcut ( event ( { key : "o" , metaKey : true , shiftKey : true } ) , DEFAULT_BINDINGS , {
563+ assert . strictEqual (
564+ resolveShortcutCommand ( event ( { key : "o" , metaKey : true , shiftKey : true } ) , DEFAULT_BINDINGS , {
563565 platform : "MacIntel" ,
564566 } ) ,
567+ "chat.new" ,
565568 ) ;
566- assert . isTrue (
567- isChatNewShortcut ( event ( { key : "o" , ctrlKey : true , shiftKey : true } ) , DEFAULT_BINDINGS , {
569+ assert . strictEqual (
570+ resolveShortcutCommand ( event ( { key : "o" , ctrlKey : true , shiftKey : true } ) , DEFAULT_BINDINGS , {
568571 platform : "Linux" ,
569572 } ) ,
573+ "chat.new" ,
570574 ) ;
571575 } ) ;
572576
573577 it ( "matches chat.newLocal shortcut" , ( ) => {
574- assert . isTrue (
575- isChatNewLocalShortcut ( event ( { key : "n" , metaKey : true , shiftKey : true } ) , DEFAULT_BINDINGS , {
578+ assert . strictEqual (
579+ resolveShortcutCommand ( event ( { key : "n" , metaKey : true , shiftKey : true } ) , DEFAULT_BINDINGS , {
576580 platform : "MacIntel" ,
577581 } ) ,
582+ "chat.newLocal" ,
578583 ) ;
579- assert . isTrue (
580- isChatNewLocalShortcut ( event ( { key : "n" , ctrlKey : true , shiftKey : true } ) , DEFAULT_BINDINGS , {
584+ assert . strictEqual (
585+ resolveShortcutCommand ( event ( { key : "n" , ctrlKey : true , shiftKey : true } ) , DEFAULT_BINDINGS , {
581586 platform : "Linux" ,
582587 } ) ,
588+ "chat.newLocal" ,
583589 ) ;
584590 } ) ;
585591
@@ -699,23 +705,25 @@ describe("cross-command precedence", () => {
699705 context : { terminalFocus : true } ,
700706 } ) ,
701707 ) ;
702- assert . isFalse (
703- isChatNewShortcut ( event ( { key : "n" , metaKey : true } ) , keybindings , {
708+ assert . strictEqual (
709+ resolveShortcutCommand ( event ( { key : "n" , metaKey : true } ) , keybindings , {
704710 platform : "MacIntel" ,
705711 context : { terminalFocus : true } ,
706712 } ) ,
713+ "terminal.new" ,
707714 ) ;
708715 assert . isFalse (
709716 isTerminalNewShortcut ( event ( { key : "n" , metaKey : true } ) , keybindings , {
710717 platform : "MacIntel" ,
711718 context : { terminalFocus : false } ,
712719 } ) ,
713720 ) ;
714- assert . isTrue (
715- isChatNewShortcut ( event ( { key : "n" , metaKey : true } ) , keybindings , {
721+ assert . strictEqual (
722+ resolveShortcutCommand ( event ( { key : "n" , metaKey : true } ) , keybindings , {
716723 platform : "MacIntel" ,
717724 context : { terminalFocus : false } ,
718725 } ) ,
726+ "chat.new" ,
719727 ) ;
720728 } ) ;
721729
@@ -735,11 +743,12 @@ describe("cross-command precedence", () => {
735743 context : { terminalFocus : true } ,
736744 } ) ,
737745 ) ;
738- assert . isTrue (
739- isChatNewShortcut ( event ( { key : "n" , ctrlKey : true } ) , keybindings , {
746+ assert . strictEqual (
747+ resolveShortcutCommand ( event ( { key : "n" , ctrlKey : true } ) , keybindings , {
740748 platform : "Linux" ,
741749 context : { terminalFocus : true } ,
742750 } ) ,
751+ "chat.new" ,
743752 ) ;
744753 } ) ;
745754} ) ;
0 commit comments