Skip to content

fix(ColorPicker): support locale for clear button aria-label - #59206

Open
dogledogle wants to merge 2 commits into
ant-design:featurefrom
dogledogle:fix/color-picker-clear-locale
Open

dogledogle wants to merge 2 commits into
ant-design:featurefrom
dogledogle:fix/color-picker-clear-locale

Conversation

@dogledogle

Copy link
Copy Markdown
Contributor

🤔 这个变动的性质是?

  • ⌨️ 无障碍改进

🔗 相关 Issue

N/A

💡 需求背景和解决方案

ColorPicker 的清除按钮 aria-label 此前硬编码为英文 "Clear color"(ColorClear.tsx),导致任何语言下读屏器都播报英文。同目录的 ColorTrigger.tsx、ColorPresets.tsx 均已通过 useLocale('ColorPicker') 获取文案,仅此处遗漏。

解决方案:

  1. ColorClear.tsx 改用 useLocale('ColorPicker') 读取 locale.clear 作为 aria-label(触发器与面板两处清除按钮同时修复);
  2. Locale 类型的 ColorPicker 段新增必填键 clear;
  3. 为全部语言文件补充 clear 翻译;
  4. 新增测试:zh_CN 下清除按钮 aria-label 应为 清除颜色。

📝 更新日志

语言 更新描述
🇺🇸 英文 🐞 Fix ColorPicker clear button aria-label not following the current locale.
🇨🇳 中文 🐞 修复 ColorPicker 清除按钮 aria-label 未跟随当前语言的问题。

@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions

github-actions Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Preview is ready

@github-actions

github-actions Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

👁 Visual Regression Report for PR #59206 Passed ✅

🎯 Target branch: feature (d7e65da)
⚠️ Baseline may be stale: no snapshot for the PR's base commit was found, so an older branch snapshot was used. Some diffs below may come from changes already merged into feature rather than this PR.
📖 View Full Report ↗︎
📖 Alternative Report ↗︎

🎊 Congrats! No visual-regression diff found.

📖 中文报告

👁 PR #59206 视觉回归报告 通过 ✅

🎯 目标分支: feature (d7e65da)
⚠️ 基线可能已过期: 未找到该 PR 基准提交对应的快照,因此回退使用了较旧的分支快照。下方部分差异可能来自已合并到 feature 的改动,而非本 PR。

🎊 恭喜!未发现视觉回归差异。

@coderabbitai

coderabbitai Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 32ae2047-6f52-4311-80f2-c71a218813ae

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

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.

@pkg-pr-new

pkg-pr-new Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
More templates

npm i https://pkg.pr.new/antd@59206

commit: 16a861f

@codecov

codecov Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 2.08kB (0.06%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
antd.min-array-push 3.26MB 2.08kB (0.06%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: antd.min-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
antd-with-locales.min.js 2.02kB 1.83MB 0.11%
antd.min.js 51 bytes 1.43MB 0.0%

Files in antd-with-locales.min.js:

  • ./components/locale/en_US.ts → Total Size: 4.33kB

  • ./components/locale/hy_AM.ts → Total Size: 7.25kB

Files in antd.min.js:

  • ./components/locale/en_US.ts → Total Size: 4.33kB

@codecov

codecov Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d7e65da) to head (16a861f).
⚠️ Report is 12 commits behind head on feature.

Additional details and impacted files
@@            Coverage Diff            @@
##           feature    #59206   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          834       834           
  Lines        16136     16138    +2     
  Branches      4263      4264    +1     
=========================================
+ Hits         16136     16138    +2     

☔ View full report in Codecov by Harness.
📢 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.

@yoyo837

yoyo837 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

这个是我之前让贡献者不要添加其他语言让Native Speaker来加。若Owner持不同看法,就忽略我。

@dogledogle

Copy link
Copy Markdown
Contributor Author

好的,我是看到 #58978 说可以加,所以补了这个

@yoyo837

yoyo837 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

好的,我是看到 #58978 说可以加,所以补了这个

可以到群里让大佬定个调,然后大家一致处理。

@dogledogle
dogledogle force-pushed the fix/color-picker-clear-locale branch from 0fdb94b to d67cdc0 Compare September 10, 2026 05:25
@dogledogle

Copy link
Copy Markdown
Contributor Author
image

@thinkasany
thinkasany requested a review from yoyo837 September 12, 2026 08:54
thinkasany
thinkasany previously approved these changes Sep 12, 2026
@yoyo837

yoyo837 commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

冲突啦

@dogledogle

Copy link
Copy Markdown
Contributor Author

冲突啦

改好了

@meet-student meet-student left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

中文

LGTM。Clear 按钮 aria-label 走 locale.clear,类型和各语言都补了。

注意:#59130 也改了 ColorClear.tsx,合入时会冲突,需要错开或先 rebase。

English

LGTM. The clear button aria-label now uses locale.clear, with the type and locales updated.

Note: #59130 also edits ColorClear.tsx, so these will conflict and need to be sequenced.

This branch has not been deployed

No deployments
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.

4 participants