From dac834c9055c0347a77241c155352eb4052ba691 Mon Sep 17 00:00:00 2001 From: Taylor Ho Date: Mon, 24 Aug 2026 03:55:08 -0700 Subject: [PATCH] fix(desktop): make pop-out timestamps inert Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz> Signed-off-by: Taylor Ho --- .../activityRenderClasses/TranscriptTimestamp.tsx | 14 +++++++++----- desktop/tests/e2e/agent-activity-window.spec.ts | 12 ++++++++++++ 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/desktop/src/features/agents/ui/activityRenderClasses/TranscriptTimestamp.tsx b/desktop/src/features/agents/ui/activityRenderClasses/TranscriptTimestamp.tsx index b544a391f9..b713e84197 100644 --- a/desktop/src/features/agents/ui/activityRenderClasses/TranscriptTimestamp.tsx +++ b/desktop/src/features/agents/ui/activityRenderClasses/TranscriptTimestamp.tsx @@ -2,6 +2,7 @@ import * as React from "react"; import { useAppNavigation } from "@/app/navigation/useAppNavigation"; import { buildMessageLink } from "@/features/messages/lib/messageLink"; +import { isAgentActivityWindow } from "@/features/agents/lib/agentActivityWindow"; import { cn } from "@/shared/lib/cn"; import { formatTranscriptTime, @@ -24,17 +25,20 @@ export function TranscriptTimestamp({ }) { const formatted = formatTranscriptTime(timestamp); const { goChannel } = useAppNavigation(); - const href = messageLink ? buildMessageLink(messageLink) : null; + const effectiveMessageLink = isAgentActivityWindow() ? null : messageLink; + const href = effectiveMessageLink + ? buildMessageLink(effectiveMessageLink) + : null; const openMessage = React.useCallback( (event: React.MouseEvent) => { - if (!messageLink) return; + if (!effectiveMessageLink) return; event.preventDefault(); event.stopPropagation(); - void goChannel(messageLink.channelId, { - messageId: messageLink.messageId, + void goChannel(effectiveMessageLink.channelId, { + messageId: effectiveMessageLink.messageId, }); }, - [goChannel, messageLink], + [effectiveMessageLink, goChannel], ); if (!formatted) return null; diff --git a/desktop/tests/e2e/agent-activity-window.spec.ts b/desktop/tests/e2e/agent-activity-window.spec.ts index 6847b461be..52e3fcf7a9 100644 --- a/desktop/tests/e2e/agent-activity-window.spec.ts +++ b/desktop/tests/e2e/agent-activity-window.spec.ts @@ -70,6 +70,7 @@ test("keeps dedicated activity windows pinned to their original channel", async params: { update: { sessionUpdate: "user_message_chunk", + messageId: "b".repeat(64), authorPubkey: repositoryOwnerPubkey, content: { type: "text", text: "Please inspect the feed" }, }, @@ -189,9 +190,20 @@ test("keeps dedicated activity windows pinned to their original channel", async await expect(sentMessage.locator("[data-channel-link]")).toContainText( "general", ); + const userMessage = panel.getByTestId("transcript-user-message"); + const userTimestamp = userMessage.locator("span[title]").last(); + await expect(userTimestamp).toBeVisible(); + await expect(userTimestamp).toHaveCSS("cursor", "default"); await expect(panel.getByTestId("transcript-open-message-link")).toHaveCount( 0, ); + const openedPage = page + .context() + .waitForEvent("page", { timeout: 500 }) + .then(() => true) + .catch(() => false); + await userTimestamp.click({ button: "middle" }); + expect(await openedPage).toBe(false); await sentMessage.click(); await expect(panel).toBeVisible(); await expect(page.getByTestId("message-thread-panel")).toHaveCount(0);