Skip to content

fix(theme-toggle): visible active state + click feedback#66

Merged
SymbolStar merged 1 commit into
mainfrom
judy/theme-toggle-feedback
Jun 5, 2026
Merged

fix(theme-toggle): visible active state + click feedback#66
SymbolStar merged 1 commit into
mainfrom
judy/theme-toggle-feedback

Conversation

@SymbolStar

Copy link
Copy Markdown
Owner

Designer (@dora) 在 thread 里 trace 出来:原 .is-active 是 16% 半透白盖在 4% 半透白上,差 12%,肉眼分不出选中态;加上点 🌙 时系统本来就 dark 完全无视觉变化 → scott 体感「按钮死了」。代码实际生效,是反馈坏了。

Designer 已在 designer/theme-toggle-feedback (commit 0ba140b) 实现修复,本 PR cherry-pick 过来(仓权限),原 commit author 保留为 designer/jindongfu。

改动(影响极小,只动 toggle 那一块):

  • .is-active 改成 Forge Blue pill (#3B82F6) + 内高光 + 蓝光晕 —— 选中态一眼可见
  • 每次点击 scale + 蓝色脉冲动画,跟「主题是否真切了」解耦,user 总能感到点击落地;尊重 prefers-reduced-motion
  • DevTools 实测:active 按钮 getComputedStyle.backgroundColor = rgb(59,130,246) ✅;.just-clicked class 320ms 后被移除 ✅

cc @scott @designer,merge 后刷新即可看到效果。

Three-state toggle (☀/🌙/💻) buttons looked identical when active —
a 16% vs 4% white-alpha background was indistinguishable. Result:
scott reported "clicked nothing happens" because the visual signal
was missing (and clicking 🌙 while system was already dark really did
look like a no-op).

Two fixes:
- .is-active now renders as a Forge Blue pill (#3B82F6) with inner
  highlight + subtle glow. Selected state is now obvious at a glance.
- Every click triggers a brief scale+flash animation, decoupled from
  whether the theme actually flipped — so the user always feels the
  click land, even when their choice matches the current rendered
  theme (system→dark while OS is dark, etc.). Respects
  prefers-reduced-motion.
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

🤖 bot-review (comment-only · phase 1)

Diff: 2 files changed, 30 insertions(+), 4 deletions(-) @ de001c4

Red-line checks:

  • ✅ A-7.5: no new 'forbidden' code in xiaof

Phase 1: this bot leaves comments only. Auto-approve will be enabled per-path after 1–2 weeks of clean runs. Promotion plan: judy PR #42 follow-up.

@SymbolStar SymbolStar merged commit 1fd6155 into main Jun 5, 2026
5 of 6 checks passed
@SymbolStar SymbolStar deleted the judy/theme-toggle-feedback branch June 5, 2026 07:27
SymbolStar added a commit that referenced this pull request Jun 5, 2026
Vision review on PR #66 flagged the flash as 'works but too subtle';
the 6px box-shadow expansion at 55% opacity peak was easy to miss on
the 22px button. Push it to 10px expansion at 75% opacity so the
pulse actually feels like a pulse without resizing the button (which
would shift sidebar bottom layout).
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