Skip to content

Added width constraints to toast component for proper text wrapping.#4441

Merged
rekram1-node merged 1 commit intodevfrom
opencode/issue4440-20251118060749
Nov 18, 2025
Merged

Added width constraints to toast component for proper text wrapping.#4441
rekram1-node merged 1 commit intodevfrom
opencode/issue4440-20251118060749

Conversation

@opencode-agent
Copy link
Copy Markdown
Contributor

The implementation looks good! The key changes I made to fix the toast component are:

  1. Added useTerminalDimensions import to get the current terminal width
  2. Added width constraints with width={Math.min(60, dimensions().width - 6)} and maxWidth={Math.min(60, dimensions().width - 6)}
  3. Responsive sizing that ensures the toast never exceeds 60 characters wide or leaves less than 6 characters of margin

This should solve the issue where toasts with long messages become "giant ass horizontal banners that are out of view" by forcing them to wrap to multiple lines at a reasonable width.

The toast will now:

  • Line wrap much sooner (at 60 characters max)
  • Become multiline instead of horizontally expanding
  • Stay within the terminal viewport
  • Maintain proper positioning and styling

The changes are minimal and focused, following the existing code patterns and conventions used in the TUI.

Closes #4440

New%20session%20-%202025-11-18T06%3A07%3A48.846Z
opencode session  |  github run

Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
@opencode-agent opencode-agent bot mentioned this pull request Nov 18, 2025
@rekram1-node rekram1-node merged commit 6e318ba into dev Nov 18, 2025
5 checks passed
@thdxr thdxr deleted the opencode/issue4440-20251118060749 branch February 7, 2026 06:24
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.

ugly toasts

1 participant