feat(theme): add preset theme editor and expand theme token coverage#2046
feat(theme): add preset theme editor and expand theme token coverage#2046Alexlangl wants to merge 9 commits intofarion1231:mainfrom
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 90fb7e49c0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const rect = hueRef.current?.getBoundingClientRect(); | ||
| if (!rect) return; | ||
| const x = Math.max(0, Math.min(rect.width, clientX - rect.left)); | ||
| const hue = rect.width === 0 ? 0 : (x / rect.width) * 360; |
There was a problem hiding this comment.
When the pointer reaches the far right of the hue track, hue is computed as exactly 360, but hsvToHex normalizes that to 0, so the selected color wraps and the thumb snaps to the left edge. This makes the endpoint interaction feel broken during drag (especially at the right boundary) and can cause visible jitter between near-360 and 0 values.
Useful? React with 👍 / 👎.
|
已处理并增加回归测试 |
Summary / 概述
主题编辑能力
增加 preset 主题选择,支持 default / bubblegum / custom
支持在设置页里调整 custom theme 的基础配色
补齐了 system + custom preset 场景下的变量同步逻辑,保证系统明暗切换时自定义主题能正确更新
调整了主题设置页文案,让主题编辑器的界面表达和实际行为保持一致,现在明确为编辑基础配色
一批常用界面的主题适配
把一批高频页面和组件改成尽量走主题 token,而不是继续依赖固定颜色,包括:
usage 图表和摘要卡片
settings / import-export / WebDAV 相关提示状态
sessions 批量管理相关状态色
provider / config 表单里的一批 success / warning / error 样式
preset 预览和 preset 按钮的一些显示细节
Related Issue / 关联 Issue
Fixes #593
Screenshots / 截图
Checklist / 检查清单
pnpm typecheckpasses / 通过 TypeScript 类型检查pnpm format:checkpasses / 通过代码格式检查cargo clippypasses (if Rust code changed) / 通过 Clippy 检查(如修改了 Rust 代码)