feat(app): remember window size/position across restarts (window-state plugin)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-10 09:25:29 +07:00
parent 5fca6bfd09
commit 7d8e39ca3d
4 changed files with 21 additions and 1 deletions
+16
View File
@@ -3228,6 +3228,7 @@ dependencies = [
"tauri",
"tauri-build",
"tauri-plugin-notification",
"tauri-plugin-window-state",
"tokio",
]
@@ -3549,6 +3550,21 @@ dependencies = [
"url",
]
[[package]]
name = "tauri-plugin-window-state"
version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73736611e14142408d15353e21e3cca2f12a3cfb523ad0ce85999b6d2ef1a704"
dependencies = [
"bitflags 2.13.0",
"log",
"serde",
"serde_json",
"tauri",
"tauri-plugin",
"thiserror 2.0.18",
]
[[package]]
name = "tauri-runtime"
version = "2.11.2"
+1
View File
@@ -15,6 +15,7 @@ tauri-build = { version = "2", features = [] }
[dependencies]
tauri = { version = "2", features = [] }
tauri-plugin-notification = "2"
tauri-plugin-window-state = "2"
spacesh-proto = { path = "../../crates/spacesh-proto" }
tokio = { version = "1", features = ["full"] }
serde = { version = "1", features = ["derive"] }
+2 -1
View File
@@ -11,6 +11,7 @@
"core:resources:default",
"core:menu:default",
"core:tray:default",
"notification:default"
"notification:default",
"window-state:default"
]
}
+2
View File
@@ -5,6 +5,8 @@ use tauri::Manager;
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
// Persist + restore the window's size, position and maximized state across restarts.
.plugin(tauri_plugin_window_state::Builder::default().build())
.plugin(tauri_plugin_notification::init())
.setup(|app| {
let handle = app.handle().clone();