fix: prevent duplicate rendering (#528)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2026-01-12 20:46:57 -08:00
committed by GitHub
parent 6d0c98ee5e
commit a0f604b5f0
4 changed files with 75 additions and 35 deletions

View File

@@ -1,6 +1,7 @@
import { Box, Text } from "ink";
import { memo } from "react";
import { useTerminalWidth } from "../hooks/useTerminalWidth";
import { MarkdownDisplay } from "./MarkdownDisplay";
const COLLAPSED_LINES = 3;
const PREFIX_WIDTH = 5; // " ⎿ " or " "
@@ -42,7 +43,7 @@ export const CollapsedOutputDisplay = memo(
<Text>{" ⎿ "}</Text>
</Box>
<Box flexGrow={1} width={contentWidth}>
<Text wrap="wrap">{visibleLines[0]}</Text>
<MarkdownDisplay text={visibleLines[0] ?? ""} />
</Box>
</Box>
{/* Remaining visible lines with indent (5 spaces to align with content after bracket) */}
@@ -53,7 +54,7 @@ export const CollapsedOutputDisplay = memo(
<Text>{" "}</Text>
</Box>
<Box flexGrow={1} width={contentWidth}>
<Text wrap="wrap">{line}</Text>
<MarkdownDisplay text={line} />
</Box>
</Box>
))}