Improve rendering of ToDo lists. (#11315)

This commit is contained in:
Tommaso Sciortino
2025-10-16 16:06:43 -07:00
committed by GitHub
parent c71b749185
commit 9a4211b610
7 changed files with 161 additions and 12 deletions
@@ -13,6 +13,7 @@ import { MarkdownDisplay } from '../../utils/MarkdownDisplay.js';
import { AnsiOutputText } from '../AnsiOutput.js';
import { GeminiRespondingSpinner } from '../GeminiRespondingSpinner.js';
import { MaxSizedBox } from '../shared/MaxSizedBox.js';
import { TodoListDisplay } from './TodoListDisplay.js';
import { ShellInputPrompt } from '../ShellInputPrompt.js';
import {
SHELL_COMMAND_NAME,
@@ -20,7 +21,7 @@ import {
TOOL_STATUS,
} from '../../constants.js';
import { theme } from '../../semantic-colors.js';
import type { AnsiOutput, Config } from '@google/gemini-cli-core';
import type { AnsiOutput, Config, TodoList } from '@google/gemini-cli-core';
import { useUIState } from '../../contexts/UIStateContext.js';
const STATIC_HEIGHT = 1;
@@ -170,6 +171,12 @@ export const ToolMessage: React.FC<ToolMessageProps> = ({
availableTerminalHeight={availableHeight}
terminalWidth={childWidth}
/>
) : typeof resultDisplay === 'object' &&
'todos' in resultDisplay ? (
<TodoListDisplay
todos={resultDisplay as TodoList}
terminalWidth={childWidth}
/>
) : (
<AnsiOutputText
data={resultDisplay as AnsiOutput}