Skip to content

Theme packages: HUD chrome and style variants (workshop only) - #156

Merged
tmoonlight merged 2 commits into
masterfrom
theme/arasaka-hud
Oct 23, 2026
Merged

tmoonlight merged 2 commits into
masterfrom
theme/arasaka-hud

Conversation

@tmoonlight

Copy link
Copy Markdown
Owner

主题包新增两个可选的顶层字段:chrome: {"style":"hud"} 和 variants(2–6 套完整配色,可带外观覆盖和背景染色)。目前用于创意工坊的「荒坂公司」主题。

这是工坊主题专用能力,默认不启用;按用户要求,不写进版本更新记录。

  • themeHud.css:切角面板、霓虹描边、标尺、凸台输入框、代码块标题条与语法配色、diff 配色。每条规则都限定在 :root[data-theme-chrome="hud"] 下,由 themeHud.test.js 守着。
  • 风格染色用 CSS color 混合,一套背景图对应所有风格。
  • HudEffects:开屏扫描、风格切换过场(显示在设置窗口之上)、扫描光带(扫一遍后冷却 30 秒),受「动态效果」开关控制。
  • 设置 → 外观:风格选择和动态效果开关,持久化到 web_ui.theme_variant / web_ui.theme_effects(REST 与 Desktop 首帧注入)。
  • 字段放在顶层,旧版 ACECode 和已部署的工坊仍能正常导入,显示为默认配色。

测试:pnpm test 3357 项通过,pnpm build 通过;C++ 新增配置、REST 用例通过,快速档 5914 项中有 1 项失败,是 TrayUnreadIcon.ReleasesIconsAndHandlesInvalidInputs(GDI 计数 9 对 8)。该测试来自 master 已有的托盘功能,与本改动无关,未在干净 master 上复测。

Theme packages may now declare a top-level `chrome: {"style": "hud"}` and a
`variants` list (2-6 complete palettes, optional appearance overrides and a
background tint). Both stay outside `appearance`, so older clients and the
deployed workshop validator still accept the package and show the default
palette.

- themeHud.css draws cut-corner panels, neon frames, rulers, the notched
  composer, code headers and syntax colors; every rule is scoped to
  :root[data-theme-chrome="hud"] (guarded by themeHud.test.js).
- Variant tints recolor the three backgrounds with CSS color blending, so one
  image set serves every variant.
- HudEffects plays a boot scan, a glitch interstitial on variant switches
  (above dialogs) and a slow scan band; ambient motion is gated by the new
  theme_effects switch.
- Settings > Appearance shows the variant picker and motion toggle;
  web_ui.theme_variant / web_ui.theme_effects persist through
  /api/config/ui-preferences and the Desktop bootstrap.
- diff2html colors follow the HUD palette (headers, tags, rails, tinted rows).
- The scan band makes one pass, then waits 30 seconds.
- Workshop-only capability, off by default: keep it out of the version notes.
Copilot AI balanced review requested due to automatic review settings October 23, 2026 19:52
@tmoonlight
tmoonlight merged commit 9b36192 into master Oct 23, 2026
2 of 4 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The reported C++ test failure has not been checked against clean master, so its regression status remains unresolved.

1 open issue
What changed in this PR

Adds optional HUD chrome and color variants to ACECode workshop theme packages, with persistent appearance controls. Ordinary themes retain their existing behavior.

Changes:

  • Adds variant validation, palette overrides, background tinting, and HUD motion effects.
  • Persists variant and motion preferences through settings, REST, and Desktop startup.
  • Adds regression coverage, translations, and theme/API documentation.
File Description
web/​src/​theme.jsx Resolves variants and mounts HUD effects.
web/​src/​styles/​globals.css Enables background tint blending.
web/​src/​lib/​themePackages.js Validates and applies optional theme features.
web/​src/​lib/​themeHud.test.js Tests variants, effects, and CSS scoping.
web/​src/​lib/​runTests.js Registers HUD tests.
web/​src/​lib/​hudEffects.js Defines animation trigger decisions.
web/​src/​lib/​colorThemeArchitecture.test.js Updates provider architecture assertions.
web/​src/​lib/​appearancePreferences.test.js Updates preference expectations.
web/​src/​lib/​appearancePreferences.js Normalizes and serializes new preferences.
web/​src/​i18n/​sourceCatalog.generated.js Adds localized appearance labels.
web/​src/​components/​SettingsPage.jsx Adds variant selection and motion controls.
web/​src/​components/​HudEffects.jsx Renders decorative HUD animations.
web/​src/​App.jsx Connects controls to preference persistence.
web/​scripts/​i18n-en-overrides.mjs Supplies English appearance translations.
tests/​web/​web_server_smoke_test.cpp Tests REST persistence and validation.
tests/​config/​config_web_ui_preferences_test.cpp Tests defaults, validation, and sparse saves.
src/​base/​config/​config.hpp Declares new preference fields.
src/​base/​config/​config.cpp Loads, validates, and saves preferences.
src/​apps/​web/​server_helpers.cpp Includes preferences in API responses.
src/​apps/​web/​routes/​routes_misc.cpp Accepts and validates preference updates.
src/​apps/​desktop/​main.cpp Includes preferences in startup bootstrap.
docs/​themes.md Documents optional HUD package features.
docs/​daemon-api.md Documents new preference fields.
CLAUDE.md Records theme implementation constraints.

Review effort: Balanced

<span key={index} className="w-5 h-5 rounded border border-border" style={{ background: color }} />
))}
</div>
<div className="text-[13px] font-semibold truncate">{option.name}</div>
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