From 32227296bd8f7b6f59b4e92dace4d0f1897502ef Mon Sep 17 00:00:00 2001 From: Taylor Ho Date: Mon, 24 Aug 2026 04:24:12 -0700 Subject: [PATCH] fix(desktop): preserve pop-out code blocks Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz> Signed-off-by: Taylor Ho --- .../CompactMessageSummary.tsx | 1 + .../activityRenderClasses/MessageActivity.tsx | 1 + .../ui/activityRenderClasses/PlanActivity.tsx | 1 + .../activityRenderClasses/ThoughtActivity.tsx | 1 + .../UserMessageBubble.tsx | 1 + .../tests/e2e/agent-activity-window.spec.ts | 21 ++++++++++++++++++- 6 files changed, 25 insertions(+), 1 deletion(-) diff --git a/desktop/src/features/agents/ui/AgentSessionToolItem/CompactMessageSummary.tsx b/desktop/src/features/agents/ui/AgentSessionToolItem/CompactMessageSummary.tsx index 3bab08fca3..3d0cb0b8e5 100644 --- a/desktop/src/features/agents/ui/AgentSessionToolItem/CompactMessageSummary.tsx +++ b/desktop/src/features/agents/ui/AgentSessionToolItem/CompactMessageSummary.tsx @@ -164,6 +164,7 @@ export function CompactMessageSummary({ {...bubbleLinkProps} > diff --git a/desktop/tests/e2e/agent-activity-window.spec.ts b/desktop/tests/e2e/agent-activity-window.spec.ts index 52e3fcf7a9..5adf359720 100644 --- a/desktop/tests/e2e/agent-activity-window.spec.ts +++ b/desktop/tests/e2e/agent-activity-window.spec.ts @@ -11,6 +11,7 @@ const COMMUNITY_ID = "e2e-default-community"; test("keeps dedicated activity windows pinned to their original channel", async ({ page, }) => { + await page.setViewportSize({ width: 560, height: 760 }); await installMockBridge(page, { windowLabel: `agent-activity-${AGENT_PUBKEY}-${AGENTS_CHANNEL_ID}`, managedAgents: [ @@ -51,7 +52,7 @@ test("keeps dedicated activity windows pinned to their original channel", async sessionUpdate: "agent_message_chunk", content: { type: "text", - text: `Continue in #general or open `, + text: `Continue in #general or open \n\n\`\`\`text\nverification-${"x".repeat(120)}-END\n\`\`\``, }, }, }, @@ -163,6 +164,24 @@ test("keeps dedicated activity windows pinned to their original channel", async await expect( panel.getByRole("button", { name: "Open channel general" }), ).toHaveCount(0); + const codeBlock = panel + .getByTestId("transcript-assistant-message") + .locator("pre"); + await expect(codeBlock).toHaveCount(1); + await expect(codeBlock).toContainText("-END"); + const codeOverflow = await codeBlock.evaluate((element) => ({ + clientWidth: element.clientWidth, + overflowX: getComputedStyle(element).overflowX, + scrollWidth: element.scrollWidth, + })); + expect(codeOverflow.overflowX).toBe("auto"); + expect(codeOverflow.scrollWidth).toBeGreaterThan(codeOverflow.clientWidth); + await codeBlock.evaluate((element) => { + element.scrollLeft = element.scrollWidth; + }); + await expect + .poll(() => codeBlock.evaluate((element) => element.scrollLeft)) + .toBeGreaterThan(0); const activityWindowUrl = page.url(); await expect(