fix(window): persist window size + position across launches (#17) - #19
Merged
Merged
Conversation
Register tauri-plugin-window-state so the main window's geometry is saved on move/resize and on exit, then restored on the next launch. Default StateFlags cover size, position, and maximized/fullscreen. The hardcoded 1100x720 in tauri.conf.json stays as the first-launch default, used only when no saved state exists. No frontend wiring or new IPC commands -- the plugin hooks window events natively, so registration is the whole feature. Closes #17 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
cpiprint
pushed a commit
to cpiprint/brew-browser
that referenced
this pull request
Sep 4, 2026
…eporter Adds a staging release-notes file capturing the window-state persistence fix (msitarzewski#17/msitarzewski#19) and crediting @bytepl as the reporter, following the reporter-acknowledgment pattern from 0.3.1.md. Rename to the real version file when the next release is cut. Reported-by: Maciej Chojnacki (@bytepl) Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Registers
tauri-plugin-window-stateso the main window remembers its size and position between launches.Resolves #17 — reported by @bytepl: resizing the window had no effect after a restart; it always reopened at the default size.
How
src-tauri/Cargo.toml— addtauri-plugin-window-state = "2"(resolves to 2.4.1)src-tauri/src/lib.rs— register the plugin in the builder chain, right after the updater pluginsrc-tauri/capabilities/default.json— add thewindow-state:defaultpermissionThe plugin hooks window move/resize/close events natively and writes geometry to a state file in the app config dir, restoring it on next launch. Default
StateFlagscover size + position + maximized/fullscreen. No frontend wiring, no new IPC commands — registration is the whole feature.The hardcoded
1100×720intauri.conf.jsonstays as the first-launch default, used only when no saved state exists.Notes
The window is
transparent: true+titleBarStyle: Overlay. The plugin restores geometry only — independent of the title-bar style — so the custom traffic-light position and the drag region (#8) are unaffected.Verification
cargo check— exit 0cargo test --lib— 585 passed, 0 failed (baseline unchanged)🤖 Generated with Claude Code