Desktop: stop the content view from outgrowing its window - #1237
Desktop: stop the content view from outgrowing its window#1237edgar965 wants to merge 2 commits into
Conversation
The view had setAutoResize({width, height}) *and* a setBounds on every
resize. Both size it, so the two add up: the view can end up wider than the
window, and the page is then cut off at the right edge - mid-word, with no
scrollbar to suggest anything is missing.
Only setBounds remains, and it now runs on maximize, unmaximize, both
full-screen transitions and move as well. 'resize' alone missed a maximise
that reports its final size late, and a drag onto a screen with a different
scaling factor, where the window keeps its size in pixels but changes it in
CSS.
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe changes replace automatic view resizing with manual bounds management and extend active-view and settings-window synchronization to maximize, unmaximize, full-screen, resize, and move events. ChangesWindow view synchronization
Suggested reviewers: Poem
Merge Risk: ⚪ Minimal · up to The desktop content view now uses manual bounds and refreshes them across window state changes, addressing clipped content without an identified remaining merge risk. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
|
@coderabbitai review |
|
|
@edgar965, closed this as the issue you suggested doesn't exist when I tried to reproduce it. |
The symptom
In the desktop app, the page is cut off at the right edge — mid-word, mid-sentence, with no scrollbar to suggest anything is missing. It does not always happen; it depends on how the window was maximised, resized or moved.
The cause
ViewHost.attachgives the content view two things that both decide its size:setAutoResizegrows the view along with the window on its own, andDesktopWindowManageralso callsresizeActiveView()— which sets the bounds to the full window width — on everyresize. The two additions stack, and the view ends up wider than the window it lives in. The page inside is fine; it is simply rendered into a view that reaches past the right edge.The change
setAutoResizeis gone.setBoundsalone covers every case it covered, and it is the one that knows aboutTITLEBAR_HEIGHT.maximize,unmaximize,enter-full-screenandleave-full-screenas well.resizealone misses a maximise that reports its final size late.movere-applies them too, for a drag onto a display with a different scaling factor: the window keeps its size in device pixels but changes it in CSS pixels, and noresizeis emitted.Two files, sixteen lines.
setAutoResizehas been there since the desktop app landed in 97c9b67.Summary by CodeRabbit