Skip to content

fix: allow preview toolbar controls to wrap on narrow viewports#2295

Open
algojogacor wants to merge 1 commit into
nexu-io:mainfrom
algojogacor:fix/preview-controls-overflow
Open

fix: allow preview toolbar controls to wrap on narrow viewports#2295
algojogacor wants to merge 1 commit into
nexu-io:mainfrom
algojogacor:fix/preview-controls-overflow

Conversation

@algojogacor
Copy link
Copy Markdown

This is an independent contribution and is not part of any competition, organized event, or sponsored program.

Summary

When the left chat panel is widened, the workspace panel shrinks and the preview toolbar action buttons can overflow their container, causing controls on the right side to be clipped and inaccessible.

Root Cause

The .viewer-toolbar had a fixed height: 44px and .viewer-toolbar-actions used display: inline-flex without flex-wrap. When the available horizontal space decreased, the non-wrapping inline-flex container caused child controls to overflow the fixed-height container, visually clipping them.

Fix

Two-line CSS change in apps/web/src/index.css:

  1. Changed .viewer-toolbar from height: 44px to min-height: 44px — allows the bar to grow vertically when controls wrap
  2. Added flex-wrap: wrap to .viewer-toolbar-actions — allows toolbar controls to wrap onto a new line instead of overflowing

This preserves the existing appearance at normal widths while allowing the toolbar to adapt when the workspace panel is narrowed.

Testing

  • Existing toolbar layout is unchanged at standard viewport widths (>900px workspace)
  • At narrow workspace widths (<500px), toolbar controls wrap cleanly instead of clipping
  • The flex-shrink: 0 on .viewer-toolbar is preserved, so it never collapses

Closes #2166

When the chat panel is widened, the workspace panel shrinks and
the preview toolbar action buttons can overflow. This changes the
fixed toolbar height to a min-height and enables flex-wrap on the
toolbar actions container so controls wrap instead of clipping.

Fixes nexu-io#2166
@lefarcen lefarcen requested a review from PerishCode May 19, 2026 18:14
@lefarcen lefarcen added size/XS PR changes <20 lines risk/medium Medium risk: regular code changes type/bugfix Bug fix labels May 19, 2026
Copy link
Copy Markdown
Contributor

@lefarcen lefarcen left a comment

Choose a reason for hiding this comment

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

Hi @algojogacor! The regression write-up is clear, and tying it back to #2166 makes the scope easy to follow. One small PR-body nudge before pool review: could you add the Surface area checklist and mark the UI surface, since this changes the preview toolbar behavior users see? The Summary / Root Cause / Testing sections already cover the rest well.

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

Labels

risk/medium Medium risk: regular code changes size/XS PR changes <20 lines type/bugfix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resizing the left chat panel can crop controls in the right preview area

2 participants