Skip to content

fix(tui): wrap model modalities - #61618

Open
exunknown wants to merge 1 commit into
anomalyco:devfrom
exunknown:model-tooltip-fix
Open

exunknown wants to merge 1 commit into
anomalyco:devfrom
exunknown:model-tooltip-fix

Conversation

@exunknown

@exunknown exunknown commented Nov 4, 2026 •

Copy link
Copy Markdown

Issue for this PR

Fixes #61594

Type of change

  • Bug fix

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.
  • Targeted lint, ast-grep, and SDK docs checks also pass. The root bun run check was attempted, but oxlint hit the Windows fixed-size allocator OOM in this environment.

Screenshots / recordings

Before:Before

After, the rendered detail wraps as:

Text, Image, PDF
Audio, Video
1M · Reasoning

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 from packages/app/src/providers/models/details.tsx: summary() uses Intl.ListFormat(language.intl(), { style: "short", type: "unit" }), which puts no separator between items for zh-Hans, and zh.ts has no model.details.* strings. This PR doesn't touch packages/app, so the reported bug is still there. Please drop Fixes #61594, or fix it in details.tsx (for example type: "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).

Before

After

const value = price()
return value ? [value === "Free" ? value : `${value} per 1M`] : []
}
const modalityRows = () =>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Model picker tooltip glues modality names together and cuts off

1 participant