fix(desktop): make pop-out timestamps inert

Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
This commit is contained in:
Taylor Ho
2026-08-24 03:55:08 -07:00
parent 675bed8545
commit dac834c905
2 changed files with 21 additions and 5 deletions

View File

@@ -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<HTMLAnchorElement>) => {
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;

View File

@@ -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);