Skip to content

🎉 Remember settings window geometry - #1474

Open
fzlzjerry wants to merge 2 commits into
kando-menu:mainfrom
fzlzjerry:fix/1462-settings-window-bounds
Open

🎉 Remember settings window geometry#1474
fzlzjerry wants to merge 2 commits into
kando-menu:mainfrom
fzlzjerry:fix/1462-settings-window-bounds

Conversation

@fzlzjerry

@fzlzjerry fzlzjerry commented Aug 10, 2026

Copy link
Copy Markdown

Description

This stores the settings window's normal bounds, maximized state, and left/right sidebar widths in a separate machine-local settings-window-state.json file. Restored window bounds are fitted to the best matching display's current work area, so removing a monitor or changing its resolution cannot leave the settings window off-screen. Missing or invalid state still uses the existing 1350 x 900 window and 370px sidebar defaults.

Sidebar widths are loaded before the settings window is displayed, avoiding a flash of the default layout, and persisted when a resize finishes. Window bounds are saved both when the settings window closes normally and before Kando destroys it during application shutdown.

Focused tests cover state validation, persistence (including sidebar widths), multi-monitor coordinates, off-screen restoration, and oversized windows.

Testing

  • npm test (67 passing)
  • npm run tscheck
  • npm run lint
  • npm run prettier

Closes #1462

@fzlzjerry
fzlzjerry marked this pull request as ready for review August 11, 2026 08:55
Copilot AI lite review requested due to automatic review settings August 11, 2026 08:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Schneegans

Copy link
Copy Markdown
Contributor

Thank you very much! From a first glance, this looks very good. Hopefully I'll soon find the time to do a thorough review. On idea: Do you think it could be possible to also restore the width of the left and right sidebars?

@fzlzjerry
fzlzjerry force-pushed the fix/1462-settings-window-bounds branch from 804331c to bd4c4d1 Compare August 12, 2026 04:03
@fzlzjerry

Copy link
Copy Markdown
Author

Yes — added in bd4c4d14. Both sidebar widths now live alongside the window bounds in settings-window-state.json, are restored before the window is displayed, and are persisted when resizing finishes. Invalid values fall back safely, while existing users retain the 370px defaults until they resize a sidebar.

I also rebased the branch onto the latest main and reran the full checks: 67 tests, TypeScript, ESLint, and Prettier all pass.

@fzlzjerry
fzlzjerry force-pushed the fix/1462-settings-window-bounds branch from bd4c4d1 to 0569b2e Compare August 13, 2026 13:05
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.

Remember the size and position of the settings window between sessions

3 participants