记录桌面壳生命周期状态读取失败

桌面生命周期窗口状态读取失败时记录具体字段并使用保守默认值

桌面壳配置检查拒绝窗口状态读取静默兜底

共享决策日志补充生命周期读取失败边界
This commit is contained in:
2026-06-20 09:50:51 +08:00
parent 88d278122e
commit 328bf920bd
3 changed files with 52 additions and 6 deletions
@@ -2902,6 +2902,13 @@
- 影响范围:`apps/desktop-shell/src-tauri/src/shell/deep_link.rs``apps/desktop-shell/scripts/check-config.mjs`
- 验证方式:`cargo test --manifest-path apps/desktop-shell/src-tauri/Cargo.toml shell::deep_link``npm run desktop-shell:typecheck``npm run check:native-shells``npm run check:encoding``git diff --check`
## 2026-06-20 桌面壳生命周期窗口状态读取失败不可静默
- 背景:Tauri 桌面壳 `app.lifecycle` 事件会驱动 H5 游戏循环、背景音乐和固定玩法音频暂停 / 恢复;如果 `is_visible()``is_minimized()``is_focused()` 读取失败后静默使用默认值,生命周期状态可能错误且难以排查。
- 决策:`emit_current_desktop_lifecycle_event(...)` 必须通过 `resolve_desktop_lifecycle_window_flag(...)` 读取窗口可见、最小化和焦点状态;读取失败时记录 `desktop host event failed for app.lifecycle.<field>`,再使用保守默认值。桌面壳配置检查拒绝重新出现 `window.is_visible().unwrap_or(...)``window.is_minimized().unwrap_or(...)``window.is_focused().unwrap_or(...)`
- 影响范围:`apps/desktop-shell/src-tauri/src/shell/lifecycle.rs``apps/desktop-shell/scripts/check-config.mjs`
- 验证方式:`cargo test --manifest-path apps/desktop-shell/src-tauri/Cargo.toml shell::lifecycle``npm run desktop-shell:typecheck``npm run check:native-shells``npm run check:encoding``git diff --check`
## 2026-06-20 移动壳 EAS 原生包构建 profile
- 背景:移动壳已能通过 Expo managed config 和 Metro production bundle smoke,但缺少原生安装包构建 profile;如果只保留 `expo export`,无法证明 Android / iOS 壳有进入原生分发链路的配置。