Rename component to "TodoTray" (#11469)

This commit is contained in:
Tommaso Sciortino
2025-10-19 05:22:01 -07:00
committed by GitHub
parent d065c3ca53
commit f425bd765b
4 changed files with 24 additions and 24 deletions

View File

@@ -26,7 +26,7 @@ import { useSettings } from '../contexts/SettingsContext.js';
import { ApprovalMode } from '@google/gemini-cli-core';
import { StreamingState } from '../types.js';
import { ConfigInitDisplay } from '../components/ConfigInitDisplay.js';
import { AnchoredTodoListDisplay } from './messages/Todo.js';
import { TodoTray } from './messages/Todo.js';
export const Composer = () => {
const config = useConfig();
@@ -130,7 +130,7 @@ export const Composer = () => {
</OverflowProvider>
)}
<AnchoredTodoListDisplay />
<TodoTray />
{uiState.isInputActive && (
<InputPrompt

View File

@@ -7,7 +7,7 @@
import { render } from 'ink-testing-library';
import { describe, it, expect } from 'vitest';
import { Box } from 'ink';
import { AnchoredTodoListDisplay, TodoListDisplay } from './Todo.js';
import { TodoTray, TodoListDisplay } from './Todo.js';
import type { TodoList, TodoStatus } from '@google/gemini-cli-core';
import type { UIState } from '../../contexts/UIStateContext.js';
import { UIStateContext } from '../../contexts/UIStateContext.js';
@@ -66,7 +66,7 @@ describe('<TodoListDisplay />', () => {
});
});
describe('<AnchoredTodoListDisplay />', () => {
describe('<TodoTray />', () => {
const mockHistoryItem = {
type: 'tool_group',
id: '1',
@@ -89,7 +89,7 @@ describe('<AnchoredTodoListDisplay />', () => {
const renderWithUiState = (uiState: Partial<UIState>) =>
render(
<UIStateContext.Provider value={uiState as UIState}>
<AnchoredTodoListDisplay />
<TodoTray />
</UIStateContext.Provider>,
);

View File

@@ -41,7 +41,7 @@ const TodoStatusDisplay: React.FC<{ status: TodoStatus }> = ({ status }) => {
}
};
export const AnchoredTodoListDisplay: React.FC = () => {
export const TodoTray: React.FC = () => {
const uiState = useUIState();
const todos: TodoList | null = useMemo(() => {

View File

@@ -1,23 +1,5 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`<AnchoredTodoListDisplay /> > renders null when no todos are in the history 1`] = `""`;
exports[`<AnchoredTodoListDisplay /> > renders null when todos exist but none are in progress and full view is off 1`] = `""`;
exports[`<AnchoredTodoListDisplay /> > renders only the in-progress task when full view is off 1`] = `
"┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ 📝 Todo:(ctrl+t to expand)» In Progress Task │"
`;
exports[`<AnchoredTodoListDisplay /> > renders the full todo list when full view is on 1`] = `
"┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ 📝 Todo:(ctrl+t to collapse) │
│ │
│ ☐ Pending Task │
│ » In Progress Task │
│ ✓ Completed Task │"
`;
exports[`<TodoListDisplay /> > renders a single todo item 1`] = `"☐ Single task"`;
exports[`<TodoListDisplay /> > renders a todo list with long descriptions that wrap 1`] = `
@@ -41,3 +23,21 @@ exports[`<TodoListDisplay /> > renders a todo list with various statuses correct
`;
exports[`<TodoListDisplay /> > renders an empty todo list correctly 1`] = `""`;
exports[`<TodoTray /> > renders null when no todos are in the history 1`] = `""`;
exports[`<TodoTray /> > renders null when todos exist but none are in progress and full view is off 1`] = `""`;
exports[`<TodoTray /> > renders only the in-progress task when full view is off 1`] = `
"┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ 📝 Todo:(ctrl+t to expand)» In Progress Task │"
`;
exports[`<TodoTray /> > renders the full todo list when full view is on 1`] = `
"┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ 📝 Todo:(ctrl+t to collapse) │
│ │
│ ☐ Pending Task │
│ » In Progress Task │
│ ✓ Completed Task │"
`;