mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-18 10:01:29 -07:00
feat(cli): remove output verbosity settings and logic
This commit is contained in:
@@ -171,18 +171,6 @@ describe('<HistoryItemDisplay />', () => {
|
||||
expect(lastFrame()).toContain('Agent powering down. Goodbye!');
|
||||
});
|
||||
|
||||
it('renders InfoMessage for "debug" type with gear icon', () => {
|
||||
const item: HistoryItem = {
|
||||
...baseItem,
|
||||
type: MessageType.DEBUG,
|
||||
text: 'Debug info',
|
||||
};
|
||||
const { lastFrame } = renderWithProviders(
|
||||
<HistoryItemDisplay {...baseItem} item={item} />,
|
||||
);
|
||||
expect(lastFrame()).toContain('⚙ Debug info');
|
||||
});
|
||||
|
||||
it('should escape ANSI codes in text content', () => {
|
||||
const historyItem: HistoryItem = {
|
||||
id: 1,
|
||||
|
||||
@@ -18,7 +18,6 @@ import { GeminiMessageContent } from './messages/GeminiMessageContent.js';
|
||||
import { CompressionMessage } from './messages/CompressionMessage.js';
|
||||
import { WarningMessage } from './messages/WarningMessage.js';
|
||||
import { Box } from 'ink';
|
||||
import { theme } from '../semantic-colors.js';
|
||||
import { AboutBox } from './AboutBox.js';
|
||||
import { StatsDisplay } from './StatsDisplay.js';
|
||||
import { ModelStatsDisplay } from './ModelStatsDisplay.js';
|
||||
@@ -97,27 +96,6 @@ export const HistoryItemDisplay: React.FC<HistoryItemDisplayProps> = ({
|
||||
color={itemForDisplay.color}
|
||||
/>
|
||||
)}
|
||||
{itemForDisplay.type === 'verbose' && (
|
||||
<InfoMessage
|
||||
text={itemForDisplay.text}
|
||||
icon={itemForDisplay.icon || 'ℹ '}
|
||||
color={theme.text.secondary}
|
||||
/>
|
||||
)}
|
||||
{itemForDisplay.type === 'debug' && (
|
||||
<InfoMessage
|
||||
text={itemForDisplay.text}
|
||||
icon={'⚙ '}
|
||||
color={theme.text.accent}
|
||||
/>
|
||||
)}
|
||||
{itemForDisplay.type === 'trace' && (
|
||||
<InfoMessage
|
||||
text={itemForDisplay.text}
|
||||
icon={'🔍 '}
|
||||
color={theme.text.accent}
|
||||
/>
|
||||
)}
|
||||
{itemForDisplay.type === 'warning' && (
|
||||
<WarningMessage text={itemForDisplay.text} />
|
||||
)}
|
||||
|
||||
@@ -14,7 +14,6 @@ import { useAlternateBuffer } from '../hooks/useAlternateBuffer.js';
|
||||
import { ToolCallStatus } from '../types.js';
|
||||
import { SHELL_COMMAND_NAME } from '../constants.js';
|
||||
import type { UIState } from '../contexts/UIStateContext.js';
|
||||
import type { HistoryItem } from '../types.js';
|
||||
|
||||
// Mock dependencies
|
||||
vi.mock('../contexts/AppContext.js', async () => {
|
||||
@@ -29,9 +28,6 @@ vi.mock('../contexts/AppContext.js', async () => {
|
||||
|
||||
const mockSettings = {
|
||||
merged: {
|
||||
output: {
|
||||
verbosity: 'info',
|
||||
},
|
||||
ui: {
|
||||
enableCompactToolOutput: false,
|
||||
},
|
||||
@@ -99,7 +95,6 @@ describe('MainContent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
vi.mocked(useAlternateBuffer).mockReturnValue(false);
|
||||
mockSettings.merged.output.verbosity = 'info';
|
||||
mockSettings.merged.ui.enableCompactToolOutput = false;
|
||||
});
|
||||
|
||||
@@ -248,38 +243,4 @@ describe('MainContent', () => {
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('filters out verbose items when verbosity is info', async () => {
|
||||
const history: HistoryItem[] = [
|
||||
{ id: 1, type: 'user', text: 'Visible User Message' },
|
||||
{ id: 2, type: 'verbose', text: 'Hidden Verbose Log' },
|
||||
];
|
||||
mockSettings.merged.output.verbosity = 'info';
|
||||
|
||||
const { lastFrame } = renderWithProviders(<MainContent />, {
|
||||
uiState: { ...defaultMockUiState, history } as Partial<UIState>,
|
||||
});
|
||||
await waitFor(() => expect(lastFrame()).toContain('AppHeader'));
|
||||
const output = lastFrame();
|
||||
|
||||
expect(output).toContain('Visible User Message');
|
||||
expect(output).not.toContain('Hidden Verbose Log');
|
||||
});
|
||||
|
||||
it('shows verbose items when verbosity is verbose', async () => {
|
||||
const history: HistoryItem[] = [
|
||||
{ id: 1, type: 'user', text: 'Visible User Message' },
|
||||
{ id: 2, type: 'verbose', text: 'Visible Verbose Log' },
|
||||
];
|
||||
mockSettings.merged.output.verbosity = 'verbose';
|
||||
|
||||
const { lastFrame } = renderWithProviders(<MainContent />, {
|
||||
uiState: { ...defaultMockUiState, history } as Partial<UIState>,
|
||||
});
|
||||
await waitFor(() => expect(lastFrame()).toContain('AppHeader'));
|
||||
const output = lastFrame();
|
||||
|
||||
expect(output).toContain('Visible User Message');
|
||||
expect(output).toContain('Visible Verbose Log');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -20,8 +20,6 @@ import { MAX_GEMINI_MESSAGE_LINES } from '../constants.js';
|
||||
import { useConfirmingTool } from '../hooks/useConfirmingTool.js';
|
||||
import { ToolConfirmationQueue } from './ToolConfirmationQueue.js';
|
||||
import { useConfig } from '../contexts/ConfigContext.js';
|
||||
import { VERBOSITY_MAPPING, Verbosity } from '../types.js';
|
||||
import { useSettings } from '../contexts/SettingsContext.js';
|
||||
|
||||
const MemoizedHistoryItemDisplay = memo(HistoryItemDisplay);
|
||||
const MemoizedAppHeader = memo(AppHeader);
|
||||
@@ -34,7 +32,6 @@ export const MainContent = () => {
|
||||
const { version } = useAppContext();
|
||||
const uiState = useUIState();
|
||||
const config = useConfig();
|
||||
const settings = useSettings();
|
||||
const isAlternateBuffer = useAlternateBuffer();
|
||||
|
||||
const confirmingTool = useConfirmingTool();
|
||||
@@ -56,24 +53,9 @@ export const MainContent = () => {
|
||||
availableTerminalHeight,
|
||||
} = uiState;
|
||||
|
||||
const currentVerbosity =
|
||||
VERBOSITY_MAPPING[settings.merged.output?.verbosity ?? 'info'] ??
|
||||
Verbosity.INFO;
|
||||
|
||||
const filteredHistory = useMemo(
|
||||
() =>
|
||||
uiState.history.filter((item) => {
|
||||
const itemType = item.type;
|
||||
const itemVerbosity =
|
||||
item.verbosity ?? VERBOSITY_MAPPING[itemType] ?? Verbosity.INFO;
|
||||
return itemVerbosity <= currentVerbosity;
|
||||
}),
|
||||
[uiState.history, currentVerbosity],
|
||||
);
|
||||
|
||||
const historyItems = useMemo(
|
||||
() =>
|
||||
filteredHistory.map((h) => (
|
||||
uiState.history.map((h) => (
|
||||
<MemoizedHistoryItemDisplay
|
||||
terminalWidth={mainAreaWidth}
|
||||
availableTerminalHeight={staticAreaMaxItemHeight}
|
||||
@@ -85,7 +67,7 @@ export const MainContent = () => {
|
||||
/>
|
||||
)),
|
||||
[
|
||||
filteredHistory,
|
||||
uiState.history,
|
||||
mainAreaWidth,
|
||||
staticAreaMaxItemHeight,
|
||||
uiState.slashCommands,
|
||||
@@ -134,10 +116,10 @@ export const MainContent = () => {
|
||||
const virtualizedData = useMemo(
|
||||
() => [
|
||||
{ type: 'header' as const },
|
||||
...filteredHistory.map((item) => ({ type: 'history' as const, item })),
|
||||
...uiState.history.map((item) => ({ type: 'history' as const, item })),
|
||||
{ type: 'pending' as const },
|
||||
],
|
||||
[filteredHistory],
|
||||
[uiState.history],
|
||||
);
|
||||
|
||||
const renderItem = useCallback(
|
||||
|
||||
Reference in New Issue
Block a user