Skip to content

feat: persist Tauri window state#2377

Merged
farion1231 merged 1 commit intofarion1231:mainfrom
BillSaul:feat/window-state-persistence
May 1, 2026
Merged

feat: persist Tauri window state#2377
farion1231 merged 1 commit intofarion1231:mainfrom
BillSaul:feat/window-state-persistence

Conversation

@BillSaul
Copy link
Copy Markdown
Contributor

Summary / 概述

接入 tauri-plugin-window-state,用于持久化主窗口的位置和大小。

本次改动包含:

  • 新增 tauri-plugin-window-state 依赖并注册插件
  • 在应用主动退出前显式保存窗口状态,避免当前退出流程绕过插件默认退出钩子
  • 在重启应用前保存窗口状态
  • 在进入轻量模式销毁主窗口前保存窗口状态
  • 优化退出轻量模式时的窗口重建流程,避免窗口先以默认大小和位置显示,再跳转到恢复后的位置

Related Issue / 关联 Issue

Fixes #1648

Checklist / 检查清单

  • pnpm typecheck passes / 通过 TypeScript 类型检查
  • pnpm format:check passes / 通过代码格式检查
  • cargo clippy passes (if Rust code changed) / 通过 Clippy 检查(如修改了 Rust 代码)

Add the window-state plugin and explicitly save size and position across app exit, restart, and lightweight-mode transitions.
Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Owner

@farion1231 farion1231 left a comment

Choose a reason for hiding this comment

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

感谢您的贡献!

@farion1231 farion1231 merged commit 7b667f7 into farion1231:main May 1, 2026
2 checks passed
dashitongzhi pushed a commit to dashitongzhi/cc-switch that referenced this pull request May 1, 2026
Add the window-state plugin and explicitly save size and position across app exit, restart, and lightweight-mode transitions.
ZeroTian pushed a commit to ZeroTian/cc-switch that referenced this pull request May 3, 2026
Add the window-state plugin and explicitly save size and position across app exit, restart, and lightweight-mode transitions.
satan9394 pushed a commit to satan9394/cc-switch-Agent-scheduling that referenced this pull request May 6, 2026
Add the window-state plugin and explicitly save size and position across app exit, restart, and lightweight-mode transitions.
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