[WIP] Implement and adjust Tauri v2 window restore logic on Windows#6
Draft
Copilot wants to merge 2 commits into
Draft
[WIP] Implement and adjust Tauri v2 window restore logic on Windows#6Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Agent-Logs-Url: https://github.com/crazyrob425/KDP-E-Book-Generator/sessions/e4a9eafb-7042-42ee-bd5b-c762d520b258 Co-authored-by: crazyrob425 <247058665+crazyrob425@users.noreply.github.com>
Copilot stopped work on behalf of
crazyrob425 due to an error
March 26, 2026 21:58
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.
src-tauri/src/lib.rsWindowStatestruct (x, y, width, height, maximized) with serde support%APPDATA%\KDP E-Book Generator\window-state.json)Moved/Resizedwindow events (500 ms debounce)src-tauri/Cargo.tomlif needed (no new deps expected)README.mdto document window state persistence behavior and AppData pathOriginal prompt
In crazyrob425/KDP-E-Book-Generator (ref main), implement and/or adjust the Tauri v2 window restore logic on Windows so that when restoring saved window bounds, the app will shrink the window if the saved width/height exceed the chosen monitor's work area (rather than only shifting/clamping position). Behavior requirements:
Deliverable: open/update a PR against main with these changes and any tests or logging needed to validate behavior on Windows.
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: @copilot Accepted Confirmation: Are you sure?
Assistant: I’m proceeding on your fork and kicking off the work to add the Tauri v2 wrapper + Rust SQLite backend + Windows MSI GitHub Actions build. You can track it here:
While that runs, if you want the result to feel exactly like your current app on Windows, tell me two preferences (one line is fine):
remember size/position(yes/no)%AppData%(default) or a folder next to the project filesUser: yes, in appdata
Assistant: Waiting on your response in the confirmation dialog to continue updating the in-progress PR with Windows window state persistence and AppData-based storage.
User: @copilot Accepted Confirmation: Are you sure?
Assistant: Got it: persist window size/position = yes, and store everything under AppData.
I can’t apply more repo changes from this message (I’m temporarily unable to run the repo-update automation right now), but here’s exactly what will be done in the PR so you know it’s handled correctly:
%AppData%\\Binary Books E-Crafter\\...or the Tauri app data path), not next to your project files.If you want me to match your preference precisely, confirm one detail:
yes/noUser: yes
Assistant: Window-state persistence (with off-screen clamping) + AppData-only storage is now queued to be implemented on
crazyrob425/KDP-E-Book-Generator(basemain) as minimal Rust/Tauri changes, with a README note about the AppData location.User: @copilot Accepted Confirmation: Are you sure?
Assistant: Yes—got it.
The plan is:
I can’t make repo changes from this message (I don’t have write automation available in this exact turn), but that’s the exact behavior that will be implemented in the PR work already in flight. If you want one more preference locked in: should it restore maximized state too (so if you closed it maximized, it reopens maximized)?
User: yes
Assistant: I’m waiting for your response to the tool confirmation dialog so I can continue updating the PR to also persist maximized state (along with size/position) and keep everything stored under AppData with off-screen clamping.
User: @copilot Accepted Confirmation: Are you sure?
Assistant: Yes—maximized state will be persisted too.
What that means in practice (Windows):
isMaximized) to a small JSON file under AppData.isMaximizedwas true, reopen maximized,This pull request was created from Copilot chat.
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.