mirror of
https://github.com/block/buzz.git
synced 2026-10-31 06:21:34 +00:00
fix(desktop): preserve pop-out code blocks
Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
This commit is contained in:
@@ -164,6 +164,7 @@ export function CompactMessageSummary({
|
||||
{...bubbleLinkProps}
|
||||
>
|
||||
<Markdown
|
||||
blockCode
|
||||
className={isCompactPreview ? "text-xs leading-4" : "leading-5"}
|
||||
content={resolvedContent || "Message content unavailable."}
|
||||
interactive={activityWindowMarkdownInteractive()}
|
||||
|
||||
@@ -64,6 +64,7 @@ function MessageItem({
|
||||
title={formatTranscriptTimestampTitle(item.timestamp)}
|
||||
>
|
||||
<Markdown
|
||||
blockCode
|
||||
className={isCompactPreview ? "text-xs leading-4" : "leading-5"}
|
||||
content={text || " "}
|
||||
interactive={activityWindowMarkdownInteractive()}
|
||||
|
||||
@@ -40,6 +40,7 @@ export function PlanActivity(props: ActivityRenderClassItemProps) {
|
||||
<ActivityRowLabel object="plan" openToneScope="tool" verb="Updated" />
|
||||
<ActivityRowContent className="pt-1 pb-1.5 text-sm leading-5 text-muted-foreground">
|
||||
<Markdown
|
||||
blockCode
|
||||
className="leading-5"
|
||||
content={props.item.text.trim() || "No plan details."}
|
||||
interactive={activityWindowMarkdownInteractive()}
|
||||
|
||||
@@ -25,6 +25,7 @@ export function ThoughtActivity(props: ActivityRenderClassItemProps) {
|
||||
<ActivityRowLabel openToneScope="tool" verb={props.item.title} />
|
||||
<ActivityRowContent className="pt-1 pb-1.5 text-sm leading-5 text-muted-foreground">
|
||||
<Markdown
|
||||
blockCode
|
||||
className="leading-5"
|
||||
content={props.item.text.trim() || " "}
|
||||
interactive={activityWindowMarkdownInteractive()}
|
||||
|
||||
@@ -156,6 +156,7 @@ export function UserMessageBubble({
|
||||
<Markdown
|
||||
className={isCompactPreview ? "text-xs leading-4" : "leading-5"}
|
||||
content={text || " "}
|
||||
blockCode
|
||||
interactive={activityWindowMarkdownInteractive()}
|
||||
mediaInset
|
||||
/>
|
||||
|
||||
@@ -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 <buzz://repo?owner=${repositoryOwnerPubkey}&d=relay-tools>`,
|
||||
text: `Continue in #general or open <buzz://repo?owner=${repositoryOwnerPubkey}&d=relay-tools>\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(
|
||||
|
||||
Reference in New Issue
Block a user