diff options
| author | DeWitt Clinton <[email protected]> | 2025-05-25 10:26:51 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-05-25 10:26:51 -0700 |
| commit | 068b505d5e34478e6d41a2d58d8c1a0ed7001a88 (patch) | |
| tree | 8e0dc97a234e901140f680391abd2aa29716f889 /packages/cli/src/ui/components/messages/DiffRenderer.tsx | |
| parent | e297b56390e81dcad4c87154ea50c2a995e633c3 (diff) | |
Reduce excessive diff separators in CLI. (#535)
Increases the threshold for rendering diff separators in the CLI's diff display. Previously, a separator was shown for gaps of more than one context line, leading to excessive separators in diffs with many small changes close together (Issue #534).
By increasing `MAX_CONTEXT_LINES_WITHOUT_GAP` to 5, we allow for more context lines before a separator is added, significantly reducing visual clutter in such diffs.
Added a test case to `DiffRenderer.test.tsx` to verify that separators are not rendered for small gaps within the new threshold.
Diffstat (limited to 'packages/cli/src/ui/components/messages/DiffRenderer.tsx')
| -rw-r--r-- | packages/cli/src/ui/components/messages/DiffRenderer.tsx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/cli/src/ui/components/messages/DiffRenderer.tsx b/packages/cli/src/ui/components/messages/DiffRenderer.tsx index bf00537d..8780d9c2 100644 --- a/packages/cli/src/ui/components/messages/DiffRenderer.tsx +++ b/packages/cli/src/ui/components/messages/DiffRenderer.tsx @@ -188,7 +188,7 @@ const renderDiffContent = ( : `diff-box-${crypto.createHash('sha1').update(JSON.stringify(parsedLines)).digest('hex')}`; let lastLineNumber: number | null = null; - const MAX_CONTEXT_LINES_WITHOUT_GAP = 1; + const MAX_CONTEXT_LINES_WITHOUT_GAP = 5; return ( <Box flexDirection="column" key={key}> |
