Skip to content

Conversation

RylanBot
Copy link
Collaborator

@RylanBot RylanBot commented Jul 20, 2025

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

💡 需求背景和解决方案

Important

破坏性重构 -> 新增 CONTRIBUTING_zh-CN.md(架构文档)
应该要升大版本号 -> v1.2.0

  1. 修复自定义生成功能色的算法没有考虑暗色模式 [主题生成器] 更改成功/警告/错误色后,深色模式下对应的背景颜色不正确 #689
  1. 优化预设颜色的名字展示(代码原先就有相关变量,但一直没有派上用场)
  1. 区分“主题”和“主题色”的概念...即也可以实现一套“紫色”的腾讯云,提高拓展性
  1. 简化内置主题的 CSS 模板格式,由原先的 common 文件下还区分了 font/radius/size,改为将其合并为 一个 extra.css,和腾讯云的格式统一,未来如果有新增主题,可以参考该格式

  2. 修复多处显示的 value 和实际数值不统一的情况

  1. 整理文件夹和代码变量结构,尽可能让文件夹名统一,禁止在不同的 panel 文件夹下,常量的位置一会在 const.js, 一会在 built-in/xxx-map.js,移除大量依赖手动维护的 Token Map,尽可能从 CSS 动态匹配

  2. 同步 ColorPicker 使用 TDesign Vue 的内置组件,而不是内部自己封装

  3. 修复部分变量本地持久化异常,优化折叠组件卡顿,引入全局的 Theme Store 等

📝 更新日志

  • 本条 PR 不需要纳入 Changelog

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

@RylanBot RylanBot added the 🏃🏻 in progress someone is handling label Jul 20, 2025
@tencent-adm
Copy link
Member

tencent-adm commented Jul 20, 2025

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

pkg-pr-new bot commented Jul 20, 2025

Open in StackBlitz

npm i https://pkg.pr.new/Tencent/tdesign/@tdesign/site-components@696
npm i https://pkg.pr.new/Tencent/tdesign/tdesign-theme-generator@696

commit: 49ca526

@tdesign-bot
Copy link
Collaborator

tdesign-bot commented Jul 20, 2025

TDesign Component Site Preview CI Open

Sites (8)
Component Preview
tdesign-site 完成
tdesign-vue 完成
tdesign-react 完成
tdesign-vue-next 完成
@tdesign-vue-next/chat 完成
tdesign-mobile-vue 完成
tdesign-mobile-react 完成
tdesign-miniprogram 完成

@RylanBot RylanBot force-pushed the refactor/theme branch 3 times, most recently from 11ded29 to 78990c1 Compare July 20, 2025 21:06
@RylanBot RylanBot removed the 🏃🏻 in progress someone is handling label Sep 29, 2025
@RylanBot RylanBot requested a review from Copilot September 29, 2025 11:34
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR significantly refactors the theme generator package to streamline token management and improve the overall architecture. The changes focus on consolidating theme handling, optimizing file structure, and enhancing maintainability.

  • Refactored theme management system with centralized store and simplified API
  • Consolidated CSS template formats and reorganized built-in theme structure
  • Streamlined token management by removing manual mappings and using dynamic CSS matching

Reviewed Changes

Copilot reviewed 75 out of 112 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/theme-generator/vue.config.js Added Vue extension resolution and updated quote consistency
packages/theme-generator/src/size-panel/index.vue Updated imports and simplified token list handling with refresh mechanism
packages/theme-generator/src/size-panel/components/SizeDisplay.vue Simplified token display logic by removing hardcoded mappings
packages/theme-generator/src/size-panel/components/SizeAdjust.vue Streamlined size adjustment with dynamic token value retrieval
packages/theme-generator/src/size-panel/built-in/size-map.js Consolidated size token definitions and removed duplicate data structures
packages/theme-generator/src/shadow-panel/index.vue Updated theme handling and improved local option management
packages/theme-generator/src/shadow-panel/components/ShadowEditor.vue Enhanced color picker integration with format specification
packages/theme-generator/src/shadow-panel/built-in/shadow-map.js Moved shadow definitions from const.js with updated string quotes
packages/theme-generator/src/radius-panel/index.vue Improved radius token initialization and consolidated built-in mappings
packages/theme-generator/src/radius-panel/built-in/radius-map.js Unified radius token definitions in single file
packages/theme-generator/src/panel-drawer/index.vue Simplified drawer component with centralized theme store integration
packages/theme-generator/src/font-panel/index.vue Updated font panel with new component structure and token mapping
packages/theme-generator/src/font-panel/components/LineHeightAdjust.vue Enhanced line height adjustment with improved token handling
packages/theme-generator/src/font-panel/components/FontSizeAdjust.vue Streamlined font size adjustment logic and token management
packages/theme-generator/src/font-panel/components/FontColorAdjust.vue Updated color adjustment with new component imports
packages/theme-generator/src/font-panel/built-in/font-map.js Consolidated font-related token definitions
packages/theme-generator/src/float-dock/index.vue Updated dock component with centralized theme management
packages/theme-generator/src/common/utils/index.js Enhanced utility functions with theme mode detection and token value retrieval
packages/theme-generator/src/common/themes/ New centralized theme management system with store, core functions, and built-in themes
packages/theme-generator/src/common/components/ Consolidated common components with unified export structure
packages/theme-generator/src/common/i18n/ Reorganized internationalization with centralized exports
packages/theme-generator/src/color-panel/index.vue Complete rewrite of color panel with improved token management and theme integration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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.

3 participants