Skip to content

Commit af03160

Browse files
UtkarshUsernametyulyukov
authored andcommitted
feat: show full thread title in a tooltip when hovering sidebar thread names (pingdotgg#1994)
1 parent 03746a6 commit af03160

2 files changed

Lines changed: 45 additions & 2 deletions

File tree

apps/web/src/components/ChatView.browser.tsx

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ vi.mock("../lib/gitStatusState", () => ({
5959
}));
6060

6161
const THREAD_ID = "thread-browser-test" as ThreadId;
62+
const THREAD_TITLE = "Browser test thread";
6263
const ARCHIVED_SECONDARY_THREAD_ID = "thread-secondary-project-archived" as ThreadId;
6364
const PROJECT_ID = "project-1" as ProjectId;
6465
const SECOND_PROJECT_ID = "project-2" as ProjectId;
@@ -320,7 +321,7 @@ function createSnapshotForTargetUser(options: {
320321
{
321322
id: THREAD_ID,
322323
projectId: PROJECT_ID,
323-
title: "Browser test thread",
324+
title: THREAD_TITLE,
324325
modelSelection: {
325326
provider: "codex",
326327
model: "gpt-5",
@@ -3304,6 +3305,34 @@ describe("ChatView timeline estimator parity (full app)", () => {
33043305
}
33053306
});
33063307

3308+
it("exposes the full thread title on the sidebar row tooltip", async () => {
3309+
const mounted = await mountChatView({
3310+
viewport: DEFAULT_VIEWPORT,
3311+
snapshot: createSnapshotForTargetUser({
3312+
targetMessageId: "msg-user-thread-tooltip-target" as MessageId,
3313+
targetText: "thread tooltip target",
3314+
}),
3315+
});
3316+
3317+
try {
3318+
const threadTitle = page.getByTestId(`thread-title-${THREAD_ID}`);
3319+
3320+
await expect.element(threadTitle).toBeInTheDocument();
3321+
await threadTitle.hover();
3322+
3323+
await vi.waitFor(
3324+
() => {
3325+
const tooltip = document.querySelector<HTMLElement>('[data-slot="tooltip-popup"]');
3326+
expect(tooltip).not.toBeNull();
3327+
expect(tooltip?.textContent).toContain(THREAD_TITLE);
3328+
},
3329+
{ timeout: 8_000, interval: 16 },
3330+
);
3331+
} finally {
3332+
await mounted.cleanup();
3333+
}
3334+
});
3335+
33073336
it("shows the confirm archive action after clicking the archive button", async () => {
33083337
localStorage.setItem(
33093338
"marcode:client-settings:v1",

apps/web/src/components/Sidebar.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,21 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
594594
onClick={handleRenameInputClick}
595595
/>
596596
) : (
597-
<span className="min-w-0 flex-1 truncate text-xs">{thread.title}</span>
597+
<Tooltip>
598+
<TooltipTrigger
599+
render={
600+
<span
601+
className="min-w-0 flex-1 truncate text-xs"
602+
data-testid={`thread-title-${thread.id}`}
603+
>
604+
{thread.title}
605+
</span>
606+
}
607+
/>
608+
<TooltipPopup side="top" className="max-w-80 whitespace-normal leading-tight">
609+
{thread.title}
610+
</TooltipPopup>
611+
</Tooltip>
598612
)}
599613
</div>
600614
<div className="ml-auto flex shrink-0 items-center gap-1.5">

0 commit comments

Comments
 (0)