Refactor: Improve console error/log display in CLI (#486)

This commit is contained in:
Jacob Richman 2025-05-22 10:36:44 -07:00 committed by GitHub
parent fb1d13d600
commit 7eaf850489
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 218 additions and 88 deletions

View file

@ -8,6 +8,7 @@ import React from 'react';
import { Box, Text } from 'ink';
import { Colors } from '../colors.js';
import { shortenPath, tildeifyPath, Config } from '@gemini-code/server';
import { ConsoleSummaryDisplay } from './ConsoleSummaryDisplay.js';
interface FooterProps {
config: Config;
@ -15,6 +16,8 @@ interface FooterProps {
debugMessage: string;
cliVersion: string;
corgiMode: boolean;
errorCount: number;
showErrorDetails: boolean;
}
export const Footer: React.FC<FooterProps> = ({
@ -23,8 +26,10 @@ export const Footer: React.FC<FooterProps> = ({
debugMessage,
cliVersion,
corgiMode,
errorCount,
showErrorDetails,
}) => (
<Box marginTop={1}>
<Box marginTop={1} justifyContent="space-between" width="100%">
<Box>
<Text color={Colors.LightBlue}>
{shortenPath(tildeifyPath(config.getTargetDir()), 70)}
@ -56,8 +61,8 @@ export const Footer: React.FC<FooterProps> = ({
)}
</Box>
{/* Right Section: Gemini Label */}
<Box>
{/* Right Section: Gemini Label and Console Summary */}
<Box alignItems="center">
<Text color={Colors.AccentBlue}> {config.getModel()} </Text>
<Text color={Colors.SubtleComment}>| CLI {cliVersion} </Text>
{corgiMode && (
@ -70,6 +75,12 @@ export const Footer: React.FC<FooterProps> = ({
<Text color={Colors.AccentRed}> </Text>
</Text>
)}
{!showErrorDetails && errorCount > 0 && (
<Box>
<Text color={Colors.SubtleComment}>| </Text>
<ConsoleSummaryDisplay errorCount={errorCount} />
</Box>
)}
</Box>
</Box>
);