mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-18 01:51:20 -07:00
This commit introduces a new, more stable footer architecture that addresses several long-standing UX issues: - Stabilizes the layout by anchoring mode indicators and context summaries - Protects safety indicators (YOLO/Plan) from being hidden by notifications - Decouples ambient tips/wit from real system status to prevent confusion - Implements intelligent collision detection for narrow terminal windows - Keeps input visible but disabled during tool approval pauses - Enhances visual consistency with unified status colors and hook icons
57 lines
1.7 KiB
TypeScript
57 lines
1.7 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright 2025 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import type React from 'react';
|
|
import { Text } from 'ink';
|
|
import { theme } from '../semantic-colors.js';
|
|
import { useUIState } from '../contexts/UIStateContext.js';
|
|
import { useSettings } from '../contexts/SettingsContext.js';
|
|
import { useConfig } from '../contexts/ConfigContext.js';
|
|
import { ContextSummaryDisplay } from './ContextSummaryDisplay.js';
|
|
import { HookStatusDisplay } from './HookStatusDisplay.js';
|
|
|
|
interface StatusDisplayProps {
|
|
hideContextSummary: boolean;
|
|
}
|
|
|
|
export const StatusDisplay: React.FC<StatusDisplayProps> = ({
|
|
hideContextSummary,
|
|
}) => {
|
|
const uiState = useUIState();
|
|
const settings = useSettings();
|
|
const config = useConfig();
|
|
|
|
if (process.env['GEMINI_SYSTEM_MD']) {
|
|
return <Text color={theme.status.error}>|⌐■_■|</Text>;
|
|
}
|
|
|
|
if (
|
|
settings.merged.ui.newFooterLayout === 'legacy' &&
|
|
uiState.activeHooks.length > 0 &&
|
|
settings.merged.hooksConfig.notifications
|
|
) {
|
|
return <HookStatusDisplay activeHooks={uiState.activeHooks} />;
|
|
}
|
|
|
|
if (!settings.merged.ui.hideContextSummary && !hideContextSummary) {
|
|
return (
|
|
<ContextSummaryDisplay
|
|
ideContext={uiState.ideContextState}
|
|
geminiMdFileCount={uiState.geminiMdFileCount}
|
|
contextFileNames={uiState.contextFileNames}
|
|
mcpServers={config.getMcpClientManager()?.getMcpServers() ?? {}}
|
|
blockedMcpServers={
|
|
config.getMcpClientManager()?.getBlockedMcpServers() ?? []
|
|
}
|
|
skillCount={config.getSkillManager().getDisplayableSkills().length}
|
|
backgroundProcessCount={uiState.backgroundShellCount}
|
|
/>
|
|
);
|
|
}
|
|
|
|
return null;
|
|
};
|