- Bring tool messages in line with original envisioned UI of: https://screenshot.googleplex.com/9yZCX636LzpMrgc - In particular this represents more descriptive names. FWIW we already had this tech we just weren't passing around information correctly (`displayName` vs. `name`) - Add gray to our list of color pallete's and removed Background (unused) - Re-enabled representing canceled messages - Migrated back towards a cleaner tool message design of status symbols & border colors vs. overly verbose text. - Removed border from confirmation diffs. Fixes https://b.corp.google.com/issues/412598909
31 lines
753 B
TypeScript
31 lines
753 B
TypeScript
/**
|
|
* @license
|
|
* Copyright 2025 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import React from 'react';
|
|
import { Text, Box } from 'ink';
|
|
import { MarkdownRenderer } from '../../utils/MarkdownRenderer.js';
|
|
import { Colors } from '../../colors.js';
|
|
|
|
interface GeminiMessageProps {
|
|
text: string;
|
|
}
|
|
|
|
export const GeminiMessage: React.FC<GeminiMessageProps> = ({ text }) => {
|
|
const prefix = '✦ ';
|
|
const prefixWidth = prefix.length;
|
|
const renderedBlocks = MarkdownRenderer.render(text);
|
|
|
|
return (
|
|
<Box flexDirection="row">
|
|
<Box width={prefixWidth}>
|
|
<Text color={Colors.AccentPurple}>{prefix}</Text>
|
|
</Box>
|
|
<Box flexGrow={1} flexDirection="column">
|
|
{renderedBlocks}
|
|
</Box>
|
|
</Box>
|
|
);
|
|
};
|