From cbb77e35ff19809c1c05760fbdf7c995d85dc72c Mon Sep 17 00:00:00 2001 From: Nate Date: Mon, 14 Jul 2025 00:59:26 -0700 Subject: [PATCH] fix: truncate diff at 16 lines --- src/ui/ColoredDiff.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ui/ColoredDiff.tsx b/src/ui/ColoredDiff.tsx index d265b91ed..1dcae6de5 100644 --- a/src/ui/ColoredDiff.tsx +++ b/src/ui/ColoredDiff.tsx @@ -78,9 +78,12 @@ export const ColoredDiff: React.FC<{ diffContent: string }> = ({ diffContent }) (l) => l.type !== 'hunk' && l.type !== 'other', ); + const truncatedLines = displayableLines.slice(0, 16); + const isTruncated = displayableLines.length > 16; + return ( - {displayableLines.map((line, index) => { + {truncatedLines.map((line, index) => { const lineKey = `diff-line-${index}`; let gutterNumStr = ''; let prefixSymbol = ' '; @@ -119,6 +122,11 @@ export const ColoredDiff: React.FC<{ diffContent: string }> = ({ diffContent }) ); })} + {isTruncated && ( + + ... ({displayableLines.length - 16} more lines) + + )} ); }; \ No newline at end of file