Repository navigation
Conversation
There was a problem hiding this comment.
This fixes truncation of the TUI model picker's detail line in narrow terminals, but it doesn't fix #61594, and it adds a layout regression.
I ran both checkouts with opencode-drive at 56 columns, using a model with five input modalities. On the base, the line is cut to Text, Image, PDF, Audio, Video · 1M · Reasonin. With this PR it splits into three rows (screenshots below). The added tests pass, and tsc -b is clean.
Public API: unchanged.
- #61594 is a different bug. It's about the desktop/web app's model picker tooltip, not the TUI. The issue's
TextImagePDFAudioVideoTo…comes frompackages/app/src/providers/models/details.tsx:summary()usesIntl.ListFormat(language.intl(), { style: "short", type: "unit" }), which puts no separator between items forzh-Hans, andzh.tshas nomodel.details.*strings. This PR doesn't touchpackages/app, so the reported bug is still there. Please dropFixes #61594, or fix it indetails.tsx(for exampletype: "conjunction"or an explicit separator) in its own PR. The "before" in the description is the desktop screenshot, not the TUI. - Fixed 3-per-row split. It wraps on every terminal width and changes the detail area's height from model to model (see inline comment).
| const value = price() | ||
| return value ? [value === "Free" ? value : `${value} per 1M`] : [] | ||
| } | ||
| const modalityRows = () => |
There was a problem hiding this comment.
This always splits after three modalities, whatever the terminal width. At 100 columns the old single line fit (Text, Image, PDF, Audio, Video · 1M · Reasoning), but it now takes three rows. Because the row count depends on the model, the detail area also changes height as the selection moves: a text-only model gives 1 row, a five-modality model gives 3. dialog-select.tsx reserves the detail area so that "the dialog does not resize as the selection moves", and this breaks that: the dialog jumps when you arrow between models. Could the line wrap based on the available width instead (for example, let the facts <text> wrap rather than wrapMode="none"), or keep a fixed number of rows?


Issue for this PR
Fixes #61594
Type of change
What does this PR do?
The model detail line previously joined every input modality into one no-wrap line, which narrow terminals truncated into an unreadable string. Modalities are now grouped three per line, with context/reasoning kept on a separate line.
How did you verify your code works?
cd packages/tui && bun test test/cli/cmd/tui/model-options.test.ts test/cli/tui/dialog-select.test.tsx test/cli/tui/model-detail.test.tsx— 47 pass.cd packages/tui && bun check -b --threads=1— no type errors.bun run checkwas attempted, butoxlinthit the Windows fixed-size allocator OOM in this environment.Screenshots / recordings
Before:
After, the rendered detail wraps as:
Checklist