ui: update footer labels to lowercase and 'workspace (/directory)'

This commit is contained in:
Keith Guerin
2026-02-28 23:47:22 -08:00
parent 32e01f723a
commit ea965bc149
7 changed files with 43 additions and 44 deletions

View File

@@ -9,17 +9,17 @@ import type { MergedSettings } from './settings.js';
export const ALL_ITEMS = [
{
id: 'cwd',
header: 'Path',
header: 'workspace (/directory)',
description: 'Current working directory',
},
{
id: 'git-branch',
header: 'Branch',
header: 'branch',
description: 'Current git branch name (not shown when unavailable)',
},
{
id: 'sandbox-status',
header: '/docs',
header: 'sandbox',
description: 'Sandbox type and trust indicator',
},
{
@@ -29,7 +29,7 @@ export const ALL_ITEMS = [
},
{
id: 'context-remaining',
header: 'Context',
header: 'context',
description: 'Percentage of context window remaining',
},
{
@@ -39,22 +39,22 @@ export const ALL_ITEMS = [
},
{
id: 'memory-usage',
header: 'Memory',
header: 'memory',
description: 'Memory used by the application',
},
{
id: 'session-id',
header: 'Session',
header: 'session',
description: 'Unique identifier for the current session',
},
{
id: 'code-changes',
header: 'Diff',
header: 'diff',
description: 'Lines added/removed in the session (not shown when zero)',
},
{
id: 'token-count',
header: 'Tokens',
header: 'tokens',
description: 'Total tokens used in the session (not shown when zero)',
},
] as const;

View File

@@ -598,8 +598,7 @@ const SETTINGS_SCHEMA = {
category: 'UI',
requiresRestart: false,
default: false,
description:
'Hide the current working directory path in the footer.',
description: 'Hide the current working directory in the footer.',
showInDialog: true,
},
hideSandboxStatus: {

View File

@@ -622,7 +622,7 @@ describe('<Footer />', () => {
const output = lastFrame();
const modelIdx = output.indexOf('/model');
const cwdIdx = output.indexOf('Path');
const cwdIdx = output.indexOf('workspace (/directory)');
expect(modelIdx).toBeLessThan(cwdIdx);
unmount();
});
@@ -653,9 +653,9 @@ describe('<Footer />', () => {
const output = lastFrame();
expect(output).toBeDefined();
// Headers should be present
expect(output).toContain('Path');
expect(output).toContain('Branch');
expect(output).toContain('/docs');
expect(output).toContain('workspace (/directory)');
expect(output).toContain('branch');
expect(output).toContain('sandbox');
expect(output).toContain('/model');
// Data should be present
expect(output).toContain('main');
@@ -708,8 +708,8 @@ describe('<Footer />', () => {
const output = lastFrame();
expect(output).toBeDefined();
expect(output).not.toContain('Branch');
expect(output).toContain('Path');
expect(output).not.toContain('branch');
expect(output).toContain('workspace (/directory)');
expect(output).toContain('/model');
unmount();
});

View File

@@ -46,7 +46,7 @@ describe('<FooterConfigDialog />', () => {
});
await waitFor(() => {
expect(lastFrame()).toContain('[ ] cwd');
expect(lastFrame()).toContain('[ ] workspace (/directory)');
});
act(() => {
@@ -54,7 +54,7 @@ describe('<FooterConfigDialog />', () => {
});
await waitFor(() => {
expect(lastFrame()).toContain('[✓] cwd');
expect(lastFrame()).toContain('[✓] workspace (/directory)');
});
});
@@ -66,23 +66,23 @@ describe('<FooterConfigDialog />', () => {
);
await waitUntilReady();
// Initial order: cwd, git-branch, ...
// Initial order: workspace (/directory), branch, ...
const output = lastFrame();
const cwdIdx = output!.indexOf('] cwd');
const branchIdx = output!.indexOf('] git-branch');
const cwdIdx = output.indexOf('] workspace (/directory)');
const branchIdx = output.indexOf('] branch');
expect(cwdIdx).toBeGreaterThan(-1);
expect(branchIdx).toBeGreaterThan(-1);
expect(cwdIdx).toBeLessThan(branchIdx);
// Move cwd down (right arrow)
// Move workspace (/directory) down (right arrow)
act(() => {
stdin.write('\u001b[C'); // Right arrow
});
await waitFor(() => {
const outputAfter = lastFrame();
const cwdIdxAfter = outputAfter!.indexOf('] cwd');
const branchIdxAfter = outputAfter!.indexOf('] git-branch');
const cwdIdxAfter = outputAfter.indexOf('] workspace (/directory)');
const branchIdxAfter = outputAfter.indexOf('] branch');
expect(cwdIdxAfter).toBeGreaterThan(-1);
expect(branchIdxAfter).toBeGreaterThan(-1);
expect(branchIdxAfter).toBeLessThan(cwdIdxAfter);

View File

@@ -146,7 +146,7 @@ export const FooterConfigDialog: React.FC<FooterConfigDialogProps> = ({
if (!item) return null;
return {
key: id,
label: id,
label: item.header,
description: item.description as string,
};
})

View File

@@ -1,31 +1,31 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`<Footer /> > displays "Limit reached" message when remaining is 0 1`] = `
" Path /docs /model /stats
" workspace (/directory) sandbox /model /stats
~/project/foo/bar/and/some/more/directories/to/make/it/long no sandbox gemini-pro limit reached
"
`;
exports[`<Footer /> > displays the usage indicator when usage is low 1`] = `
" Path /docs /model /stats
" workspace (/directory) sandbox /model /stats
~/project/foo/bar/and/some/more/directories/to/make/it/long no sandbox gemini-pro daily 15%
"
`;
exports[`<Footer /> > footer configuration filtering (golden snapshots) > renders complete footer in narrow terminal (baseline narrow) > complete-footer-narrow 1`] = `
" Path /docs /model Context
" workspace (/directory) sandbox /model context
~/.../more/directories/to/make/it/long no sandbox gemini-pro 86%
"
`;
exports[`<Footer /> > footer configuration filtering (golden snapshots) > renders complete footer with all sections visible (baseline) > complete-footer-wide 1`] = `
" Path /docs /model Context
" workspace (/directory) sandbox /model context
~/project/foo/bar/and/some/more/directories/to/make/it/long no sandbox gemini-pro 86% left
"
`;
exports[`<Footer /> > footer configuration filtering (golden snapshots) > renders footer with CWD and model info hidden to test alignment (only sandbox visible) > footer-only-sandbox 1`] = `
" /docs
" sandbox
no sandbox
"
`;
@@ -33,13 +33,13 @@ exports[`<Footer /> > footer configuration filtering (golden snapshots) > render
exports[`<Footer /> > footer configuration filtering (golden snapshots) > renders footer with all optional sections hidden (minimal footer) > footer-minimal 1`] = `""`;
exports[`<Footer /> > footer configuration filtering (golden snapshots) > renders footer with only model info hidden (partial filtering) > footer-no-model 1`] = `
" Path /docs
" workspace (/directory) sandbox
~/project/foo/bar/and/some/more/directories/to/make/it/long no sandbox
"
`;
exports[`<Footer /> > hides the usage indicator when usage is not near limit 1`] = `
" Path /docs /model /stats
" workspace (/directory) sandbox /model /stats
~/project/foo/bar/and/some/more/directories/to/make/it/long no sandbox gemini-pro daily 85%
"
`;

View File

@@ -7,16 +7,16 @@ exports[`<FooterConfigDialog /> > renders correctly with default settings 1`] =
│ │
│ Select which items to display in the footer. │
│ │
│ > [✓] cwd Current working directory
│ [✓] git-branch Current git branch name (not shown when unavailable)
│ [✓] sandbox-status Sandbox type and trust indicator
│ [✓] model-name Current model identifier
│ [✓] usage-limit Remaining usage on daily limit (not shown when unavailable)
│ [ ] context-remaining Percentage of context window remaining
│ [ ] memory-usage Memory used by the application
│ [ ] session-id Unique identifier for the current session
│ [ ] code-changes Lines added/removed in the session (not shown when zero)
│ [ ] token-count Total tokens used in the session (not shown when zero)
│ > [✓] workspace (/directory) Current working directory │
│ [✓] branch Current git branch name (not shown when unavailable) │
│ [✓] sandbox Sandbox type and trust indicator │
│ [✓] /model Current model identifier │
│ [✓] /stats Remaining usage on daily limit (not shown when unavailable) │
│ [ ] context Percentage of context window remaining │
│ [ ] memory Memory used by the application │
│ [ ] session Unique identifier for the current session │
│ [ ] diff Lines added/removed in the session (not shown when zero) │
│ [ ] tokens Total tokens used in the session (not shown when zero) │
│ │
│ [✓] Show footer labels │
│ Reset to default footer │
@@ -25,8 +25,8 @@ exports[`<FooterConfigDialog /> > renders correctly with default settings 1`] =
│ │
│ ┌────────────────────────────────────────────────────────────────────────────────────────────┐ │
│ │ Preview: │ │
│ │ Path Branch /docs /model /stats │ │
│ │ ~/project/path main docker gemini-2.5-pro daily 97% │ │
│ │ workspace (/directory) branch sandbox /model /stats │ │
│ │ ~/project/path main docker gemini-2.5-pro daily 97% │ │
│ └────────────────────────────────────────────────────────────────────────────────────────────┘ │
│ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯