diff --git a/packages/tui/CHANGELOG.md b/packages/tui/CHANGELOG.md index 720b75673..b9a98c390 100644 --- a/packages/tui/CHANGELOG.md +++ b/packages/tui/CHANGELOG.md @@ -18,6 +18,7 @@ - Fixed autocompletion for absolute paths (such as `/tmp/...` or `/Users/...`) at the start of a prompt, ensuring they fall back to file-path completion instead of being incorrectly treated as slash commands. - Updated absolute path autocompletion behavior so that accepting a suggestion inserts the path without submitting the prompt. +- Kept slash command autocomplete rows compact by truncating descriptions instead of wrapping them into multi-line blocks. ## [16.3.7] - 2026-07-05 diff --git a/packages/tui/src/components/editor.ts b/packages/tui/src/components/editor.ts index 8a631d790..8ae6a52f9 100644 --- a/packages/tui/src/components/editor.ts +++ b/packages/tui/src/components/editor.ts @@ -31,7 +31,6 @@ const SLASH_COMMAND_SELECT_LIST_LAYOUT: SelectListLayoutOptions = { minPrimaryColumnWidth: 12, maxPrimaryColumnWidth: 32, overflowSearch: false, - wrapDescription: true, }; function sanitizeLoadedText(text: string): string { diff --git a/packages/tui/test/editor.test.ts b/packages/tui/test/editor.test.ts index d451c758e..da3f0f7d3 100644 --- a/packages/tui/test/editor.test.ts +++ b/packages/tui/test/editor.test.ts @@ -309,6 +309,31 @@ describe("Editor component", () => { await expect(promise).resolves.toBe("/"); }); + it("renders slash-command suggestions as compact item rows", async () => { + const editor = new Editor(defaultEditorTheme); + editor.setAutocompleteMaxVisible(10); + const longDescription = + "Plan and execute non-trivial architectural improvements to the codebase without turning each slash command into a multi-line block."; + editor.setAutocompleteProvider( + new CombinedAutocompleteProvider( + Array.from({ length: 12 }, (_, i) => ({ + name: `cmd${i}`, + description: longDescription, + })), + "/tmp", + ), + ); + + editor.handleInput("/"); + await Bun.sleep(0); + + const rendered = editor.render(80).map(line => stripVTControlCharacters(line)); + for (let i = 0; i < 10; i += 1) { + expect(rendered.some(line => line.includes(`cmd${i}`))).toBe(true); + } + expect(rendered.some(line => line.includes("cmd10"))).toBe(false); + }); + it("triggers file-reference autocomplete when typing at-sign", async () => { const editor = new Editor(defaultEditorTheme); const { promise, resolve } = Promise.withResolvers();