Skip to content

feat(web): move theme toggle into Settings modal#87

Merged
SymbolStar merged 1 commit into
mainfrom
feat/theme-toggle-to-settings
Jun 14, 2026
Merged

feat(web): move theme toggle into Settings modal#87
SymbolStar merged 1 commit into
mainfrom
feat/theme-toggle-to-settings

Conversation

@SymbolStar

Copy link
Copy Markdown
Owner

What

将左下角 icon-rail 底部的三态主题切换 (☀/🌙/💻) 移动到 Settings 模态框 的新 "主题" fieldset。

Why

Scott 反馈 (th_19ec50e131a_a3283e):theme 切换并不是高频功能,常驻 rail 底部占位浪费。放到 Settings 里更合适,rail 底部留给后续更高频的入口。

How

  • web/index.html
    • 删除 <nav> 里的 .icon-rail-bottom + #theme-toggle 块。
    • #settings-modal 头像 fieldset 和系统通知 fieldset 之间新增 主题 fieldset,复用相同的 id="theme-toggle".theme-toggle-btn 标记,所以 app.js 的 init 逻辑不用改。
  • web/style.css
    • 删除 .icon-rail-bottom 规则(DOM 已移除)。
    • 重写 .theme-toggle / .theme-toggle-btn:从硬编码的暗色透明叠层 (rgba(255,255,255,0.04)#cfd2d8) 切到语义 token (--surface-2/--border/--text-mute/--surface-hover),确保在 Settings 浅色面板上对比正常。
    • 按钮 22×22 → 28×28、字号 13→15,匹配模态框的密度。
    • 蓝色 active pill + 点击 flash 动画原样保留。

Testing

  • 打开 Settings (⚙) → 看到「主题」fieldset,三个按钮排版正常,当前 active 蓝色 pill 高亮。
  • 三种模式切换都生效(light / dark / system),刷新后 localStorage 持久化无回归。
  • icon-rail 底部已干净(没有占位/边线残留)。

— judy 🔍

User feedback (scott, th_19ec50e131a_a3283e): theme switching is not used
often enough to warrant a dedicated row on the icon rail. Moves the
three-state ☀/🌙/💻 toggle into a new "主题" fieldset inside the Settings
modal, frees up the rail bottom for higher-frequency surfaces later.

- index.html: remove .icon-rail-bottom wrapper + #theme-toggle from <nav>;
  add new 主题 fieldset in #settings-modal hosting the same toggle markup
  (same ids/classes so the JS init in app.js keeps working unchanged).
- style.css: drop .icon-rail-bottom rules; restyle .theme-toggle /
  .theme-toggle-btn to use semantic tokens (surface-2 / border /
  text-mute / surface-hover) so it reads well on the light settings
  surface; bump button size 22→28 to match modal density. Active blue
  pill + click flash animation kept as-is.
@github-actions

Copy link
Copy Markdown

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

Diff: 2 files changed, 26 insertions(+), 21 deletions(-) @ d7ece1c

Red-line checks:

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

Phase 2: auto-approve + auto-merge fire only when red-lines are clean, author is internal, and no needs-human path is touched. Block with no-auto-merge label or [no-auto-merge] in title.

@SymbolStar SymbolStar merged commit 36d4389 into main Jun 14, 2026
6 of 7 checks passed
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