@@ -535,6 +535,43 @@ describe("thread navigation helpers", () => {
535535 } ) ,
536536 ) ;
537537 } ) ;
538+
539+ it ( "keeps default thread jumps off the web so the browser can switch tabs" , ( ) => {
540+ const input = event ( { key : "1" , metaKey : true } ) ;
541+ assert . isNull (
542+ resolveShortcutCommand ( input , DEFAULT_RESOLVED_KEYBINDINGS , {
543+ platform : "MacIntel" ,
544+ context : { isDesktop : false } ,
545+ } ) ,
546+ ) ;
547+ assert . strictEqual (
548+ resolveShortcutCommand ( input , DEFAULT_RESOLVED_KEYBINDINGS , {
549+ platform : "MacIntel" ,
550+ context : { isDesktop : true } ,
551+ } ) ,
552+ "thread.jump.1" ,
553+ ) ;
554+ assert . isFalse (
555+ shouldShowThreadJumpHintsForModifiers (
556+ event ( { metaKey : true } ) ,
557+ DEFAULT_RESOLVED_KEYBINDINGS ,
558+ {
559+ platform : "MacIntel" ,
560+ context : { isDesktop : false } ,
561+ } ,
562+ ) ,
563+ ) ;
564+ assert . isTrue (
565+ shouldShowThreadJumpHintsForModifiers (
566+ event ( { metaKey : true } ) ,
567+ DEFAULT_RESOLVED_KEYBINDINGS ,
568+ {
569+ platform : "MacIntel" ,
570+ context : { isDesktop : true } ,
571+ } ,
572+ ) ,
573+ ) ;
574+ } ) ;
538575} ) ;
539576
540577describe ( "model picker navigation helpers" , ( ) => {
@@ -546,6 +583,30 @@ describe("model picker navigation helpers", () => {
546583 assert . strictEqual ( modelPickerJumpIndexFromCommand ( "modelPicker.jump.3" ) , 2 ) ;
547584 assert . isNull ( modelPickerJumpIndexFromCommand ( "thread.jump.1" ) ) ;
548585 } ) ;
586+
587+ it ( "keeps default model jumps off the web even while the picker is open" , ( ) => {
588+ const input = event ( { key : "3" , metaKey : true } ) ;
589+ assert . isNull (
590+ resolveShortcutCommand ( input , DEFAULT_RESOLVED_KEYBINDINGS , {
591+ platform : "MacIntel" ,
592+ context : { isDesktop : false , modelPickerOpen : true } ,
593+ } ) ,
594+ ) ;
595+ assert . strictEqual (
596+ resolveShortcutCommand ( input , DEFAULT_RESOLVED_KEYBINDINGS , {
597+ platform : "MacIntel" ,
598+ context : { isDesktop : true , modelPickerOpen : true } ,
599+ } ) ,
600+ "modelPicker.jump.3" ,
601+ ) ;
602+ assert . strictEqual (
603+ resolveShortcutCommand ( input , DEFAULT_RESOLVED_KEYBINDINGS , {
604+ platform : "MacIntel" ,
605+ context : { isDesktop : true , modelPickerOpen : false } ,
606+ } ) ,
607+ "thread.jump.3" ,
608+ ) ;
609+ } ) ;
549610} ) ;
550611
551612describe ( "chat/editor shortcuts" , ( ) => {
@@ -1106,7 +1167,7 @@ describe("composer and pull request shortcuts", () => {
11061167 }
11071168 } ) ;
11081169
1109- it . each ( [ "terminalOpen" , "previewFocus" , "previewOpen" , "modelPickerOpen" ] ) (
1170+ it . each ( [ "terminalOpen" , "previewFocus" , "previewOpen" , "modelPickerOpen" , "isWeb" , "isDesktop" ] ) (
11101171 "honors custom PR shortcut conditions for %s" ,
11111172 ( condition ) => {
11121173 const bindings = compileResolvedKeybindingsConfig ( [
0 commit comments