Skip to content

feat(desktop): custom accent color picker + smooth theme transitions#3115

Open
HUQIANTAO wants to merge 1 commit into
esengine:main-v2from
HUQIANTAO:feat/theme-accent-picker
Open

feat(desktop): custom accent color picker + smooth theme transitions#3115
HUQIANTAO wants to merge 1 commit into
esengine:main-v2from
HUQIANTAO:feat/theme-accent-picker

Conversation

@HUQIANTAO
Copy link
Copy Markdown
Contributor

Two appearance improvements:

1. Custom accent color. lib/theme.ts learns a per-user accent stored at reasonix-accent in localStorage. applyAccent() validates (#rgb or #rrggbb), derives the foreground (warm ink on light accents, white on dark) and a 14% alpha soft tint, then writes --accent/--accent-fg/--accent-soft to the document root in a single rAF frame. The picker in SettingsPanel → Appearance is a native <input type=color>; the reset button restores the default warm clay (#d97757). All three locales pick up the new keys.

2. Theme transition. The body element now transitions background-color, color, and border-color over 180ms on a light/dark/auto toggle so a theme flip crossfades instead of snapping. A .theme-transitioning class is armed for two rAFs to give the browser a paint frame to capture the from-state. prefers-reduced-motion disables the transition.

@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jun 4, 2026
Adds two related appearance improvements:

1. Custom accent color. lib/theme.ts learns a per-user accent stored at
   reasonix-accent in localStorage. applyAccent() validates (#rgb or
   #rrggbb), derives the foreground (warm ink on light accents, white on
   dark) and a 14% alpha soft tint, then writes --accent/--accent-fg/
   --accent-soft to the document root in a single rAF frame. The picker
   in SettingsPanel -> Appearance is a native <input type=color>; the
   reset button restores the default warm clay (#d97757). All three
   locales pick up the new keys (en + zh).

2. Theme transition. The body element now transitions background-color,
   color, and border-color over 180ms on a light/dark/auto toggle so a
   theme flip crossfades instead of snapping. A .theme-transitioning
   class is armed for two rAFs to give the browser a paint frame to
   capture the from-state (without the microtask hop, the change
   coalesces with the next paint and the transition is skipped).
   prefers-reduced-motion disables the transition.

   The transition is intentionally narrow (no transform/opacity/box-shadow)
   to keep streamed text and tool cards from repainting during the fade,
   and it doesn't run on initial mount — only on user-initiated changes
   from the Settings panel.
@HUQIANTAO HUQIANTAO force-pushed the feat/theme-accent-picker branch from e2f94b5 to ccd7d5c Compare June 5, 2026 01:44
@HUQIANTAO HUQIANTAO requested a review from SivanCola as a code owner June 5, 2026 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant