@@ -342,25 +342,34 @@ suite.define(() => {
342342 const busyKey = "agent:main:busy-session" ;
343343 const plainKey = "agent:main:plain-session" ;
344344 const longKey = "agent:main:long-title-session" ;
345+ const unreadKey = "agent:main:unread-session" ;
345346 const homeKey = "agent:main:main" ;
346347 await installMockGateway ( page , {
347348 featureMethods : [ ...defaultControlUiFeatureMethods , "board.get" ] ,
348349 methodResponses : {
349350 "board.get" : {
350- cases : [ homeKey , busyKey , plainKey , longKey ] . map ( ( sessionKey ) => ( {
351+ cases : [ homeKey , busyKey , plainKey , longKey , unreadKey ] . map ( ( sessionKey ) => ( {
351352 match : { sessionKey } ,
352353 response : {
353354 sessionKey,
354355 revision : 1 ,
355356 tabs :
356- sessionKey === homeKey || sessionKey === busyKey
357+ sessionKey === homeKey || sessionKey === busyKey || sessionKey === unreadKey
357358 ? [ { tabId : "overview" , title : "Overview" , position : 0 , chatDock : "right" } ]
358359 : [ ] ,
359360 widgets : [ ] ,
360361 } ,
361362 } ) ) ,
362363 } ,
363364 "sessions.list" : chatSessionListResponse ( [
365+ {
366+ key : unreadKey ,
367+ kind : "direct" ,
368+ label : "Movies and recommendations for the weekend" ,
369+ icon : "🎬" ,
370+ updatedAt : 3 ,
371+ unread : true ,
372+ } ,
364373 {
365374 key : busyKey ,
366375 kind : "direct" ,
@@ -609,6 +618,38 @@ suite.define(() => {
609618 expect ( intrinsicAtomWidth ) . toBeGreaterThan ( 0 ) ;
610619 expect ( longLayout . endcapWidth ) . toBeGreaterThanOrEqual ( intrinsicAtomWidth ) ;
611620
621+ const unreadRow = page . locator ( `.sidebar-recent-session[data-session-key="${ unreadKey } "]` ) ;
622+ const unreadDot = unreadRow . locator ( ".session-unread-dot" ) ;
623+ const unreadTitle = unreadRow . locator ( ".sidebar-recent-session__name" ) ;
624+ await unreadDot . waitFor ( { state : "visible" } ) ;
625+ const restingWidth = await unreadTitle . evaluate ( ( element ) => element . clientWidth ) ;
626+ await unreadRow . hover ( ) ;
627+ if ( captureUiProofEnabled ) {
628+ await shellNav . screenshot ( {
629+ animations : "disabled" ,
630+ path : path . join ( sessionSecondRowProofDir , "03-unread-hover.png" ) ,
631+ } ) ;
632+ }
633+ await unreadDot . waitFor ( { state : "hidden" } ) ;
634+ const hoverWidth = await unreadTitle . evaluate ( ( element ) => element . clientWidth ) ;
635+ const actionReserve = await unreadRow . evaluate ( ( element ) =>
636+ Number . parseFloat (
637+ getComputedStyle ( element ) . getPropertyValue ( "--session-row-actions-reserve" ) ,
638+ ) ,
639+ ) ;
640+ // Collapsing the unread track gives its width back to the title; merely
641+ // making the dot transparent would still squeeze the text by the full reserve.
642+ expect ( restingWidth - hoverWidth ) . toBeLessThan ( actionReserve ) ;
643+ await unreadRow
644+ . getByRole ( "img" , { name : "Dashboard available" } )
645+ . waitFor ( { state : "visible" } ) ;
646+ await page . mouse . move ( 900 , 400 ) ;
647+ await unreadDot . waitFor ( { state : "visible" } ) ;
648+ await unreadRow . locator ( "[data-session-menu]" ) . focus ( ) ;
649+ await unreadDot . waitFor ( { state : "hidden" } ) ;
650+ await sidebarResizer . focus ( ) ;
651+ await unreadDot . waitFor ( { state : "visible" } ) ;
652+
612653 await busyRow . hover ( ) ;
613654 await expect
614655 . poll ( ( ) =>
0 commit comments