@@ -40,11 +40,12 @@ vi.mock(import("~/state/server"), async (original) => {
4040 const { compileResolvedKeybindingsConfig } = await import ( "@t3tools/shared/keybindings" ) ;
4141 const keybindings = compileResolvedKeybindingsConfig ( [
4242 { key : "mod+shift+]" , command : "thread.next" , when : "!previewFocus && !previewOpen" } ,
43+ { key : "mod+1" , command : "thread.jump.1" , when : "!previewFocus" } ,
4344 ] ) ;
4445 return { ...actual , primaryServerKeybindingsAtom : Atom . make ( keybindings ) } ;
4546} ) ;
4647
47- it ( "leaves thread.next to the preview when its rule excludes previewFocus and previewOpen " , async ( ) => {
48+ it ( "leaves thread shortcuts and their hints to the preview when their rules exclude it " , async ( ) => {
4849 const [ first , second ] = [ threadWithHistory ( "thread-a" , 1 ) , threadWithHistory ( "thread-b" , 1 ) ] ;
4950 using _environment = installFakeEnvironment ( [ first , second ] ) ;
5051 using _platform = vi . spyOn ( navigator , "platform" , "get" ) . mockReturnValue ( "Linux x86_64" ) ;
@@ -70,11 +71,22 @@ it("leaves thread.next to the preview when its rule excludes previewFocus and pr
7071 using _chrome = { [ Symbol . dispose ] : ( ) => previewChrome . remove ( ) } ;
7172
7273 const press = ( ) => userEvent . keyboard ( "{Control>}{Shift>}]{/Shift}{/Control}" ) ;
74+ const jumpHintsShownOnHold = async ( ) => {
75+ // Every deadline reads as due on subscribe, so hints skip the hold delay.
76+ let now = Date . parse ( "2026-01-01T00:00:00.000Z" ) ;
77+ using _clock = vi . spyOn ( Date , "now" ) . mockImplementation ( ( ) => ( now += 1000 ) ) ;
78+ await userEvent . keyboard ( "{Control>}" ) ;
79+ await act ( ( ) => { } ) ;
80+ const shown = document . querySelector ( "[data-jump-hint]" ) !== null ;
81+ await userEvent . keyboard ( "{/Control}" ) ;
82+ return shown ;
83+ } ;
7384 const firstPath = `/${ ENVIRONMENT_ID } /${ first . id } ` ;
7485
7586 await userEvent . click ( page . getByRole ( "button" , { name : "Reload" } ) ) ;
7687 await press ( ) ;
7788 expect ( router . history . location . pathname ) . toBe ( firstPath ) ;
89+ expect ( await jumpHintsShownOnHold ( ) ) . toBe ( false ) ;
7890
7991 const firstRef = scopeThreadRef ( ENVIRONMENT_ID , first . id ) ;
8092 await act ( ( ) => useRightPanelStore . getState ( ) . openBrowser ( firstRef , null ) ) ;
@@ -87,4 +99,5 @@ it("leaves thread.next to the preview when its rule excludes previewFocus and pr
8799 await vi . waitFor ( ( ) =>
88100 expect ( router . history . location . pathname ) . toBe ( `/${ ENVIRONMENT_ID } /${ second . id } ` ) ,
89101 ) ;
102+ expect ( await jumpHintsShownOnHold ( ) ) . toBe ( true ) ;
90103} ) ;
0 commit comments