Skip to content

feat(ui): 深色模式与主题 token 及选中态修复#660

Closed
HKLHaoBin wants to merge 3 commits into
Open-Less:betafrom
HKLHaoBin:feat/dark-mode
Closed

feat(ui): 深色模式与主题 token 及选中态修复#660
HKLHaoBin wants to merge 3 commits into
Open-Less:betafrom
HKLHaoBin:feat/dark-mode

Conversation

@HKLHaoBin

@HKLHaoBin HKLHaoBin commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

摘要

  • 通过 CSS token 与 data-ol-theme 实现全平台深色模式;设置 → 通用 → 外观 支持跟随系统 / 浅色 / 深色,并以 localStorage 启动缓存 + Rust UserPreferences.theme_mode 双写持久化。
  • 主界面 shell、设置页、风格页、桌面胶囊等迁移至主题 token;胶囊随应用主题切换(浅色毛玻璃 / 深色实底)。
  • 修复深色模式下选中 chip、SelectLite 触发器/下拉、设置按钮误用 --ol-ink 或硬编码浅色背景的问题;新增 chipSelectedStyle() 并加强 aura-skin-contract 契约。

测试计划

  • 设置 → 通用 → 外观:切换跟随系统 / 浅色 / 深色,重启后偏好应保留
  • 深色模式:ThemeSection 下拉、翻译目标语言 SelectLite、设置 mobile tab chip、历史页 filter chip 均为实色深底
  • 浅色模式:选中 chip 仍为深底浅字;胶囊为浅色毛玻璃 pill
  • Windows 桌面端标题栏随主题同步
  • npm run buildnpm run check:aura-skin 通过
  • CI + Release Tauri 已在 feat/dark-mode 通过(runs 27490069240 / 27490070482)

HKLHaoBin and others added 3 commits June 14, 2026 00:41
Wire themeMode runtime with localStorage boot cache and Rust theme_mode prefs sync, complete Aura token contract, and keep capsule pill/buttons dark with light icons across app themes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Capsule tokens now follow light/dark app theme; settings ghost and segmented controls use opaque control tokens instead of hardcoded white.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replace --ol-ink misuse as fill color with pill-selected/segmented/select tokens; centralize chipSelectedStyle helper and extend aura-skin contract guards.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Persistence Reliability

The apply function uses void to call setThemePreference and updatePrefs without awaiting the latter. If the app is closed before the Tauri command completes, the Rust backend will not store the new preference. On next startup, initThemeMode reads localStorage first but then overrides it with the old Rust value, effectively discarding the user’s last choice. Errors from a failed save are also silently ignored.

const apply = async (next: ThemePreference) => {
  setPref(next);
  setThemePreference(next);
  await updatePrefs(current => {
    if (current.themeMode === next) return current;
    return { ...current, themeMode: next };
  });

@H-Chris233

Copy link
Copy Markdown
Collaborator

有冲突,请解决一下

@HKLHaoBin HKLHaoBin changed the title feat(ui): dark mode with theme tokens and selected-state fixes feat(ui): 深色模式与主题 token 及选中态修复 Jun 14, 2026
@HKLHaoBin

Copy link
Copy Markdown
Contributor Author

已由基于最新 beta 的 feat/dark-mode-to-beta 单提交 PR 替代(解决合并冲突)。

@HKLHaoBin HKLHaoBin closed this Jun 14, 2026
@HKLHaoBin HKLHaoBin deleted the feat/dark-mode branch June 14, 2026 11:20
@HKLHaoBin

Copy link
Copy Markdown
Contributor Author

有冲突,请解决一下

#661

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants