You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "me2seeks (via GitHub)" <gi...@apache.org> on 2026/09/03 04:24:15 UTC

[I] bug(cli): AskUserQuestion options hard-truncate at terminal width — long options unreadable [maka]

me2seeks opened a new issue, #4610:
URL: https://github.com/apache/maka/issues/4610

   ## Symptom
   
   When the agent asks a question via `AskUserQuestion` and an option's label + description exceeds the terminal width, the row is **hard-truncated at the right edge** — no wrapping, no ellipsis, no way to read the full text. Screenshot (2026-08-27): a protocol-compatibility question whose three options each ran ~2–3× the terminal width; every option ended mid-sentence (e.g. `…不动 epoch,远程旧 Host 场景不 break。代价:旧` ␄), so the choice had to be made on partial information.
   
   ## Root cause
   
   `UserQuestionOverlay.renderOptionRow` builds exactly one line per option:
   
   - `packages/cli/src/pi-tui-pickers.ts:624` — `renderOptionRow` concatenates `prefix + label + description` into a single string
   - `packages/cli/src/pi-tui-pickers.ts:629` — hands it to `formatPickerItemLine`
   - `packages/cli/src/pi-tui-pickers.ts:977` → `padLine` (`:983`) → `truncateToWidth(text, safeWidth, '')` — hard cut at width, empty overflow marker
   
   So option text past the terminal width is unrecoverable. The hint row (`↑↓ move · type to answer …`) tells the user how to navigate but offers no way to see the truncated content.
   
   ## Expected
   
   Long options should be fully readable. Candidate directions (pick one):
   
   1. **Wrap** option rows to the overlay width (continuation lines indented under the option body), growing the overlay height — the question card already varies in height per question.
   2. At minimum, truncate with an ellipsis marker and reveal the full text for the highlighted option (e.g. wrap only the active row, or a detail line under the list).
   
   Wrapping is preferred: the option body is the decision content, and `AskUserQuestion` options routinely carry long trade-off descriptions like the one in the screenshot.
   
   ## Repro
   
   Any `AskUserQuestion` with an option whose `label + description` exceeds the terminal width, e.g. a 160+-column option in an 80-column terminal.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [I] bug(cli): AskUserQuestion options hard-truncate at terminal width — long options unreadable [maka]

Posted by "me2seeks (via GitHub)" <gi...@apache.org>.
me2seeks closed issue #4610: bug(cli): AskUserQuestion options hard-truncate at terminal width — long options unreadable
URL: https://github.com/apache/maka/issues/4610


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org