-
Notifications
You must be signed in to change notification settings - Fork 231
feat: implement window bounds persistence #7388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
miya
wants to merge
20
commits into
mongodb-js:main
Choose a base branch
from
miya:feat/window-bounds-persistence
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+114
−6
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
2bad280
feat: add window state persistence to user preferences
miya 54c08fb
feat: implement window state persistence and validation
miya ad278b4
fix: add optional chaining to validate window bounds
miya 6924373
fix: replace hardcoded debounce delay with constant for save operations
miya 8d13821
fix: rename saveTimeout variable for clarity in window state persistence
miya ebeede5
fix: reset saveTimeoutId after saving window bounds to prevent memory…
miya d198c68
fix: improve validation logic for window bounds to handle null values
miya 1b40f27
fix: Remove unnecessary validation
miya 65171d9
fix: enhance showWindowWhenReady to handle maximized state and simpli…
miya 54f712f
fix: rm validateWindowBounds (utilize the validation used internally)
miya 02836d7
fix: remove getSavedWindowBounds function and directly access prefere…
miya df9f359
fix: update error handling in saveWindowBounds to log errors to console
miya 32f90ca
fix: refactor getSavedWindowBounds to streamline window bounds retrieval
miya 3dff406
Merge branch 'main' into feat/window-bounds-persistence
miya 8ed328c
fix: remove unused electron imports from window-manager
miya c7d854f
fix: remove unnecessary line break
miya ed70691
Merge branch 'main' into feat/window-bounds-persistence
miya 2e4b687
Update packages/compass/src/main/window-manager.ts
miya 2750310
assign log Id
miya 8bdb6c6
Merge branch 'main' into feat/window-bounds-persistence
miya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does electron gracefully handle if a user tries to open a window that's larger than their screen size or out of bounds of their current screen? I'm wondering if we need to account for situations where a user goes from a larger monitor to a smaller one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are the results I observed on macOS (v15.6.1).
I wasn’t able to test on Windows or Linux since I don’t have access to those machines.
When the window size was larger than the display or even slightly out of bounds, macOS automatically adjusted it.
If the window exceeded the display size, it was resized to fit within the screen.
If it was positioned partially outside the display, it was automatically moved so that the entire window remained visible.
I checked the Electron documentation but couldn’t find any mention of this behavior.
It might be handled by the operating system rather than Electron itself, so if possible, could you also test it on Windows and Linux?
2025-10-06.1.19.03.mov