The Open Framework for Building Agents
nit(eve): keep completed slash commands in TUI suggestions (#3940)
Ben Pankowe6c90d05787a
diff --git a/.changeset/keep-complete-command-suggestions.md b/.changeset/keep-complete-command-suggestions.mdnew file mode 100644index 000000000..bf0323425--- /dev/null+++ b/.changeset/keep-complete-command-suggestions.md@@ -0,0 +1,5 @@+---+"eve": patch+---++Keep slash-command suggestions visible after a command name is fully typed, so the matching command and its description remain visible alongside any inline argument hint.diff --git a/packages/eve/src/cli/dev/tui/command-typeahead.test.ts b/packages/eve/src/cli/dev/tui/command-typeahead.test.tsindex 69119fd0f..89a9c59bb 100644--- a/packages/eve/src/cli/dev/tui/command-typeahead.test.ts+++ b/packages/eve/src/cli/dev/tui/command-typeahead.test.ts@@ -99,7 +99,7 @@ describe("inlineCommandHint", () => {expect(inlineCommandHint(typeaheadFor(COMMANDS, "/model"))).toBe("[provider/model]");});- it("returns an empty string for a complete argument-less command (still collapses)", () => {+ it("returns an empty string for a complete argument-less command", () => {expect(inlineCommandHint(typeaheadFor(COMMANDS, "/help"))).toBe("");});diff --git a/packages/eve/src/cli/dev/tui/command-typeahead.ts b/packages/eve/src/cli/dev/tui/command-typeahead.tsindex ebb1dfa33..db23ab5e3 100644--- a/packages/eve/src/cli/dev/tui/command-typeahead.ts+++ b/packages/eve/src/cli/dev/tui/command-typeahead.ts@@ -101,12 +101,9 @@ export function typeaheadCompletion(spec: PromptCommandSpec): string {}/**- * When the draft is a complete command name or alias with exactly one match,- * the dropdown collapses into an inline hint trailing the prompt row. Returns- * the command's argument shape to paint dim after the input — an empty string- * for argument-less commands, which still collapse the list — or `undefined`- * when the list should render normally (partial draft, multiple matches, or a- * dismissed list).+ * When the draft is a complete command name or alias with exactly one match and+ * the list is not dismissed, return its argument shape to paint dim after the+ * input (an empty string when there is none). Returns `undefined` otherwise.*/export function inlineCommandHint(state: CommandTypeaheadState): string | undefined {if (state.dismissed || state.matches.length !== 1) return undefined;diff --git a/packages/eve/src/cli/dev/tui/terminal-renderer.test.ts b/packages/eve/src/cli/dev/tui/terminal-renderer.test.tsindex 830272da8..e54f3635d 100644--- a/packages/eve/src/cli/dev/tui/terminal-renderer.test.ts+++ b/packages/eve/src/cli/dev/tui/terminal-renderer.test.ts@@ -5055,18 +5055,15 @@ describe("TerminalRenderer command typeahead", () => {renderer.shutdown();});- it("collapses a complete command into an inline argument hint", async () => {+ it("keeps the suggestion visible for a complete command alongside its argument hint", async () => {const { screen, input, renderer } = makeRenderer();const prompt = renderer.readPrompt();input.type("/model");const snapshot = screen.snapshot();- // The prompt row carries the dim argument shape inline (the caret sits- // between the typed name and the hint)...- expect(snapshot).toContain("/model");+ expect(snapshot).toContain("│ /model");expect(snapshot).toContain("[provider/model]");- // ...and the dropdown (with its description column) is gone.- expect(snapshot).not.toContain("Choose a model, speed, and reasoning");+ expect(snapshot).toContain("Choose a model, speed, and reasoning");input.enter();expect(await prompt).toBe("/model");diff --git a/packages/eve/src/cli/dev/tui/terminal-renderer.ts b/packages/eve/src/cli/dev/tui/terminal-renderer.tsindex 570401058..982c410c9 100644--- a/packages/eve/src/cli/dev/tui/terminal-renderer.ts+++ b/packages/eve/src/cli/dev/tui/terminal-renderer.ts@@ -744,11 +744,7 @@ export class TerminalRenderer implements AgentTUIRenderer {if (this.#argumentTypeahead !== undefined) {return renderArgumentSuggestions(this.#argumentTypeahead, this.#theme, width);}- const inlineHint =- this.#typeahead === undefined ? undefined : inlineCommandHint(this.#typeahead);- return inlineHint === undefined &&- this.#typeahead !== undefined &&- isTypeaheadOpen(this.#typeahead)+ return this.#typeahead !== undefined && isTypeaheadOpen(this.#typeahead)? renderCommandSuggestions(this.#typeahead, this.#theme, width): [];}@@ -4550,9 +4546,8 @@ export class TerminalRenderer implements AgentTUIRenderer {if (queueRows.length > 0) rows.push(...queueRows, "");if (this.#inputActive) {- // A complete command name with a single match collapses the dropdown into- // a dim argument hint trailing the prompt; partial or ambiguous drafts- // still open the list above the input.+ // A complete command can show its argument hint beside the caret while+ // its matching suggestion remains visible beneath the prompt.const inlineHint =this.#typeahead !== undefined ? inlineCommandHint(this.#typeahead) : undefined;const typeaheadRows = this.#typeaheadDrawerRows(width);