feat(theme): add preset theme editor and expand theme token coverage#1824
feat(theme): add preset theme editor and expand theme token coverage#1824Alexlangl wants to merge 8 commits into
Conversation
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
farion1231
left a comment
There was a problem hiding this comment.
感谢您的贡献,请查看一下是否有以下问题:
[P1] ThemeSettings.tsx (line 1127) 的 HEX 输入框不能正常逐字编辑。当前只有输入结果已经是完整合法 hex 时才会更新,导致中间态会被立刻回滚,实际几乎只能粘贴完整值。
[P1] ProviderPresetSelector.tsx (line 224) 的 bg-primary/12 在当前 Tailwind 3.4 配置下不会生成样式,这里应改成 /10、/15,或改成任意值写法。
[P2] ThemeSettings.tsx (line 34) 的 CUSTOM_THEME_FIELDS 把 primary、secondary、accent、card 等字段都映射成了通用的 Background/Foreground 文案,编辑器里可读性明显变差,建议改成专属 label key。
[P2] ThemeSettings.tsx (line 1082) 的拾色器拖拽监听挂在 window 上,但组件卸载时没有兜底清理,存在事件泄漏风险。
[P2] theme-provider.tsx (line 111) 和 ThemeSettings.tsx (line 130) 重复维护了一大套颜色算法;同时 theme-provider.tsx (line 600) 实际只消费 customTheme.light,customTheme.dark 现在基本是死数据。
[P2] UsageSummaryCards.tsx (line 19) 里 toneStyles 在组件内新建,又被放进 useMemo 依赖,UsageSummaryCards.tsx (line 42) 的缓存等于失效。
[P2] ThemeSettings.tsx (line 1147) 和 ThemeSettings.tsx (line 1198) 的拾色器缺少基本无障碍语义;同时 ThemeSettings.test.tsx (line 1) 只有 1 个用例,覆盖不了这次新增的大量交互。
感谢review
额外补充:
验证
|
25ff5e0 to
4ac0910
Compare
|
Closing this for now. I’ve already put a fair amount of time into it, and I don’t want to keep investing more without knowing whether it’s something you still want to move forward. If you’d like to revisit it later, feel free to let me know. |
|
Hey @Alexlangl, sorry for the slow response — I'm the sole maintainer of this project so review cycles can be longer than I'd like. That said, I do review every PR and I genuinely appreciate the work you've put into these three. All three PRs are valuable to the project. If you're open to reopening them, I'm happy to help rebase onto the latest main and get them merged. Just let me know. |
|
Thanks for getting back to me — no worries at all, and I appreciate the clarification. I'm glad to hear the PRs are still useful. |
8f61759 to
0612236
Compare
0612236 to
90fb7e4
Compare
|
I noticed the current CI failure is in Rust tests unrelated to this theme PR. My changes are limited to the frontend theme work, so I’d prefer not to include backend test fixes in this PR unless you’d like me to. |
|
Closing this stale PR in favor of a fresh PR rebased onto current main. Continued in #2046 |
概要
这个 PR 对应 #593,主要做了两件事:
涉及到的变更
主题编辑能力
default/bubblegum/customsystem + custom preset场景下的变量同步逻辑,保证系统明暗切换时自定义主题能正确更新一批常用界面的主题适配
把一批高频页面和组件改成尽量走主题 token,而不是继续依赖固定颜色,包括:
说明
目前剩下的固定颜色大多属于合理保留项,比如:
所以这条 PR 主要聚焦在真正会影响主题一致性的部分
验证
已执行:
Related
Related to #593