Changesets · Branches · Tags · Compare
| Changeset | e98588f7652fde0d5fe8b5ff5dc3d429389f85b41afd9d755a891072429e83dd |
|---|---|
| Author | Nate <sestinj@gmail.com> · 2025-08-28 14:00 -07:00 |
| Committer | Nate <sestinj@gmail.com> · 2025-08-28 14:00 -07:00 |
| Parents | b2162ee949fa |
1 file changed
modified extensions/cli/src/ui/ToolResultSummary.tsx +10 −6
| @@ -8,6 +8,8 @@ | ||
| 8 | 8 | import { ColoredDiff } from "./ColoredDiff.js"; |
| 9 | 9 | import { ChecklistDisplay } from "./components/ChecklistDisplay.js"; |
| 10 | 10 | |
| 11 | +const MAX_BASH_OUTPUT_LINES = 4; | |
| 12 | + | |
| 11 | 13 | interface ToolResultSummaryProps { |
| 12 | 14 | toolName?: string; |
| 13 | 15 | content: string; |
| @@ -74,8 +76,8 @@ | ||
| 74 | 76 | const actualOutput = isStderr ? content.slice(7).trim() : content; |
| 75 | 77 | const outputLines = actualOutput.split("\n"); |
| 76 | 78 | |
| 77 | - if (outputLines.length <= 16) { | |
| 78 | - // Show actual output for 16 lines or fewer | |
| 79 | + if (outputLines.length <= MAX_BASH_OUTPUT_LINES) { | |
| 80 | + // Show actual output for MAX_BASH_OUTPUT_LINES lines or fewer | |
| 79 | 81 | return ( |
| 80 | 82 | <Box flexDirection="column"> |
| 81 | 83 | <Box> |
| @@ -88,8 +90,8 @@ | ||
| 88 | 90 | </Box> |
| 89 | 91 | ); |
| 90 | 92 | } else { |
| 91 | - // Show first 16 lines with ellipsis for more than 16 lines | |
| 92 | - const first16Lines = outputLines.slice(0, 16).join("\n"); | |
| 93 | + // Show first MAX_BASH_OUTPUT_LINES lines with ellipsis for more lines | |
| 94 | + const firstLines = outputLines.slice(0, MAX_BASH_OUTPUT_LINES).join("\n"); | |
| 93 | 95 | return ( |
| 94 | 96 | <Box flexDirection="column"> |
| 95 | 97 | <Box> |
| @@ -97,10 +99,12 @@ | ||
| 97 | 99 | <Text color="gray"> Terminal output:</Text> |
| 98 | 100 | </Box> |
| 99 | 101 | <Box paddingLeft={2}> |
| 100 | - <Text color={isStderr ? "red" : "white"}>{first16Lines}</Text> | |
| 102 | + <Text color={isStderr ? "red" : "white"}>{firstLines}</Text> | |
| 101 | 103 | </Box> |
| 102 | 104 | <Box paddingLeft={2}> |
| 103 | - <Text color="gray">...</Text> | |
| 105 | + <Text color="gray"> | |
| 106 | + ... +{outputLines.length - MAX_BASH_OUTPUT_LINES} lines | |
| 107 | + </Text> | |
| 104 | 108 | </Box> |
| 105 | 109 | </Box> |
| 106 | 110 | ); |