From 9f61578a73464e0bc661e6780e5a07f47a709a7a Mon Sep 17 00:00:00 2001 From: YokiiroBW Date: Mon, 20 Jul 2026 15:06:05 +0800 Subject: [PATCH] fix(window): allow quick chat to close --- docs/implementation-queue.md | 3 ++- docs/progress.md | 5 +++++ src-tauri/src/lib.rs | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/implementation-queue.md b/docs/implementation-queue.md index 06f5c96..c1b2817 100644 --- a/docs/implementation-queue.md +++ b/docs/implementation-queue.md @@ -81,7 +81,8 @@ remote_username 用于远端聊天身份和会话命名,不作为本机权限 - 与主窗口共享 `ChatRuntime`、会话选择、消息缓存、未读数和发送队列。 - 设置中只提供一个快速聊天目标:`companion` 或 `operations`,二选一。 - 设置中提供气泡点击导向:主页面或快速聊天;不增加第三种导向模式。 -- 处理主窗口关闭到托盘、快速窗口关闭、单实例和窗口重启恢复。 +- 处理主窗口关闭到托盘、快速窗口关闭、单实例和窗口重启恢复。 +- 已修复:快捷窗口关闭按钮现在正常销毁窗口;主窗口仍保持关闭到托盘。 验收:从主窗口和快速窗口发送的消息进入同一会话;任一窗口关闭不影响连接和另一个窗口。 diff --git a/docs/progress.md b/docs/progress.md index 880817d..53ba619 100644 --- a/docs/progress.md +++ b/docs/progress.md @@ -163,3 +163,8 @@ Still not claimed complete: automatic startup activation, real Tauri multi-windo - Fixed the remaining mojibake in status-bubble state labels and accessibility text. - Validation: TypeScript, ESLint, and Vitest (6 tests) pass. +## 2026-07-20: quick-chat close behavior fix + +- Fixed the global close handler so the quick-chat window can be closed normally instead of being intercepted and only hidden. +- The main window keeps the existing tray behavior; quick-chat geometry is saved before destruction and restored when reopened. +- Validation: Rust Clippy and `astrbot-desktop` unit tests (64) pass. diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 291eb33..b48e17f 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -251,6 +251,7 @@ pub fn run() { WindowEvent::CloseRequested { api, .. } => { if window.label() == QUICK_WINDOW_ID { save_quick_window_state(window, window.app_handle()); + return; } api.prevent_close(); let _ = window.hide();