From 81e977d8f2b842f482a3ee49883785011e31e736 Mon Sep 17 00:00:00 2001 From: roboomp Date: Fri, 17 Jul 2026 14:22:00 +0000 Subject: [PATCH] fix(tui): restored slash description wrapping Re-enabled wrapped descriptions for slash-command autocomplete while preserving the existing visual-row popup budget. Replaced the compact-row regression with an editor-level contract that proves long description tails remain visible. Fixes #5848 --- packages/tui/CHANGELOG.md | 4 ++++ packages/tui/src/components/editor.ts | 1 + packages/tui/test/editor.test.ts | 16 +++++----------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/packages/tui/CHANGELOG.md b/packages/tui/CHANGELOG.md index 2f1ae373c..79d49228f 100644 --- a/packages/tui/CHANGELOG.md +++ b/packages/tui/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Fixed + +- Restored wrapped descriptions in the slash-command autocomplete picker so long skill descriptions remain readable at normal terminal widths ([#5848](https://github.com/can1357/oh-my-pi/issues/5848)). + ## [17.0.2] - 2026-07-17 ### Added diff --git a/packages/tui/src/components/editor.ts b/packages/tui/src/components/editor.ts index 5736a3990..1f70134a7 100644 --- a/packages/tui/src/components/editor.ts +++ b/packages/tui/src/components/editor.ts @@ -31,6 +31,7 @@ const AUTOCOMPLETE_SELECT_LIST_LAYOUT: SelectListLayoutOptions = { const SLASH_COMMAND_SELECT_LIST_LAYOUT: SelectListLayoutOptions = { minPrimaryColumnWidth: 12, maxPrimaryColumnWidth: 32, + wrapDescription: true, overflowSearch: false, }; diff --git a/packages/tui/test/editor.test.ts b/packages/tui/test/editor.test.ts index 7c9db5292..91b6c5fed 100644 --- a/packages/tui/test/editor.test.ts +++ b/packages/tui/test/editor.test.ts @@ -320,17 +320,13 @@ describe("Editor component", () => { expect(editor.render(80).some(line => line.includes(CURSOR_MARKER))).toBe(true); }); - it("renders slash-command suggestions as compact item rows", async () => { + it("wraps long slash-command descriptions instead of dropping the tail", 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."; + "Plan and execute non-trivial architectural improvements to the codebase. Use this skill when you need to refactor existing systems."; editor.setAutocompleteProvider( new CombinedAutocompleteProvider( - Array.from({ length: 12 }, (_, i) => ({ - name: `cmd${i}`, - description: longDescription, - })), + [{ name: "improve-codebase-architecture", description: longDescription }], "/tmp", ), ); @@ -342,10 +338,8 @@ describe("Editor component", () => { await autocompleteUpdated; 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); + expect(rendered.some(line => line.includes("improve-codebase-architecture"))).toBe(true); + expect(rendered.join("\n")).toContain("refactor existing systems."); }); it("triggers file-reference autocomplete when typing at-sign", async () => {