补齐桌面壳导航失败观测

桌面外链导航和刷新记录系统异常日志

Rust 单测覆盖稳定错误和日志边界

配置门禁和文档同步导航观测约束
This commit is contained in:
2026-06-20 19:58:29 +08:00
parent 58fbef8f23
commit f9a88b9773
4 changed files with 79 additions and 5 deletions
@@ -3136,6 +3136,12 @@
- 决策:`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`,不透传系统错误、窗口内部信息或平台细节。
- 验证方式:`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 桌面壳导航系统异常必须可观测
- 背景:Tauri 桌面壳的外链打开、同源 H5 route 导航和 WebView reload 都直接影响原生壳内 H5 的完整流程;这些系统调用失败时,H5 只应得到稳定错误语义,但开发侧需要能区分外链打开失败、窗口导航失败、reload 失败和主窗口缺失。
- 决策:`apps/desktop-shell/src-tauri/src/host_bridge/navigation.rs` 必须在外链打开失败、同源 H5 route 导航失败、WebView reload 失败和主窗口缺失时记录 `desktop navigation failed for ...` 日志。HostBridge 对 H5 仍只返回稳定 `external URL cannot be opened``native page unavailable``webview reload unavailable`,不透传系统错误、窗口内部信息或平台细节。
- 验证方式:`cargo test --manifest-path apps/desktop-shell/src-tauri/Cargo.toml host_bridge::navigation``npm run desktop-shell:typecheck``npm run check:native-shells``npm run check:encoding``git diff --check`
## 2026-06-20 移动壳门禁脚本必须自登记自扫描
- 背景:Expo 移动壳单端检查已把 `apps/mobile-shell/scripts/` 纳入生产源码扫描入口,但 `check-config.mjs` 自身仍被排除在脚本清单和替身词扫描之外;这会让移动壳与桌面壳门禁结构不一致,也可能让后续门禁反查内容绕过生产替身词规则。