From 1151a7d7313c5edbcc3b3e523d381f5db98159eb Mon Sep 17 00:00:00 2001 From: LemonNeko Date: Sun, 25 May 2025 22:45:31 +0800 Subject: [PATCH] refactor(tamagotchi): move chat to a standalone window (#174) * chore(tamagotchi): remove unused dependencies * fix: sync mcp connection state between windows * refactor: move chat to a standalone window --- Cargo.lock | 2 - apps/stage-tamagotchi/src-tauri/Cargo.toml | 2 - .../src-tauri/src/commands.rs | 1 + .../src/components/ChatHistory.vue | 4 +- .../src/components/InteractiveArea.vue | 39 ++++++------------- apps/stage-tamagotchi/src/layouts/default.vue | 2 +- .../stage-tamagotchi/src/layouts/settings.vue | 1 + apps/stage-tamagotchi/src/pages/chat.vue | 15 +++++++ apps/stage-tamagotchi/src/pages/index.vue | 39 ++++++++++++++++--- .../src/components/Layouts/PageHeader.vue | 12 ++++-- packages/stage-ui/src/stores/mcp.ts | 3 +- 11 files changed, 75 insertions(+), 45 deletions(-) create mode 100644 apps/stage-tamagotchi/src/pages/chat.vue diff --git a/Cargo.lock b/Cargo.lock index a59e53a71..09ca3fcd7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -95,8 +95,6 @@ name = "app" version = "0.4.27" dependencies = [ "log", - "serde", - "serde_json", "tauri", "tauri-build", "tauri-plugin-log", diff --git a/apps/stage-tamagotchi/src-tauri/Cargo.toml b/apps/stage-tamagotchi/src-tauri/Cargo.toml index 09d3b78fd..f63ac3cfd 100644 --- a/apps/stage-tamagotchi/src-tauri/Cargo.toml +++ b/apps/stage-tamagotchi/src-tauri/Cargo.toml @@ -21,8 +21,6 @@ crate-type = [ tauri-build = { version = "2.2.0", features = [] } [dependencies] -serde_json = "1.0" -serde = { version = "1.0", features = [ "derive" ] } log = "0.4" tauri = { version = "2.3.1", features = [ 'macos-private-api', diff --git a/apps/stage-tamagotchi/src-tauri/src/commands.rs b/apps/stage-tamagotchi/src-tauri/src/commands.rs index c78858831..17210e03f 100644 --- a/apps/stage-tamagotchi/src-tauri/src/commands.rs +++ b/apps/stage-tamagotchi/src-tauri/src/commands.rs @@ -32,6 +32,7 @@ pub async fn open_chat_window(app: tauri::AppHandle) { WebviewUrl::App(Path::new("#/chat").to_path_buf()), ) .title("chat") + .inner_size(600.0, 800.0) .build() .unwrap(); } diff --git a/apps/stage-tamagotchi/src/components/ChatHistory.vue b/apps/stage-tamagotchi/src/components/ChatHistory.vue index c32437946..8d1b79b5b 100644 --- a/apps/stage-tamagotchi/src/components/ChatHistory.vue +++ b/apps/stage-tamagotchi/src/components/ChatHistory.vue @@ -34,10 +34,10 @@ onTokenLiteral(async () => {