@@ -118,7 +118,7 @@ suite.define(() => {
118118 }
119119 } ) ;
120120
121- it ( "keeps a long non-running state clear of always-visible touch actions" , async ( ) => {
121+ it ( "keeps fork provenance in the title above always-visible touch actions" , async ( ) => {
122122 const context = await suite . browser . newContext ( {
123123 hasTouch : true ,
124124 locale : "en-US" ,
@@ -149,25 +149,25 @@ suite.define(() => {
149149 await page . goto ( `${ suite . server . baseUrl } chat` ) ;
150150 const row = page . locator ( '[data-session-key="agent:main:touch-forked"]' ) ;
151151 await row . waitFor ( { state : "visible" , timeout : 10_000 } ) ;
152- const state = row . locator ( ".session-row-state " ) ;
152+ const fork = row . locator ( ".sidebar-recent-session__name .sidebar- session-fork-indicator " ) ;
153153 const pin = row . getByRole ( "button" , { name : "Pin session" } ) ;
154154 const menu = row . getByRole ( "button" , { name : "Open session menu" } ) ;
155- await expect . poll ( ( ) => state . locator ( ".session-row- fork-indicator" ) . isVisible ( ) ) . toBe ( true ) ;
156- await expect . poll ( ( ) => state . locator ( ".session-run-spinner " ) . count ( ) ) . toBe ( 0 ) ;
155+ await expect . poll ( ( ) => fork . isVisible ( ) ) . toBe ( true ) ;
156+ await expect . poll ( ( ) => row . locator ( ".session-row-state " ) . count ( ) ) . toBe ( 0 ) ;
157157
158- const [ nameBounds , stateBounds , pinBounds , menuBounds ] = await Promise . all ( [
158+ const [ nameBounds , forkBounds , pinBounds , menuBounds ] = await Promise . all ( [
159159 row . locator ( ".sidebar-recent-session__name" ) . boundingBox ( ) ,
160- state . boundingBox ( ) ,
160+ fork . boundingBox ( ) ,
161161 pin . boundingBox ( ) ,
162162 menu . boundingBox ( ) ,
163163 ] ) ;
164- if ( ! nameBounds || ! stateBounds || ! pinBounds || ! menuBounds ) {
165- throw new Error ( "Expected visible non-running touch state geometry" ) ;
164+ if ( ! nameBounds || ! forkBounds || ! pinBounds || ! menuBounds ) {
165+ throw new Error ( "Expected visible fork and touch action geometry" ) ;
166166 }
167- expect ( nameBounds . y + nameBounds . height / 2 ) . toBeLessThan (
168- stateBounds . y + stateBounds . height / 2 ,
169- ) ;
170- expect ( stateBounds . x + stateBounds . width ) . toBeLessThanOrEqual ( pinBounds . x ) ;
167+ expect (
168+ Math . abs ( forkBounds . y + forkBounds . height / 2 - ( nameBounds . y + nameBounds . height / 2 ) ) ,
169+ ) . toBeLessThanOrEqual ( 2 ) ;
170+ expect ( nameBounds . y + nameBounds . height / 2 ) . toBeLessThan ( pinBounds . y + pinBounds . height / 2 ) ;
171171 expect ( pinBounds . x + pinBounds . width ) . toBeLessThanOrEqual ( menuBounds . x ) ;
172172 } finally {
173173 await context . close ( ) ;
@@ -295,12 +295,32 @@ suite.define(() => {
295295 const row = page . locator ( '[data-session-key="agent:main:combined-state"]' ) ;
296296 await row . waitFor ( { state : "visible" , timeout : 10_000 } ) ;
297297 const state = row . locator ( ".session-row-state" ) ;
298- await expect . poll ( ( ) => state . locator ( ".session-row-fork-indicator" ) . isVisible ( ) ) . toBe ( true ) ;
298+ await expect
299+ . poll ( ( ) =>
300+ row . locator ( ".sidebar-recent-session__name .sidebar-session-fork-indicator" ) . isVisible ( ) ,
301+ )
302+ . toBe ( true ) ;
303+ await expect . poll ( ( ) => state . locator ( '[aria-label="Forked session"]' ) . count ( ) ) . toBe ( 0 ) ;
299304 await expect
300305 . poll ( ( ) => state . locator ( "[data-session-pr-state='open']" ) . isVisible ( ) )
301306 . toBe ( true ) ;
302307 await expect . poll ( ( ) => state . locator ( ".session-run-spinner" ) . isVisible ( ) ) . toBe ( true ) ;
303308 await expect . poll ( ( ) => state . locator ( ".session-unread-dot" ) . isVisible ( ) ) . toBe ( true ) ;
309+ const [ endcapBounds , openPullRequestBounds , spinnerBounds , unreadBounds ] = await Promise . all ( [
310+ row . locator ( ".sidebar-recent-session__details-endcap" ) . boundingBox ( ) ,
311+ state . locator ( "[data-session-pr-state='open'] svg" ) . boundingBox ( ) ,
312+ state . locator ( ".session-run-spinner" ) . boundingBox ( ) ,
313+ state . locator ( ".session-unread-dot" ) . boundingBox ( ) ,
314+ ] ) ;
315+ if ( ! endcapBounds || ! openPullRequestBounds || ! spinnerBounds || ! unreadBounds ) {
316+ throw new Error ( "Expected visible combined session state geometry" ) ;
317+ }
318+ for ( const iconBounds of [ openPullRequestBounds , spinnerBounds , unreadBounds ] ) {
319+ expect ( iconBounds . x ) . toBeGreaterThanOrEqual ( endcapBounds . x ) ;
320+ expect ( iconBounds . x + iconBounds . width ) . toBeLessThanOrEqual (
321+ endcapBounds . x + endcapBounds . width ,
322+ ) ;
323+ }
304324 const link = row . locator ( ".sidebar-recent-session__link" ) ;
305325 const details = row . locator ( ".sidebar-recent-session__details" ) ;
306326 const pin = row . getByRole ( "button" , { name : "Pin session" } ) ;
0 commit comments