Skip to content

feat(windows): verified tray theme switching with rollback - #292

Closed
starsstreaming wants to merge 3 commits into
Fei-Away:mainfrom
starsstreaming:feat/verified-theme-rollback
Closed

feat(windows): verified tray theme switching with rollback#292
starsstreaming wants to merge 3 commits into
Fei-Away:mainfrom
starsstreaming:feat/verified-theme-rollback

Conversation

@starsstreaming

Copy link
Copy Markdown

Summary / 摘要

Stacked on the atomic-write PR (and transitively #290).

Windows tray image / video / saved-theme switches now run as snapshot → write → real-window verify → rollback on failure. Snapshot helpers live in theme-windows.ps1 (shared with community apply). The serialized tray helper parameter is renamed to $Operation so nested verified actions cannot recurse into themselves via $Action shadowing.

叠在原子写入 PR(及 #290)之上。托盘更换背景图、视频与已保存主题改为「快照 → 写入 → 真实窗口校验 → 失败回滚」;快照助手下沉到 theme-windows.ps1;序列化参数改为 $Operation,避免嵌套 scriptblock 自调用。

Depends on / 依赖: atomic-theme-writes PR + #290. Review base: starsstreaming:feat/atomic-theme-writes.

Type / 类型

  • Bug fix / 缺陷修复
  • Feature / 新功能
  • Docs / 文档
  • Theme / CSS / visual / 主题或视觉
  • Scripts / install / restore / 脚本或安装恢复
  • Chore / 杂项

Platform / 平台

  • macOS
  • Windows
  • Both / 双平台
  • Docs / repo only / 仅文档或仓库元数据

Self-check / 自测

Windows

  • windows/tests/run-tests.ps1exit 0
  • node --test windows/tests/injector-bootstrap.test.mjs — pass
  • Environment noted below

User-facing

  • Updated windows/CHANGELOG.md under ## 未发布 (no VERSION bump)

Security / 安全

  • Does not modify official Codex install / asar / signatures
  • Does not silently write API Base URL or keys
  • CDP remains loopback-oriented (127.0.0.1)

Notes / 补充

Behavior

  • Invoke-DreamSkinVerifiedThemeOperation wraps image, video, and saved-theme tray actions (3 call sites)
  • Snapshot includes optional VideoPath; restore re-enters Set-DreamSkinActiveTheme validation
  • On verify failure: restore previous theme + pause state; clear temp snapshot dir inside managed root only
  • Invoke-DreamSkinTrayThemeOperation -Operation (not -Action) — fixes nested scriptblock recursion

Checks

  • windows/tests/run-tests.ps1 exit 0 (includes video snapshot/restore + marker leftover checks)
  • Bootstrap asserts verified op boundaries and non-shadowing Operation parameter

Stack

  1. feat(runtime): add cross-platform MP4 video backgrounds #290 video
  2. atomic marker
  3. this PR verified tray rollback
  4. CSS narrow (next)

Environment

  • Windows 11 Pro 10.0.26200
  • Branch: starsstreaming:feat/verified-theme-rollback @ a090577

Support optional theme.json video fields, loopback media serving,
menu/tray import, poster fallback, and renderer handoff on both
platforms. Closes Fei-Away#240.
Write .theme-update-in-progress only around the final image/video/json/css
commit so the watcher cannot load a mixed stamp, then clear it on success.
Stale markers expire so a crashed writer cannot freeze theme loads forever.
Snapshot the active theme before image, video, or saved-theme tray
switches; confirm on a real Codex window; restore the previous theme
when verification fails. Move snapshot helpers into theme-windows and
rename the serialized tray helper parameter to Operation so nested
verified actions cannot recurse into themselves.
@starsstreaming

Copy link
Copy Markdown
Author

Stack: depends on #291 (+ #290). Next: #293.

@Fei-Away

Fei-Away commented Aug 8, 2026

Copy link
Copy Markdown
Owner

维护者复核:关闭当前叠放分支,不否定“真实窗口校验失败后回滚”的目标。

此 PR 同时包含 #290 视频背景和 #291 marker 的全部提交,基于 v1.5.6,无法与 current main 的社区 apply 事务、operation lock、fingerprint、rollback evidence 和本地化 tray 路径独立比较。v1.5.12 已对社区一键应用实现 snapshot → write → visible verify → bounded rollback,但普通背景图/已保存主题 tray 切换尚未获得同等事务保证,所以非视频部分不是已解决项。

后续应直接复用 current-main transaction/fingerprint helpers,提交仅覆盖普通 tray image/saved-theme 的窄 PR,并在 Windows PowerShell 5.1 实机验证。未删除分支,未合并代码。

@Fei-Away Fei-Away closed this Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants