fix(tui): dynamically expand DialogModel size based on terminal width by hazyhaar · Pull Request #47599 · anomalyco/opencode · GitHub
Skip to content

fix(tui): dynamically expand DialogModel size based on terminal width - #47599

Open
hazyhaar wants to merge 1 commit into
anomalyco:devfrom
hazyhaar:fix/tui-dialog-model-width
Open

fix(tui): dynamically expand DialogModel size based on terminal width#47599
hazyhaar wants to merge 1 commit into
anomalyco:devfrom
hazyhaar:fix/tui-dialog-model-width

Conversation

@hazyhaar

@hazyhaar hazyhaar commented Sep 6, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #47600

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

In the TUI, DialogModel currently defaults to size: "medium" (60 columns) because it does not set its size. On wide terminals, this causes the model name to be heavily truncated whenever the provider footer takes up 35+ columns.

This PR adds responsive sizing via useTerminalDimensions() and createEffect(), matching the sizing behavior in packages/tui/src/feature-plugins/system/plugins.tsx:

  • xlarge (116 columns) when terminal width >= 128
  • large (88 columns) when terminal width >= 96
  • medium (60 columns) as baseline

How did you verify your code works?

Verified in TUI with terminal widths of 80, 100, 140, and 180 columns. The dialog expands dynamically and preserves the full visibility of model names and provider footers without truncation.

Screenshots / recordings

Before: model names truncated to ~16 chars.
After: dialog dynamically uses large/xlarge width when terminal allows, showing full model identifiers and footers.

Checklist

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

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot removed needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

@hazyhaar
hazyhaar force-pushed the fix/tui-dialog-model-width branch from 3b5f2d7 to 0a7c21d Compare September 6, 2026 10:31
@hazyhaar
hazyhaar force-pushed the fix/tui-dialog-model-width branch from 0a7c21d to 5de7f62 Compare September 6, 2026 11:10
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.

TUI: DialogModel is too narrow and truncates model names

1 participant