mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-28 19:52:02 +00:00
truncate (hide) tool output at the top, add some spacing, also fix shell output interval change accidentally undone in a previous commit (#619)
This commit is contained in:
parent
a3b557222a
commit
7c4a5464f6
2 changed files with 28 additions and 19 deletions
|
|
@ -47,7 +47,7 @@ export const ToolMessage: React.FC<ToolMessageProps> = ({
|
|||
const displayableResult = React.useMemo(
|
||||
() =>
|
||||
resultIsString
|
||||
? lines.slice(0, contentHeightEstimate).join('\n')
|
||||
? lines.slice(-contentHeightEstimate).join('\n')
|
||||
: resultDisplay,
|
||||
[lines, resultIsString, contentHeightEstimate, resultDisplay],
|
||||
);
|
||||
|
|
@ -66,8 +66,16 @@ export const ToolMessage: React.FC<ToolMessageProps> = ({
|
|||
{emphasis === 'high' && <TrailingIndicator />}
|
||||
</Box>
|
||||
{displayableResult && (
|
||||
<Box paddingLeft={STATUS_INDICATOR_WIDTH} width="100%">
|
||||
<Box paddingLeft={STATUS_INDICATOR_WIDTH} width="100%" marginTop={1}>
|
||||
<Box flexDirection="column">
|
||||
{hiddenLines > 0 && (
|
||||
<Box>
|
||||
<Text color={Colors.SubtleComment}>
|
||||
... first {hiddenLines} line{hiddenLines === 1 ? '' : 's'}{' '}
|
||||
hidden ...
|
||||
</Text>
|
||||
</Box>
|
||||
)}
|
||||
{typeof displayableResult === 'string' && (
|
||||
<Box flexDirection="column">
|
||||
<MarkdownDisplay
|
||||
|
|
@ -83,14 +91,6 @@ export const ToolMessage: React.FC<ToolMessageProps> = ({
|
|||
filename={displayableResult.fileName}
|
||||
/>
|
||||
)}
|
||||
{hiddenLines > 0 && (
|
||||
<Box>
|
||||
<Text color={Colors.SubtleComment}>
|
||||
... {hiddenLines} more line{hiddenLines === 1 ? '' : 's'}{' '}
|
||||
hidden ...
|
||||
</Text>
|
||||
</Box>
|
||||
)}
|
||||
</Box>
|
||||
</Box>
|
||||
)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue