Skip to content

feat(ui): orch theme — third palette + 5-click easter egg + 2s unlock freeze#106

Merged
fedorovvvv merged 3 commits into
developfrom
feature/orch-theme
May 8, 2026
Merged

feat(ui): orch theme — third palette + 5-click easter egg + 2s unlock freeze#106
fedorovvvv merged 3 commits into
developfrom
feature/orch-theme

Conversation

@fedorovvvv
Copy link
Copy Markdown
Collaborator

Summary

Adds a third theme palette orch (Orchestra-inspired pure-black + muted lavender) alongside the existing dark and light palettes, hidden behind a 5-consecutive-Dark-clicks Easter egg with a 2s post-unlock toggle freeze.

  • Palette: --bg #000, --accent #b9a8ff, foreground stepped from #d6cdf2#2e2b36. Lower contrast than dark per design references; AAA on --fg-1/--bg-1.
  • UX: Visible toggle stays at 3 positions (Auto / Light / Dark). Orch appears as a 4th item only after 5 consecutive Dark clicks; counter resets on any non-Dark click.
  • Lock: After Orch activates, all toggle items go disabled for 2000 ms so accidental follow-up clicks (the user keeps mashing Dark beyond the unlock threshold) cannot bounce out.
  • Always-some-value: Re-clicking an active item (deselect attempt) bounces to Auto and force-remounts the ToggleGroup so the visual re-pins to the store. Spec invariant: never visually empty.

Why

PRD-023 / EVID-028. Existing dual-theme system (PRD-015 / RFC-014) only exposed warm dark (#ff5a1f accent) and cream light. Adds a cool true-black palette for OLED users and long-session reviewers, gated behind an Easter egg per user direction.

Test plan

  • cd template && npm run check — 0 errors / 0 warnings (1047 files)
  • cd template && npm run build — built successfully; orch palette + lavender accent present in production CSS
  • Browser smoke (5174):
    • 5 Dark clicks → Orch button appears + pressed, theme=orch, lavender palette applied
    • Click active Orch → Auto active, orch button disappears
    • Click active Auto / Light → mode falls back to Auto, button stays pressed (never empty)
    • Within 2 s of orch unlock all toggle buttons are disabled

Files

  • template/src/app/styles/app.css:root[data-theme='orch'] palette block (every dark-defined token mirrored, dimmer/cooler values)
  • template/src/shared/lib/theme.svelte.tsThemeMode / ThemeEffective widened to include 'orch'
  • template/src/app.html — pre-paint script accepts 'orch'
  • template/src/widgets/health-bar/ui/HealthBar.svelte — 5-click streak, 2s lock, deselect-to-auto, remount-tick visual re-pin
  • .forgeplan/prds/PRD-023-...md + .forgeplan/evidence/EVID-028-...md — Forgeplan artifacts (R_eff = 1.0)

Refs: PRD-023, EVID-028

🤖 Generated with Claude Code

fedorovvvv and others added 3 commits May 8, 2026 14:18
Extends the dual-theme system (PRD-015 / RFC-014) with a third opt-in
palette `orch`: pure-black surfaces (`--bg: #000`) and lavender accent
(`--accent: #a78bfa`). Toggle in the health bar gains a fourth position
alongside Auto / Light / Dark; `auto` mode stays binary and never
resolves to `orch`. Pre-paint inline script accepts the new mode
synchronously, so first-paint is FOUC-free for users who saved it.

The change is a pure token-swap — every CSS-var defined under
`:root[data-theme='dark']` is mirrored under `:root[data-theme='orch']`,
so no component-level code changes were required. Verified via
svelte-check (0/0 errors/warnings across 1047 files), token-name diff
(empty modulo intentionally-shared `--font-*` / `--dot-grid-*`), and
production build round-trip (compiled `_layout.css` carries all three
selectors and the lavender literal). FG/BG contrast 16.58:1 (AAA).

Refs: PRD-023, EVID-028

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
UX shape change for the orch theme (PRD-023 v2):

- The visible health-bar toggle now stays at three positions
  (Auto / Light / Dark). Orch becomes a 4th visible item only
  after the user clicks Dark five times in a row — a hidden
  Easter egg. Counter resets when any non-Dark item is clicked.
- Once Orch is active, clicking it (deselect) bounces back to
  Auto. Clicking any active item never leaves the toggle
  visually empty: a remount tick is bumped on every empty
  emit from bits-ui so the controlled `value` prop re-pins
  the visual state. Spec invariant: 100% always some pressed
  item.
- Two race conditions tamed:
  1. bits-ui ToggleGroup fires onValueChange("dark") AFTER
     our click-delegation handler has already advanced mode
     to "orch" on the 5th dark click. Sentinel
     `justUnlockedOrch` swallows that single follow-up.
  2. bits-ui's internal `data-state` desyncs from a
     controlled `value` when the user re-clicks an active
     item. `{#key toggleRemountTick + ":" + items.length}`
     forces a fresh ToggleGroup mount so the visual re-pins.

Palette softened per user feedback ("цвета слишком
контрастные") to match Orchestra's marketing references:
foreground stepping compressed (`--fg` `#fafafa` →
`#d6cdf2`, `--fg-1` `#e8e8ed` → `#b3acc8`, etc.), accent
moved to a paler lavender (`#a78bfa` → `#b9a8ff`), and
edge / canvas / good-bad tokens dimmed proportionally.
F/B contrast `--fg-1` on `--bg-1` ≈ 9.7:1 — comfortably
above WCAG AAA, but visually softer than the previous
16.6:1.

Verified in browser via dev server (5174):
- 5 Dark clicks → orch active, Orch button appears + pressed
- Click active Orch → Auto active, orch button gone
- Click active Auto / active Light → stays / falls back to Auto
- Theme persists through reload via inline pre-paint script

Refs: PRD-023, EVID-028

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Once Orch becomes visible (5th consecutive Dark click), all theme
toggle items go disabled for ORCH_LOCK_MS = 2000ms so accidental
follow-up clicks (the user keeps mashing Dark beyond the 5th unlock
click) cannot immediately bounce out of orch. Disabled state
propagates through bits-ui via the existing `disabled` prop on
ToggleGroupItem; the click-delegation handler also early-returns
during the lock as a defensive belt-and-braces.

Refs: PRD-023

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@fedorovvvv fedorovvvv enabled auto-merge May 8, 2026 10:53
@fedorovvvv fedorovvvv merged commit c4f4a00 into develop May 8, 2026
3 checks passed
@fedorovvvv fedorovvvv deleted the feature/orch-theme branch May 8, 2026 10:56
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