mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
- Refactors history display using Ink's <Static> component to prevent flickering and improve performance by rendering completed items statically. - Introduces ConsolePatcher component to capture and display console.log, console.warn, and console.error output within the Ink UI, addressing native handling issues. - Introduce a new content splitting mechanism to work better for static items. Basically when content gets too long we will now split content into multiple blocks for Gemini messages to ensure that we can statically cache larger pieces of history. Fixes: - https://b.corp.google.com/issues/411450097 - https://b.corp.google.com/issues/412716309
32 lines
677 B
TypeScript
32 lines
677 B
TypeScript
/**
|
|
* @license
|
|
* Copyright 2025 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import React from 'react';
|
|
import { Text, Box } from 'ink';
|
|
import { Colors } from '../../colors.js';
|
|
|
|
interface ErrorMessageProps {
|
|
text: string;
|
|
}
|
|
|
|
export const ErrorMessage: React.FC<ErrorMessageProps> = ({ text }) => {
|
|
const prefix = '✕ ';
|
|
const prefixWidth = prefix.length;
|
|
|
|
return (
|
|
<Box flexDirection="row" marginBottom={1}>
|
|
<Box width={prefixWidth}>
|
|
<Text color={Colors.AccentRed}>{prefix}</Text>
|
|
</Box>
|
|
<Box flexGrow={1}>
|
|
<Text wrap="wrap" color={Colors.AccentRed}>
|
|
{text}
|
|
</Text>
|
|
</Box>
|
|
</Box>
|
|
);
|
|
};
|