refactor(frontend): tokenize shared components and add base primitives (UI 优化 M1·PR#2) - #178
Merged
Merged
Conversation
Merged
4 tasks
Contributor
Author
Contributor
Author
Contributor
Author
Contributor
Author
Contributor
Author
Member
|
没额度了) 等待救援中x |
L8848-Li
force-pushed
the
feat/ui-primitives
branch
from
August 13, 2026 11:21
3ff142b to
11b1093
Compare
This was referenced Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.





Summary
SectionBlock、EmptyState、CanCard、EntityCard、NameplateCard、ThemeSwitcher六组件硬编码颜色清零(grep 验证零残留),全部消费全局 Token,暗色模式自动生效。--text-secondary-color/--surface-subtle-color/--accent-subtle-color/--danger-subtle-color)与--on-danger-color,覆盖组件灰绿层次。BaseButton:primary/ghost/danger 变体,medium/small 尺寸,block/loading/disabled;BaseField:输入框/文本域统一封装,v-model + label + required + error;ConfirmDialog:uni.showModal统一封装(Promise API),删除类危险操作复用,danger 确认色。@tdesign/uniapp@0.10.3,Spike 验证双端可行):theme.less全局注入(rpx 单位),--td-*品牌色映射到项目深绿品牌色。docs/FRONTEND_GUIDE.md新增「UI 规范速查」章节:Token 表、原语用法、TDesign 使用约定、“新代码禁止新增 hex 颜色字面量”规则。Scope
frontend/src/components/(6 个存量组件 + 3 个新原语)frontend/src/styles/tokens.scss、frontend/src/main.js、frontend/src/pages.jsonfrontend/package.json、frontend/yarn.lock(新增@tdesign/uniapp、lessdevDependency)frontend/tests/unit/BasePrimitives.test.js(新增 8 个单测)docs/FRONTEND_GUIDE.mdChecks
type: summaryortype(scope): summary, e.g.ci: cache dependenciesWIP,fixup!, merge commits, or unrelated historymake frontend-check(yarn lint / test:unit 151 passed / build / build:mp-weixin 全部通过)Test Plan
cd frontend && yarn lint && yarn test:unit && yarn build && yarn build:mp-weixin全部通过(含新增 8 个原语单测)#1d2822Notes
^uni-(.*)规则同样失效),因此 TDesign 组件一律手动导入,文档已写明约定;常规按钮/输入/确认框优先用 Base* 原语。cu-*类名(属 M3/M4 范围),按 issue 约定推迟。Relates to #170
Part of #174