chore: cleanup

This commit is contained in:
Jack Wotherspoon
2026-02-16 13:22:46 -05:00
committed by Keith Guerin
parent bfcf4959ba
commit 97d397353c
6 changed files with 10 additions and 71 deletions

View File

@@ -10,61 +10,51 @@ export const ALL_ITEMS = [
{
id: 'cwd',
header: 'Path',
label: 'cwd',
description: 'Current directory path',
},
{
id: 'git-branch',
header: 'Branch',
label: 'git-branch',
description: 'Current git branch name',
},
{
id: 'sandbox-status',
header: '/docs',
label: 'sandbox-status',
description: 'Sandbox type and trust indicator',
},
{
id: 'model-name',
header: '/model',
label: 'model-name',
description: 'Current model identifier',
},
{
id: 'context-remaining',
header: 'Context',
label: 'context-remaining',
description: 'Percentage of context window remaining',
},
{
id: 'quota',
header: '/stats',
label: 'quota',
description: 'Remaining usage on daily limit',
},
{
id: 'memory-usage',
header: 'Memory',
label: 'memory-usage',
description: 'Node.js heap memory usage',
},
{
id: 'session-id',
header: 'Session',
label: 'session-id',
description: 'Unique identifier for the current session',
},
{
id: 'code-changes',
header: 'Diff',
label: 'code-changes',
description: 'Lines added/removed in the session',
},
{
id: 'token-count',
header: 'Tokens',
label: 'token-count',
description: 'Total tokens used in the session',
},
] as const;
@@ -74,7 +64,6 @@ export type FooterItemId = (typeof ALL_ITEMS)[number]['id'];
export interface FooterItem {
id: string;
header: string;
label: string;
description: string;
}

View File

@@ -558,7 +558,7 @@ describe('<Footer />', () => {
expect(output).toContain('/docs');
expect(output).toContain('/model');
// Data should be present
expect(output).toContain('main*');
expect(output).toContain('main');
expect(output).toContain('gemini-pro');
});

View File

@@ -59,32 +59,12 @@ const CwdIndicator: React.FC<CwdIndicatorProps> = ({
);
};
interface BranchIndicatorProps {
branchName: string;
showParentheses?: boolean;
color?: string;
}
const BranchIndicator: React.FC<BranchIndicatorProps> = ({
branchName,
showParentheses = true,
color = theme.text.primary,
}) => (
<Text color={color}>
{showParentheses ? `(${branchName}*)` : `${branchName}*`}
</Text>
);
interface SandboxIndicatorProps {
isTrustedFolder: boolean | undefined;
terminalWidth: number;
showDocsHint?: boolean;
}
const SandboxIndicator: React.FC<SandboxIndicatorProps> = ({
isTrustedFolder,
terminalWidth,
showDocsHint = false,
}) => {
if (isTrustedFolder === false) {
return <Text color={theme.status.warning}>untrusted</Text>;
@@ -108,14 +88,7 @@ const SandboxIndicator: React.FC<SandboxIndicatorProps> = ({
);
}
return (
<Text color={theme.status.error}>
no sandbox
{showDocsHint && terminalWidth >= 100 && (
<Text color={theme.text.secondary}> (see /docs)</Text>
)}
</Text>
);
return <Text color={theme.status.error}>no sandbox</Text>;
};
const CorgiIndicator: React.FC = () => (
@@ -128,16 +101,6 @@ const CorgiIndicator: React.FC = () => (
</Text>
);
interface ErrorIndicatorProps {
errorCount: number;
}
const ErrorIndicator: React.FC<ErrorIndicatorProps> = ({ errorCount }) => (
<Box flexDirection="row">
<ConsoleSummaryDisplay errorCount={errorCount} />
</Box>
);
function isFooterItemId(id: string): id is FooterItemId {
return ALL_ITEMS.some((i) => i.id === id);
}
@@ -252,18 +215,11 @@ export const Footer: React.FC = () => {
}
case 'git-branch': {
if (branchName) {
const str = `${branchName}*`;
addCol(
id,
header,
() => (
<BranchIndicator
branchName={branchName}
showParentheses={false}
color={itemColor}
/>
),
str.length,
() => <Text color={itemColor}>{branchName}</Text>,
branchName.length,
);
}
break;
@@ -279,12 +235,7 @@ export const Footer: React.FC = () => {
addCol(
id,
header,
() => (
<SandboxIndicator
isTrustedFolder={isTrustedFolder}
terminalWidth={terminalWidth}
/>
),
() => <SandboxIndicator isTrustedFolder={isTrustedFolder} />,
str.length,
);
break;
@@ -408,7 +359,7 @@ export const Footer: React.FC = () => {
addCol(
'error-count',
'',
() => <ErrorIndicator errorCount={errorCount} />,
() => <ConsoleSummaryDisplay errorCount={errorCount} />,
12,
true,
);

View File

@@ -135,7 +135,7 @@ describe('<FooterConfigDialog />', () => {
});
await waitFor(() => {
expect(lastFrame()).toContain('main*');
expect(lastFrame()).toContain('main');
});
});
@@ -157,7 +157,6 @@ describe('<FooterConfigDialog />', () => {
const output = lastFrame();
expect(output).toContain('Preview:');
expect(output).not.toContain('~/project/path');
expect(output).not.toContain('main*');
expect(output).not.toContain('docker');
expect(output).not.toContain('gemini-2.5-pro');
expect(output).not.toContain('1.2k left');

View File

@@ -182,7 +182,7 @@ export const FooterConfigDialog: React.FC<FooterConfigDialogProps> = ({
if (!item) return null;
return {
key: id,
label: item.id as string,
label: id,
description: item.description as string,
};
})
@@ -327,7 +327,7 @@ export const FooterConfigDialog: React.FC<FooterConfigDialogProps> = ({
},
'git-branch': {
header: 'Branch',
data: <Text color={getColor('git-branch', itemColor)}>main*</Text>,
data: <Text color={getColor('git-branch', itemColor)}>main</Text>,
},
'sandbox-status': {
header: '/docs',

View File

@@ -30,7 +30,7 @@ exports[`<FooterConfigDialog /> > renders correctly with default settings 1`] =
│ ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │
│ │ Preview: │ │
│ │ Path Branch /docs /model /stats │ │
│ │ ~/project/path main* docker gemini-2.5-pro daily 97% │ │
│ │ ~/project/path main docker gemini-2.5-pro daily 97% │ │
│ └────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ │
│ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯"