Skip to content

Commit 72f0386

Browse files
igorcostaAutohand Evolve
andcommitted
Allow slash autocomplete during queued input
Co-authored-by: Autohand Evolve <code-noreply@autohand.ai>
1 parent 93e5b01 commit 72f0386

2 files changed

Lines changed: 33 additions & 1 deletion

File tree

src/ui/ink/AgentUI.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1581,7 +1581,7 @@ export function AgentUI({
15811581
<SlashCommandDropdown
15821582
suggestions={slashSuggestions}
15831583
activeIndex={slashActiveIndex}
1584-
visible={slashVisible && !state.isWorking}
1584+
visible={slashVisible && enableQueueInput}
15851585
/>
15861586
}
15871587
inputWidth={inputWidth}

tests/ui/ink/AgentUI.test.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,38 @@ describe('AgentUI composer suggestions', () => {
350350
expect(frame).toContain('Tab to accept');
351351
});
352352

353+
it('renders slash command suggestions while the assistant is working', async () => {
354+
const state = {
355+
...createInitialUIState(),
356+
isWorking: true,
357+
status: 'Crunching...',
358+
};
359+
const { lastFrame, stdin } = render(
360+
React.createElement(
361+
I18nProvider,
362+
null,
363+
React.createElement(
364+
ThemeProvider,
365+
null,
366+
React.createElement(AgentUI, {
367+
state,
368+
onInstruction: () => {},
369+
onEscape: () => {},
370+
onCtrlC: () => {},
371+
slashCommands,
372+
})
373+
)
374+
)
375+
);
376+
377+
stdin.write('/');
378+
await new Promise<void>((resolve) => setTimeout(resolve, 50));
379+
380+
const frame = stripAnsi(lastFrame() ?? '');
381+
expect(frame).toContain('/help');
382+
expect(frame).toContain('Tab to accept');
383+
});
384+
353385
it('renders only the next shell command suggestion for git input in the Ink composer', async () => {
354386
const state = {
355387
...createInitialUIState(),

0 commit comments

Comments
 (0)