diff --git a/packages/cli/src/ui/components/FooterConfigDialog.test.tsx b/packages/cli/src/ui/components/FooterConfigDialog.test.tsx index c97b62d4b4..07dc6a7859 100644 --- a/packages/cli/src/ui/components/FooterConfigDialog.test.tsx +++ b/packages/cli/src/ui/components/FooterConfigDialog.test.tsx @@ -22,23 +22,25 @@ describe('', () => { vi.restoreAllMocks(); }); - it('renders correctly with default settings', () => { + it('renders correctly with default settings', async () => { const settings = createMockSettings(); - const { lastFrame } = renderWithProviders( + const { lastFrame, waitUntilReady } = renderWithProviders( , { settings }, ); + await waitUntilReady(); expect(lastFrame()).toMatchSnapshot(); }); it('toggles an item when enter is pressed', async () => { const settings = createMockSettings(); - const { lastFrame, stdin } = renderWithProviders( + const { lastFrame, stdin, waitUntilReady } = renderWithProviders( , { settings }, ); + await waitUntilReady(); act(() => { stdin.write('\r'); // Enter to toggle }); @@ -58,11 +60,12 @@ describe('', () => { it('reorders items with arrow keys', async () => { const settings = createMockSettings(); - const { lastFrame, stdin } = renderWithProviders( + const { lastFrame, stdin, waitUntilReady } = renderWithProviders( , { settings }, ); + await waitUntilReady(); // Initial order: cwd, git-branch, ... const output = lastFrame(); const cwdIdx = output!.indexOf('] cwd'); @@ -88,11 +91,12 @@ describe('', () => { it('closes on Esc', async () => { const settings = createMockSettings(); - const { stdin } = renderWithProviders( + const { stdin, waitUntilReady } = renderWithProviders( , { settings }, ); + await waitUntilReady(); act(() => { stdin.write('\x1b'); // Esc }); @@ -104,11 +108,12 @@ describe('', () => { it('highlights the active item in the preview', async () => { const settings = createMockSettings(); - const { lastFrame, stdin } = renderWithProviders( + const { lastFrame, stdin, waitUntilReady } = renderWithProviders( , { settings }, ); + await waitUntilReady(); expect(lastFrame()).toContain('~/project/path'); // Move focus down to 'git-branch' @@ -123,11 +128,12 @@ describe('', () => { it('shows an empty preview when all items are deselected', async () => { const settings = createMockSettings(); - const { lastFrame, stdin } = renderWithProviders( + const { lastFrame, stdin, waitUntilReady } = renderWithProviders( , { settings }, ); + await waitUntilReady(); for (let i = 0; i < 10; i++) { act(() => { stdin.write('\r'); // Toggle (deselect) diff --git a/packages/cli/src/ui/components/FooterConfigDialog.tsx b/packages/cli/src/ui/components/FooterConfigDialog.tsx index a5e6311e87..d3995fb56e 100644 --- a/packages/cli/src/ui/components/FooterConfigDialog.tsx +++ b/packages/cli/src/ui/components/FooterConfigDialog.tsx @@ -224,7 +224,7 @@ export const FooterConfigDialog: React.FC = ({ return true; } - if (keyMatchers[Command.RETURN](key)) { + if (keyMatchers[Command.RETURN](key) || key.name === 'space') { if (isResetFocused) { handleResetToDefaults(); } else if (isShowLabelsFocused) { @@ -378,7 +378,7 @@ export const FooterConfigDialog: React.FC = ({ - ↑/↓ navigate · ←/→ reorder · enter select · esc close + ↑/↓ navigate · ←/→ reorder · enter/space select · esc close diff --git a/packages/cli/src/ui/components/__snapshots__/FooterConfigDialog.test.tsx.snap b/packages/cli/src/ui/components/__snapshots__/FooterConfigDialog.test.tsx.snap index b9ab209f14..85f03e8786 100644 --- a/packages/cli/src/ui/components/__snapshots__/FooterConfigDialog.test.tsx.snap +++ b/packages/cli/src/ui/components/__snapshots__/FooterConfigDialog.test.tsx.snap @@ -1,33 +1,34 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[` > renders correctly with default settings 1`] = ` -"╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ -│ │ -│ Configure Footer │ -│ │ -│ 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) │ -│ │ -│ [✓] Show footer labels │ -│ Reset to default footer │ -│ │ -│ ↑/↓ navigate · ←/→ reorder · enter select · esc close │ -│ │ -│ ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ -│ │ Preview: │ │ -│ │ Path Branch /docs /model /stats │ │ -│ │ ~/project/path main docker gemini-2.5-pro daily 97% │ │ -│ └────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ │ -│ │ -╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯" +"╭──────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ │ +│ Configure Footer │ +│ │ +│ 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) │ +│ │ +│ [✓] Show footer labels │ +│ Reset to default footer │ +│ │ +│ ↑/↓ navigate · ←/→ reorder · enter/space select · esc close │ +│ │ +│ ┌────────────────────────────────────────────────────────────────────────────────────────────┐ │ +│ │ Preview: │ │ +│ │ Path Branch /docs /model /stats │ │ +│ │ ~/project/path main docker gemini-2.5-pro daily 97% │ │ +│ └────────────────────────────────────────────────────────────────────────────────────────────┘ │ +│ │ +╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ +" `;