Skip to content

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

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

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.

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.

1 participant