refactor: remove unused props clearItems, openThemeDialog, onSubmit (#357)

This commit is contained in:
Brandon Keiji
2025-05-15 16:12:15 +00:00
committed by GitHub
parent 39d57ead1a
commit c6bca64499
5 changed files with 1 additions and 20 deletions

View File

@@ -11,18 +11,15 @@ import { GeminiMessage } from './messages/GeminiMessage.js';
import { InfoMessage } from './messages/InfoMessage.js';
import { ErrorMessage } from './messages/ErrorMessage.js';
import { ToolGroupMessage } from './messages/ToolGroupMessage.js';
import { PartListUnion } from '@google/genai';
import { GeminiMessageContent } from './messages/GeminiMessageContent.js';
import { Box } from 'ink';
interface HistoryItemDisplayProps {
item: HistoryItem;
onSubmit: (value: PartListUnion) => void;
}
export const HistoryItemDisplay: React.FC<HistoryItemDisplayProps> = ({
item,
onSubmit,
}) => (
<Box flexDirection="column" key={item.id}>
{/* Render standard message types */}
@@ -34,11 +31,7 @@ export const HistoryItemDisplay: React.FC<HistoryItemDisplayProps> = ({
{item.type === 'info' && <InfoMessage text={item.text} />}
{item.type === 'error' && <ErrorMessage text={item.text} />}
{item.type === 'tool_group' && (
<ToolGroupMessage
toolCalls={item.tools}
groupId={item.id}
onSubmit={onSubmit}
/>
<ToolGroupMessage toolCalls={item.tools} groupId={item.id} />
)}
</Box>
);

View File

@@ -6,7 +6,6 @@
import React from 'react';
import { Box, Text, useInput } from 'ink';
import { PartListUnion } from '@google/genai';
import { DiffRenderer } from './DiffRenderer.js';
import { Colors } from '../../colors.js';
import {
@@ -22,7 +21,6 @@ import {
export interface ToolConfirmationMessageProps {
confirmationDetails: ToolCallConfirmationDetails;
onSubmit: (value: PartListUnion) => void;
}
function isEditDetails(

View File

@@ -8,21 +8,18 @@ import React from 'react';
import { Box } from 'ink';
import { IndividualToolCallDisplay, ToolCallStatus } from '../../types.js';
import { ToolMessage } from './ToolMessage.js';
import { PartListUnion } from '@google/genai';
import { ToolConfirmationMessage } from './ToolConfirmationMessage.js';
import { Colors } from '../../colors.js';
interface ToolGroupMessageProps {
groupId: number;
toolCalls: IndividualToolCallDisplay[];
onSubmit: (value: PartListUnion) => void;
}
// Main component renders the border and maps the tools using ToolMessage
export const ToolGroupMessage: React.FC<ToolGroupMessageProps> = ({
groupId,
toolCalls,
onSubmit,
}) => {
const hasPending = !toolCalls.every(
(t) => t.status === ToolCallStatus.Success,
@@ -61,7 +58,6 @@ export const ToolGroupMessage: React.FC<ToolGroupMessageProps> = ({
tool.confirmationDetails && (
<ToolConfirmationMessage
confirmationDetails={tool.confirmationDetails}
onSubmit={onSubmit}
></ToolConfirmationMessage>
)}
</Box>