Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/app/HelpOverlay.tsx
Original file line number Diff line number Diff line change
@@ -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}) => (
Expand All @@ -19,8 +20,7 @@ export const HelpOverlay = ({theme}: {theme: ChatTheme}) => (
<Text color={theme.text}>Ctrl+G toggle this reference</Text>
<Text color={theme.text}>Ctrl+C cancel or quit</Text>
<Text color={theme.muted}>
Slash commands: /help /new /title /system /model /save /load /export /retry /regenerate /theme
/quit
Slash commands: {commandNames.map((name) => `/${name}`).join(' ')}
</Text>
</Box>
);
8 changes: 8 additions & 0 deletions tests/ui.test.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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(<HelpOverlay theme={relayTheme} />);
const frame = (view.lastFrame() ?? '').replace(/\s+/g, ' ');
for (const name of commandNames) expect(frame).toContain(`/${name}`);
});
});
Loading