Allow preview panel to grow on wide displays#4044
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Approved Simple UI adjustment removing a hard pixel cap on preview panel width. The change is self-contained, adds unit tests, and only affects how the panel sizes on ultra-wide displays. You can customize Macroscope's approvability policy. Learn more. |
Fixes #3893.
What Changed
Removed the fixed 1400px maximum width on the resizable inline right panel. The panel can now use up to 70% of the display.
Why
The right panel hosts the integrated browser. On high-resolution and ultra-wide displays, the fixed 1440px maximum width on the sidebar limited it even while plenty of room remained for chat.
This is highly uncomfortable when the integrated browser is used to display large desktop resolutions, the page in the browser gets so small it's difficult to read, while there are a ton of negative space available around the chat (see screenshots before/after).
Screenshots
After
Maximum sidebar size on a 6k monitor:
Before
Same integrated browser viewport size on the same monitor, constrained as the sidebar does not resize to more than 1440px:
Testing
vp test apps/web/src/components/preview/PreviewPanelShell.test.tsvp checkvp run typecheckChecklist
Note
Allow preview panel to grow beyond 1400px on wide displays
Removes the hard 1400px ceiling from
useViewportClampedMaxWidthin PreviewPanelShell.tsx. The max width is now computed by a newgetPreviewPanelMaxWidthhelper asMath.floor(viewportWidth * 0.7), so the panel scales with the viewport on wide screens. Behavioral Change: panels on viewports wider than ~2000px will now expand beyond 1400px.Macroscope summarized 1846b38.
Note
Low Risk
Small UI layout change to resizable panel bounds only; no auth, data, or API impact.
Overview
Removes the 1,400px cap on the resizable inline preview/right panel so it can use the full 70% of viewport width on ultra-wide displays, leaving ~30% for chat.
Max width is now computed via exported
getPreviewPanelMaxWidth(Math.floor(viewportWidth × 0.7));useViewportClampedMaxWidthdelegates to that helper instead ofmin(1400, 70vw). Unit tests cover a 6K-style viewport and fractional-pixel rounding.Reviewed by Cursor Bugbot for commit 1846b38. Bugbot is set up for automated code reviews on this repo. Configure here.