Skip to content

fix(tag): 修订样式#3425

Merged
irisSong merged 5 commits intojdf2e:feat_v3.xfrom
xiaoyatong:fix-tag-20260306
Mar 6, 2026
Merged

fix(tag): 修订样式#3425
irisSong merged 5 commits intojdf2e:feat_v3.xfrom
xiaoyatong:fix-tag-20260306

Conversation

@xiaoyatong
Copy link
Collaborator

@xiaoyatong xiaoyatong commented Mar 6, 2026

🤔 这个变动的性质是?

  • 新特性提交
  • 日常 bug 修复
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

💡 需求背景和解决方案

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

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

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • fork仓库代码是否为最新避免文件冲突
  • Files changed 没有 package.json lock 等无关文件

Summary by CodeRabbit

发布说明

  • 样式优化

    • 标签组件的主色背景已切换为主题变量,保持与全局视觉风格一致。
  • 测试

    • 提高上传组件相关测试的稳定性:异步操作已更可靠地等待与断言,减少时序性假阳性。
  • 维护

    • 更新构建/测试相关依赖版本以保持工具链最新。

@github-actions github-actions bot added action:review This PR needs more reviews (less than 2 approvals) 3.x Target branch 3.x labels Mar 6, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 6, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (3)
  • src/packages/address/__test__/__snapshots__/address.spec.tsx.snap is excluded by !**/*.snap
  • src/packages/checkbox/__test__/__snapshots__/checkbox.spec.tsx.snap is excluded by !**/*.snap
  • src/packages/timeselect/__test__/__snapshots__/timeselect.spec.tsx.snap is excluded by !**/*.snap

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: bc9a0067-6f55-41e0-8368-7ddf465e7595

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

将 Tag 组件的主背景色从硬编码替换为主题变量;更新 package.json 的 @vitest/coverage-v8 依赖版本;调整 uploader 测试以在 act()/waitFor() 中处理文件输入的异步更新,提升测试稳定性。

Changes

Cohort / File(s) Summary
Tag 样式
src/packages/tag/tag.scss
将主标签背景色由硬编码 #fa2c19 替换为主题变量 $tag-primary-background-color(样式变量替换)。
依赖变更
package.json
升级依赖 @vitest/coverage-v8^2.0.4^3.0.7
Uploader 测试
src/packages/uploader/__tests__/uploader.spec.tsx
将对 file input 的变更包裹在 act(async () => { ... }) 内,并用 waitFor 同步断言,修复/避免异步时序造成的测试不稳定。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 分钟

Possibly related PRs

Suggested reviewers

  • oasis-cloud

诗歌

🐰 我在代码田野跳一跳,
颜色从红变得可调;
变量铺就春日道,
测试也稳又牢,
小兔鼓掌说真棒!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning PR描述仅勾选了变动类型,但关键部分(相关Issue、需求背景和解决方案、自查清单)未填写或未勾选。 请补充相关Issue链接、具体问题描述和解决方案,并勾选自查清单中的所有项目以确保代码质量。
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed PR标题简洁地概括了主要变更:使用主题变量替换硬编码的tag背景色,符合实际代码改动。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/packages/tag/tag.scss`:
- Around line 32-34: 在 .&-primary 规则中不要直接使用 $color-primary(当前在 &-primary
中第33行),改回使用组件级 token $tag-primary-background-color 并确保该 token 正确映射到 CSS 变量
--nutui-tag-primary-background-color;如果设计确实要求更改默认色,请先更新
$tag-primary-background-color 的定义(而不是在 &-primary
里绕过它),以保持渐变/主题覆写行为一致并恢复主题变量的可被覆盖性。

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 3ded7bc7-8ada-49d1-994c-60edad9abfab

📥 Commits

Reviewing files that changed from the base of the PR and between 06fac0e and 072de9c.

📒 Files selected for processing (1)
  • src/packages/tag/tag.scss

@pull-request-size pull-request-size bot added size/L and removed size/XS labels Mar 6, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@package.json`:
- Around line 166-167: 在 package.json 中修复 `@vitest/ui` 的对等依赖版本不匹配:将依赖项
"@vitest/ui": "^2.0.4" 更新为 "@vitest/ui": "^3.0.7",以与已安装的 vitest 版本 (^3.0.7)
精确匹配;保存 package.json 后重新运行包管理器(npm/yarn/pnpm install)并执行测试/构建以验证没有新的冲突。

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 37f7d829-777e-476c-993d-7cd24095ac6c

📥 Commits

Reviewing files that changed from the base of the PR and between 072de9c and bc9e7aa.

⛔ Files ignored due to path filters (20)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • src/packages/address/__test__/__snapshots__/address.spec.tsx.snap is excluded by !**/*.snap
  • src/packages/audio/__test__/__snapshots__/audio.spec.tsx.snap is excluded by !**/*.snap
  • src/packages/backtop/__test__/__snapshots__/backtop.spec.tsx.snap is excluded by !**/*.snap
  • src/packages/badge/__test__/__snapshots__/badge.spec.tsx.snap is excluded by !**/*.snap
  • src/packages/cascader/__tests__/__snapshots__/cascader.spec.tsx.snap is excluded by !**/*.snap
  • src/packages/cell/__test__/__snapshots__/cell.spec.tsx.snap is excluded by !**/*.snap
  • src/packages/checkbox/__test__/__snapshots__/checkbox.spec.tsx.snap is excluded by !**/*.snap
  • src/packages/collapse/__test__/__snapshots__/collapse.spec.tsx.snap is excluded by !**/*.snap
  • src/packages/grid/__test__/__snapshots__/grid.spec.tsx.snap is excluded by !**/*.snap
  • src/packages/hoverbutton/__test__/__snapshots__/hoverbutton.spec.tsx.snap is excluded by !**/*.snap
  • src/packages/image/__test__/__snapshots__/image.spec.tsx.snap is excluded by !**/*.snap
  • src/packages/menu/__test__/__snapshots__/menu.spec.tsx.snap is excluded by !**/*.snap
  • src/packages/noticebar/__test__/__snapshots__/noticebar.spec.tsx.snap is excluded by !**/*.snap
  • src/packages/numberkeyboard/_test_/__snapshots__/index.spec.tsx.snap is excluded by !**/*.snap
  • src/packages/rate/__test__/__snapshots__/rate.spec.tsx.snap is excluded by !**/*.snap
  • src/packages/resultpage/__test__/__snapshots__/resultpage.spec.tsx.snap is excluded by !**/*.snap
  • src/packages/skeleton/__test__/__snapshots__/skeleton.spec.tsx.snap is excluded by !**/*.snap
  • src/packages/tabbar/__tests__/__snapshots__/tabbar.spec.tsx.snap is excluded by !**/*.snap
  • src/packages/timeselect/__test__/__snapshots__/timeselect.spec.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (3)
  • package.json
  • src/packages/tag/tag.scss
  • src/packages/uploader/__tests__/uploader.spec.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/packages/tag/tag.scss

Comment on lines +166 to 167
"@vitest/coverage-v8": "^3.0.7",
"@vitest/ui": "^2.0.4",
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

@vitest/ui 3.0.7 vitest 3.0.7 compatibility requirements

💡 Result:

  • @vitest/ui@3.0.7 expects vitest@3.0.7 as a peer dependency (the @vitest/ui package pins the peer vitest version to the exact same release number; e.g., @vitest/ui@3.0.8 has peerDependencies: { "vitest": "3.0.8" }). [1]
  • Therefore, for @vitest/ui@3.0.7 + vitest@3.0.7, make sure your environment meets Vitest v3 minimums: Node.js ≥ 18.0.0 and Vite ≥ 5.0.0. [2]

Sources: [1] @vitest/ui package.json on UNPKG (example pinned peer dep behavior), [2] Vitest v3 “Getting Started” requirements.


修复 @vitest/ui 的对等依赖版本不匹配

@vitest/ui 的对等依赖(peer dependency)要求与 vitest 版本精确匹配。当前 @vitest/ui^2.0.4vitest 已升级至 ^3.0.7,这会导致对等依赖冲突。需将 @vitest/ui 升级至 ^3.0.7

建议的修改
     "@vitest/coverage-v8": "^3.0.7",
-    "@vitest/ui": "^2.0.4",
+    "@vitest/ui": "^3.0.7",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"@vitest/coverage-v8": "^3.0.7",
"@vitest/ui": "^2.0.4",
"@vitest/coverage-v8": "^3.0.7",
"@vitest/ui": "^3.0.7",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` around lines 166 - 167, 在 package.json 中修复 `@vitest/ui`
的对等依赖版本不匹配:将依赖项 "@vitest/ui": "^2.0.4" 更新为 "@vitest/ui": "^3.0.7",以与已安装的 vitest
版本 (^3.0.7) 精确匹配;保存 package.json 后重新运行包管理器(npm/yarn/pnpm
install)并执行测试/构建以验证没有新的冲突。

@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.43%. Comparing base (8af6041) to head (6a27b89).
⚠️ Report is 2 commits behind head on feat_v3.x.

Additional details and impacted files
@@              Coverage Diff              @@
##           feat_v3.x    #3425      +/-   ##
=============================================
+ Coverage      88.15%   88.43%   +0.27%     
=============================================
  Files            291      291              
  Lines          19220    19307      +87     
  Branches        2987     3020      +33     
=============================================
+ Hits           16944    17074     +130     
+ Misses          2270     2227      -43     
  Partials           6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@irisSong irisSong merged commit 7f231a2 into jdf2e:feat_v3.x Mar 6, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.x Target branch 3.x action:review This PR needs more reviews (less than 2 approvals) size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tag 标签type="primary" 时,样式颜色被写死,无法通过修改全局主题修改

2 participants