@@ -2,9 +2,13 @@ import { EnvironmentId, NodeId, ThreadId } from "@t3tools/contracts";
22import * as Cause from "effect/Cause" ;
33import { AsyncResult } from "effect/reactivity" ;
44import { expect , it , vi } from "vite-plus/test" ;
5- import { page } from "vite-plus/test/browser" ;
5+ import { page , userEvent } from "vite-plus/test/browser" ;
66
7- const state = vi . hoisted ( ( ) => ( { projection : null as unknown , commandSucceeds : false } ) ) ;
7+ const state = vi . hoisted ( ( ) => ( {
8+ projection : null as unknown ,
9+ commandSucceeds : false ,
10+ relatedShells : [ ] as unknown [ ] ,
11+ } ) ) ;
812
913vi . mock ( import ( "@effect/atom-react" ) , async ( original ) => ( {
1014 ...( await original ( ) ) ,
@@ -16,7 +20,9 @@ vi.mock(import("../../state/entities"), () => ({
1620 useThreadProjection : ( ( ref : unknown ) =>
1721 ref === null ? null : { projection : state . projection } ) as never ,
1822 useThreadRelationshipShells : ( ( ) =>
19- state . projection === null ? [ ] : [ ( state . projection as { thread : unknown } ) . thread ] ) as never ,
23+ state . projection === null
24+ ? [ ]
25+ : [ ( state . projection as { thread : unknown } ) . thread , ...state . relatedShells ] ) as never ,
2026 useProjects : ( ( ) => [ ] ) as never ,
2127} ) ) ;
2228vi . mock ( import ( "../../state/environments" ) , ( ) => ( {
@@ -43,6 +49,7 @@ const threadId = ThreadId.make("fork");
4349
4450function setup ( ) {
4551 state . commandSucceeds = false ;
52+ state . relatedShells = [ ] ;
4653 state . projection = {
4754 thread : {
4855 id : threadId ,
@@ -183,3 +190,58 @@ it("opens an idle child from Lineage when its shell has not been loaded", async
183190 expect ( screen . router ?. state . location . pathname ) . toBe ( "/local/omitted-child" ) ,
184191 ) ;
185192} ) ;
193+
194+ it ( "shows a lineage thread's full title in its tooltip" , async ( ) => {
195+ setup ( ) ;
196+ const longTitle = "Compare the lineage tooltip against a title that the row truncates" ;
197+ const sourceThread = {
198+ ...( state . projection as { thread : Record < string , unknown > } ) . thread ,
199+ id : "source" ,
200+ title : longTitle ,
201+ lineage : { parentThreadId : null , relationshipToParent : null } ,
202+ } ;
203+ state . relatedShells = [ sourceThread ] ;
204+ await using _screen = await render (
205+ < ThreadRelationshipsPanel
206+ environmentId = { environmentId }
207+ threadId = { threadId }
208+ showLineage
209+ showSideChats = { false }
210+ /> ,
211+ ) ;
212+
213+ await userEvent . hover ( page . getByText ( longTitle , { exact : true } ) ) ;
214+ await vi . waitFor ( ( ) =>
215+ expect ( document . querySelector ( '[data-slot="tooltip-popup"]' ) ?. textContent ) . toContain ( longTitle ) ,
216+ ) ;
217+ } ) ;
218+
219+ it ( "shows a side chat's full title in its tooltip" , async ( ) => {
220+ setup ( ) ;
221+ const longTitle = "Side chat question with a title that the side chat row truncates" ;
222+ state . relatedShells = [
223+ {
224+ id : "side" ,
225+ title : longTitle ,
226+ lineage : {
227+ parentThreadId : threadId ,
228+ relationshipToParent : "fork" ,
229+ rootThreadId : threadId ,
230+ sideChat : true ,
231+ } ,
232+ } ,
233+ ] ;
234+ await using _screen = await render (
235+ < ThreadRelationshipsPanel
236+ environmentId = { environmentId }
237+ threadId = { threadId }
238+ showLineage = { false }
239+ showSideChats
240+ /> ,
241+ ) ;
242+
243+ await userEvent . hover ( page . getByText ( longTitle , { exact : true } ) ) ;
244+ await vi . waitFor ( ( ) =>
245+ expect ( document . querySelector ( '[data-slot="tooltip-popup"]' ) ?. textContent ) . toContain ( longTitle ) ,
246+ ) ;
247+ } ) ;
0 commit comments