Skip to content

Desktop: stop the content view from outgrowing its window - #1237

Closed
edgar965 wants to merge 2 commits into
siteboon:mainfrom
edgar965:desktop-view-bounds
Closed

Desktop: stop the content view from outgrowing its window#1237
edgar965 wants to merge 2 commits into
siteboon:mainfrom
edgar965:desktop-view-bounds

Conversation

@edgar965

@edgar965 edgar965 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

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.attach gives the content view two things that both decide its size:

view.setBounds(this.getContentViewBounds());
view.setAutoResize({ width: true, height: true });

setAutoResize grows the view along with the window on its own, and DesktopWindowManager also calls resizeActiveView() — which sets the bounds to the full window width — on every resize. 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

  • setAutoResize is gone. setBounds alone covers every case it covered, and it is the one that knows about TITLEBAR_HEIGHT.
  • The bounds are now re-applied on maximize, unmaximize, enter-full-screen and leave-full-screen as well. resize alone misses a maximise that reports its final size late.
  • move re-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 no resize is emitted.

Two files, sixteen lines. setAutoResize has been there since the desktop app landed in 97c9b67.

Summary by CodeRabbit

  • Bug Fixes
    • Improved content layout when the desktop window is resized, maximized, restored, moved, or switched into or out of full-screen mode.
    • Fixed an issue where page content could extend beyond the right edge of the window, potentially hiding content and preventing access to the horizontal scrollbar.
    • Settings window positioning now stays synchronized across window size and display-state changes.

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.
@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 851dabd3-5471-48d6-b60f-434b1459a7af

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 5d363e7e-1d5e-46a4-842f-13f56eefc58b

📥 Commits

Reviewing files that changed from the base of the PR and between c1be241 and 904e74b.

📒 Files selected for processing (2)
  • electron/desktopWindow.js
  • electron/viewHost.js

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The 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.

Changes

Window view synchronization

Layer / File(s) Summary
Manual view bounds in attach
electron/viewHost.js
attach uses view.setBounds(this.getContentViewBounds()) without enabling automatic resizing.
Window state resize synchronization
electron/desktopWindow.js
The active view and settings window bounds are synchronized for resize, maximize, unmaximize, full-screen, and move events.

Suggested reviewers: viper151

Poem

A rabbit reads each line,
The patch grows clear beneath the moon,
Small changes hop in place,
Tests guard the garden path,
Reviews bloom before the dawn.

Merge Risk: ⚪ Minimal · up to 904e7

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)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preventing the desktop content view from becoming wider than its window.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@edgar965

edgar965 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@blackmammoth

Copy link
Copy Markdown
Member

@edgar965, closed this as the issue you suggested doesn't exist when I tried to reproduce it.

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.

2 participants