From 95317d62d8e160b253ee2d2fa60ce35708785c5b Mon Sep 17 00:00:00 2001 From: YokiiroBW Date: Mon, 20 Jul 2026 15:02:19 +0800 Subject: [PATCH] fix(ui): clean status bubble labels --- docs/implementation-queue.md | 2 +- docs/progress.md | 4 ++++ src/features/chat/StatusBubble.tsx | 15 ++++++++------- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/docs/implementation-queue.md b/docs/implementation-queue.md index ad24196..06f5c96 100644 --- a/docs/implementation-queue.md +++ b/docs/implementation-queue.md @@ -87,7 +87,7 @@ remote_username 用于远端聊天身份和会话命名,不作为本机权限 ### Q5:状态气泡与托盘整合 -- 增加非默认置顶的气泡窗口,显示连接状态、思考中、回复完成、错误和未读数。 +- 增加非默认置顶的气泡窗口,显示连接状态、思考中、回复完成、错误和未读数。`n- 已完成:修复气泡状态标签和无障碍名称的乱码,保持默认不置顶和设置导向逻辑不变。 - 允许用户关闭气泡或切换到仅应用 UI 模式。 - 气泡点击按设置打开主页面或快速聊天;右键菜单提供显示、隐藏、设置和退出。 - 明确窗口层级、焦点、点击穿透(如需要)和屏幕边界策略。 diff --git a/docs/progress.md b/docs/progress.md index d36a0b1..880817d 100644 --- a/docs/progress.md +++ b/docs/progress.md @@ -159,3 +159,7 @@ Still not claimed complete: automatic startup activation, real Tauri multi-windo - Completed: added window bounds, monitor clamping, and database round-trip tests. - Validation: Rust format, Clippy with warnings denied, and `astrbot-desktop` unit tests pass. - Next: finish the remaining quick-window/status-bubble acceptance work, then continue with the pet asset and multi-monitor controller foundation. +## 2026-07-20: status bubble text cleanup + +- Fixed the remaining mojibake in status-bubble state labels and accessibility text. +- Validation: TypeScript, ESLint, and Vitest (6 tests) pass. diff --git a/src/features/chat/StatusBubble.tsx b/src/features/chat/StatusBubble.tsx index b94f5fa..951abd4 100644 --- a/src/features/chat/StatusBubble.tsx +++ b/src/features/chat/StatusBubble.tsx @@ -1,4 +1,4 @@ -import { invoke } from "@tauri-apps/api/core"; +import { invoke } from "@tauri-apps/api/core"; import { useEffect, useState } from "react"; import { @@ -58,11 +58,12 @@ function stateLabel( companion: ConnectionRuntimeStatus["companion"]["state"], operations: ConnectionRuntimeStatus["operations"]["state"], ): string { - if (companion === "connecting" || operations === "connecting") - return "连接中"; - if (companion === "authExpired" || operations === "authExpired") - return "需认证"; - if (companion === "serverUnavailable" || operations === "serverUnavailable") + if (companion === "connecting" || operations === "connecting") return "连接中"; + if (companion === "authExpired" || operations === "authExpired") return "需要认证"; + if ( + companion === "serverUnavailable" || + operations === "serverUnavailable" + ) return "服务不可用"; return "离线"; -} +}