收口桌面壳角标诊断日志

桌面壳角标失败只记录固定阶段标签

扩展桌面壳配置门禁禁止角标日志输出 Tauri 错误细节

补充宿主壳方案和共享决策中的角标诊断边界
This commit is contained in:
2026-06-21 03:29:31 +08:00
parent dbfe743046
commit 6a686e6ed8
4 changed files with 21 additions and 21 deletions
@@ -3162,6 +3162,7 @@
- 背景:Tauri 桌面壳的外观、角标和窗口标题能力都依赖主窗口和平台系统 API;这些能力对 H5 必须保持稳定错误语义,但开发侧也需要知道是主窗口缺失、主题读取失败还是系统 API 调用失败。
- 决策:`apps/desktop-shell/src-tauri/src/host_bridge/appearance.rs`、`apps/desktop-shell/src-tauri/src/host_bridge/badge.rs` 和 `apps/desktop-shell/src-tauri/src/host_bridge/title.rs` 必须在主窗口缺失、主题读取失败、角标设置失败和窗口标题设置失败时分别记录 `desktop appearance failed for ...`、`desktop app badge failed for ...` 或 `desktop window title failed for ...` 日志。HostBridge 对 H5 仍只返回稳定 `appearance unavailable`、`badge unavailable` 或 `window title unavailable`,不透传系统错误、窗口内部信息或平台细节。
- 2026-06-21 调整:桌面角标能力失败日志只记录 `desktop app badge failed for <stage>` 固定标签,不输出主窗口缺失文本、Tauri `set_badge_count` 错误或其它平台细节;配置检查拒绝 `badge.rs` 重新拼接 `: {error}` 或 `&error.to_string()`。
- 验证方式:`cargo test --manifest-path apps/desktop-shell/src-tauri/Cargo.toml host_bridge::appearance`、`cargo test --manifest-path apps/desktop-shell/src-tauri/Cargo.toml host_bridge::badge`、`cargo test --manifest-path apps/desktop-shell/src-tauri/Cargo.toml host_bridge::title`、`npm run desktop-shell:typecheck`、`npm run check:native-shells`、`npm run check:encoding`、`git diff --check`。
## 2026-06-20 桌面壳导航系统异常必须可观测