@@ -390,7 +390,7 @@ test(
390390 } ,
391391)
392392
393- test ( "⌘T inside the browser pane opens the side panel's New tab, and a session everywhere else" , async ( { page } ) => {
393+ test ( "opens a browser tab with ⌘T inside the pane and a session everywhere else" , async ( { page } ) => {
394394 const root = page . getByTestId ( "browser-region-fixture" )
395395 const mac = await page . evaluate ( ( ) => / M a c | i P h o n e | i P a d | i P o d / . test ( navigator . platform ) )
396396 const mod = mac ? "Meta" : "Control"
@@ -399,7 +399,6 @@ test("⌘T inside the browser pane opens the side panel's New tab, and a session
399399 const editor = page . frameLocator ( 'iframe[title="Browser page"]' ) . getByRole ( "textbox" , { name : "Editor page input" } )
400400 const opens = root . getByTestId ( "browser-opens" )
401401 const sessions = root . getByTestId ( "new-sessions" )
402- const newTabs = root . getByTestId ( "side-new-tabs" )
403402 await expect ( root . getByText ( "Registrations: 1" , { exact : true } ) ) . toBeVisible ( )
404403 await outside . click ( )
405404 await expect ( root . getByText ( "Registrations: 2" , { exact : true } ) ) . toBeVisible ( )
@@ -410,12 +409,12 @@ test("⌘T inside the browser pane opens the side panel's New tab, and a session
410409 await outside . focus ( )
411410 await outside . press ( `${ mod } +t` )
412411 await expect ( sessions ) . toHaveText ( "1" )
413- await expect ( newTabs ) . toHaveText ( "0" )
412+ await expect ( opens ) . toHaveText ( "0" )
414413
415- // Inside the pane, as anywhere in the side panel, it opens a New tab rather than a blank browser tab.
414+ // Inside the pane it opens a browser tab directly .
416415 await address . focus ( )
417416 await address . press ( `${ mod } +t` )
418- await expect ( newTabs ) . toHaveText ( "1" )
417+ await expect ( opens ) . toHaveText ( "1" )
419418
420419 // Dvorak's T sits on the physical K key: the shortcut follows the character, not the key position.
421420 await address . evaluate ( ( element , meta ) => {
@@ -430,47 +429,34 @@ test("⌘T inside the browser pane opens the side panel's New tab, and a session
430429 } ) ,
431430 )
432431 } , mac )
433- await expect ( newTabs ) . toHaveText ( "2" )
432+ await expect ( opens ) . toHaveText ( "2" )
434433
435434 // A focused page hands the reserved chord to the pane before it sees it.
436435 await editor . focus ( )
437436 await editor . press ( `${ mod } +t` )
438- await expect ( newTabs ) . toHaveText ( "3" )
437+ await expect ( opens ) . toHaveText ( "3" )
439438 await expect ( sessions ) . toHaveText ( "1" )
440- await expect ( opens ) . toHaveText ( "0" )
441439
442440 // The browser's own chord, which opens a blank browser tab, reaches the app from the page too.
443441 await editor . focus ( )
444442 await editor . press ( mac ? "Control+Meta+b" : "Control+Alt+b" )
445- await expect ( opens ) . toHaveText ( "1 " )
443+ await expect ( opens ) . toHaveText ( "4 " )
446444} )
447445
448- test ( "the side panel's New tab opens what its address field names in a browser tab " , async ( { page } ) => {
446+ test ( "the side panel's New tab view does not mount the browser address bar " , async ( { page } ) => {
449447 const root = page . getByTestId ( "browser-region-fixture" )
450448 const mod = ( await page . evaluate ( ( ) => / M a c | i P h o n e | i P a d | i P o d / . test ( navigator . platform ) ) ) ? "Meta" : "Control"
451449 const panel = page . locator ( "#review-panel" )
452450 const field = root . getByTestId ( "side-new-tab-view" ) . getByRole ( "combobox" , { name : "Browser address" , exact : true } )
453- const opens = root . getByTestId ( "browser-opens" )
454451 await expect ( root . getByText ( "Registrations: 1" , { exact : true } ) ) . toBeVisible ( )
455452 await root . getByRole ( "button" , { name : "Beta" , exact : true } ) . click ( )
456453 await root . getByRole ( "button" , { name : "First inventory" , exact : true } ) . click ( )
457454 await expect ( root . getByTestId ( "selected" ) ) . toHaveText ( / ^ b r o w s e r : / )
458- await expect ( field ) . toHaveCount ( 0 )
459455
460456 await panel . getByTestId ( "selected" ) . click ( )
461457 await page . keyboard . press ( `${ mod } +t` )
462458 await expect ( root . getByTestId ( "side-new-tab" ) ) . toHaveText ( "shown" )
463-
464- // An address opens as typed; main adds the scheme. Other text searches the web.
465- await field . fill ( "example.com" )
466- await field . press ( "Enter" )
467- await expect ( opens ) . toHaveText ( "1" )
468- await expect ( root . getByRole ( "status" ) . getByText ( "example.com" , { exact : true } ) ) . toBeVisible ( )
469-
470- await field . fill ( "solid signals" )
471- await field . press ( "Enter" )
472- await expect ( opens ) . toHaveText ( "2" )
473- await expect ( root . getByRole ( "status" ) . getByText ( "https://www.google.com/search?q=solid%20signals" , { exact : true } ) ) . toBeVisible ( )
459+ await expect ( field ) . toHaveCount ( 0 )
474460} )
475461
476462test ( "⌘T and ⌘W follow focus: side tabs inside the side panel, session tabs elsewhere" , async ( { page } ) => {
@@ -497,16 +483,14 @@ test("⌘T and ⌘W follow focus: side tabs inside the side panel, session tabs
497483 await editor . click ( )
498484 await expect ( panel ) . toHaveAttribute ( "data-focused" )
499485 await editor . press ( `${ mod } +t` )
500- await expect ( newTab ) . toHaveText ( "shown " )
501- await expect ( opens ) . toHaveText ( "0 " )
486+ await expect ( opens ) . toHaveText ( "1 " )
487+ await expect ( newTab ) . toHaveText ( "none " )
502488 await expect ( sessions ) . toHaveText ( "1" )
503489
504- // A click on the side panel's own surface, nothing focusable, leaves focus on the panel: ⌘W closes the new tab view
505- // and ⌘T opens another , then ⌘W closes that view, then the selected tab.
490+ // A click on the side panel's own surface, nothing focusable, leaves focus on the panel: ⌘T opens the side panel's
491+ // new tab hook , then ⌘W closes that view, then the selected tab.
506492 await panel . getByTestId ( "selected" ) . click ( )
507493 await expect ( panel ) . toHaveAttribute ( "data-focused" )
508- await page . keyboard . press ( `${ mod } +w` )
509- await expect ( newTab ) . toHaveText ( "none" )
510494 await page . keyboard . press ( `${ mod } +t` )
511495 await expect ( newTab ) . toHaveText ( "shown" )
512496 await page . keyboard . press ( `${ mod } +w` )
@@ -604,16 +588,15 @@ test("keeps blank browser tabs when adding tabs and selecting another panel", as
604588 const tabs = root . getByRole ( "tab" , { name : "New tab" , exact : true } )
605589 await expect ( tabs ) . toHaveAttribute ( "aria-selected" , "true" )
606590
607- // The side panel's New tab opens over the blank browser tab and leaves it in the strip.
608591 await address . press ( `${ mac ? "Meta" : "Control" } +t` )
609- await expect ( root . getByTestId ( "side-new- tabs" ) ) . toHaveText ( "1" )
610- await expect ( tabs ) . toHaveCount ( 1 )
592+ await expect ( tabs ) . toHaveCount ( 2 )
593+ await expect ( tabs . nth ( 1 ) ) . toHaveAttribute ( "aria-selected" , "true" )
611594 await expect ( root . getByTestId ( "browser-closes" ) ) . toHaveText ( "[]" )
612595
613596 // Selecting a different panel must not treat blank browser tabs as disposable placeholders.
614597 await address . press ( `${ mac ? "Meta" : "Control" } +1` )
615598 await expect ( root . getByRole ( "tab" , { name : "beta.ts" , exact : true } ) ) . toHaveAttribute ( "aria-selected" , "true" )
616- await expect ( tabs ) . toHaveCount ( 1 )
599+ await expect ( tabs ) . toHaveCount ( 2 )
617600 await expect ( root . getByTestId ( "browser-closes" ) ) . toHaveText ( "[]" )
618601} )
619602
0 commit comments