diff --git a/src/app/HelpOverlay.tsx b/src/app/HelpOverlay.tsx index 80e4d1d..a16a434 100644 --- a/src/app/HelpOverlay.tsx +++ b/src/app/HelpOverlay.tsx @@ -1,4 +1,5 @@ import {Box, Text} from 'ink'; +import {commandNames} from '../commands/catalog.js'; import type {ChatTheme} from '../ui/theme.js'; export const HelpOverlay = ({theme}: {theme: ChatTheme}) => ( @@ -19,8 +20,7 @@ export const HelpOverlay = ({theme}: {theme: ChatTheme}) => ( Ctrl+G toggle this reference Ctrl+C cancel or quit - Slash commands: /help /new /title /system /model /save /load /export /retry /regenerate /theme - /quit + Slash commands: {commandNames.map((name) => `/${name}`).join(' ')} ); diff --git a/tests/ui.test.tsx b/tests/ui.test.tsx index 7d9758e..a17d698 100644 --- a/tests/ui.test.tsx +++ b/tests/ui.test.tsx @@ -1,6 +1,8 @@ import React from 'react'; import {render} from 'ink-testing-library'; import {describe, expect, it} from 'vitest'; +import {HelpOverlay} from '../src/app/HelpOverlay.js'; +import {commandNames} from '../src/commands/index.js'; import {createMessage} from '../src/model/index.js'; import {MessageBubble} from '../src/ui/MessageBubble.js'; import {relayTheme} from '../src/ui/theme.js'; @@ -17,4 +19,10 @@ describe('terminal message rendering', () => { expect(view.lastFrame()).toContain('local-model ยท 1.2s'); expect(view.lastFrame()).toContain('const x = 1;'); }); + + it('lists every slash command in the help overlay', () => { + const view = render(); + const frame = (view.lastFrame() ?? '').replace(/\s+/g, ' '); + for (const name of commandNames) expect(frame).toContain(`/${name}`); + }); });