Skip to content

feat: ColorPicker semantic support ColorBlock customize#56607

Merged
zombieJ merged 4 commits intofeaturefrom
color-picker-semantic
Jan 14, 2026
Merged

feat: ColorPicker semantic support ColorBlock customize#56607
zombieJ merged 4 commits intofeaturefrom
color-picker-semantic

Conversation

@zombieJ
Copy link
Member

@zombieJ zombieJ commented Jan 14, 2026

中文版模板 / Chinese template

🤔 This is a ...

  • 🆕 New feature
  • 🐞 Bug fix
  • 📝 Site / documentation improvement
  • 📽️ Demo improvement
  • 💄 Component style improvement
  • 🤖 TypeScript definition improvement
  • 📦 Bundle size optimization
  • ⚡️ Performance optimization
  • ⭐️ Feature enhancement
  • 🌐 Internationalization
  • 🛠 Refactoring
  • 🎨 Code style optimization
  • ✅ Test Case
  • 🔀 Branch merge
  • ⏩ Workflow
  • ⌨️ Accessibility improvement
  • ❓ Other (about what?)

🔗 Related Issues

  • Describe the source of related requirements, such as links to relevant issue discussions.
  • For example: close #xxxx, fix #xxxx

💡 Background and Solution

  • The specific problem to be addressed.
  • List the final API implementation and usage if needed.
  • If there are UI/interaction changes, consider providing screenshots or GIFs.

📝 Change Log

Language Changelog
🇺🇸 English ColorPicker picker block support semantic structure and fix root semantic uncorrectly applied to the popup element.
🇨🇳 Chinese ColorPicker 选择块支持语义化结构,并且修复 root 语义化错误的应用到弹出元素上的问题。

@bolt-new-by-stackblitz
Copy link

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 14, 2026

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.

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

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch color-picker-semantic

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.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 14, 2026

👁 Visual Regression Report for PR #56607 Passed ✅

🎯 Target branch: feature (7d35e11)
📖 View Full Report ↗︎
📖 Alternative Report ↗︎

🎊 Congrats! No visual-regression diff found.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 14, 2026

Preview is ready

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @zombieJ, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces significant improvements to the ColorPicker component by enhancing its semantic customization capabilities. It refactors how styles and class names are applied, allowing developers to target specific internal elements like the color block and description text with greater precision. This change provides more flexibility for styling and ensures better adherence to semantic design principles within the component.

Highlights

  • ColorPicker Component Refactoring: The ColorPicker component's root class and style handling have been refined. mergedClassNames.root and mergedStyles.root are no longer directly applied to the main div element, instead, classNames and styles props are passed down to the ColorTrigger component for more granular control.
  • Enhanced ColorTrigger Customization: The ColorTrigger component now accepts classNames and styles props, allowing semantic customization of its internal elements like the color block (body, content) and the description text.
  • ColorClear Component Styling Support: The ColorClear component, used when a color is cleared, now supports className and style props, enabling direct styling.
  • Expanded Semantic API for ColorPicker: New semantic class names (body, content, description) and corresponding styles have been introduced in interface.ts for the ColorPicker component, providing more detailed styling hooks for its sub-components.
  • Demo Update for Semantic Customization: The _semantic.tsx demo file has been updated to showcase the new semantic customization options for the ColorPicker, including body, content, and description elements.
  • Dependency Update: The @rc-component/color-picker dependency has been updated from ~3.0.3 to ~3.1.0.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@socket-security
Copy link

socket-security bot commented Jan 14, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​rc-component/​color-picker@​3.1.0991009689100

View full report

li-jia-nan
li-jia-nan previously approved these changes Jan 14, 2026
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 14, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces semantic customization for the ColorPicker's color block by allowing classNames and styles to be passed for more granular control. The changes are well-structured, passing the customization props down to the ColorTrigger component. My review identifies a bug where a useMemo hook is missing dependencies, which would cause the UI not to update on prop changes. I've also included a minor suggestion to improve code consistency.

innerStyle={styles.content}
/>
),
[color, prefixCls],
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The useMemo hook for containerNode is missing classNames and styles in its dependency array. Since classNames and styles are used within the memoized value calculation, they should be included to ensure that containerNode is re-computed when these props change. Without this, changes to classNames or styles will not be reflected in the UI.

Suggested change
[color, prefixCls],
[color, prefixCls, classNames, styles],

return <div className={`${prefixCls}-clear`} onClick={handleClick} />;
return (
<div
className={`${prefixCls}-clear${className ? ` ${className}` : ''}`}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For consistency and cleaner class name concatenation, it's better to use the clsx utility, which is already a project dependency and used in other components. This avoids potential issues with extra spacing.

You'll need to add import { clsx } from 'clsx'; at the top of the file.

Suggested change
className={`${prefixCls}-clear${className ? ` ${className}` : ''}`}
className={clsx(`${prefixCls}-clear`, className)}

@github-actions
Copy link
Contributor

github-actions bot commented Jan 14, 2026

size-limit report 📦

Path Size
dist/antd.min.js 523.15 KB (+85 B 🔺)
dist/antd-with-locales.min.js 616.67 KB (+95 B 🔺)

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 14, 2026

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 14, 2026

Deploying ant-design with  Cloudflare Pages  Cloudflare Pages

Latest commit: d8ffc9a
Status: ✅  Deploy successful!
Preview URL: https://d82f1e7e.ant-design.pages.dev
Branch Preview URL: https://color-picker-semantic.ant-design.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 14, 2026

Deploying ant-design-next with  Cloudflare Pages  Cloudflare Pages

Latest commit: d8ffc9a
Status: ✅  Deploy successful!
Preview URL: https://4b17020f.ant-design-next.pages.dev
Branch Preview URL: https://color-picker-semantic.ant-design-next.pages.dev

View logs

@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (6e55573) to head (d8ffc9a).
⚠️ Report is 2 commits behind head on feature.

Additional details and impacted files
@@            Coverage Diff            @@
##           feature    #56607   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          807       807           
  Lines        14925     14927    +2     
  Branches      3936      3937    +1     
=========================================
+ Hits         14925     14927    +2     

☔ 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.

@codecov
Copy link

codecov bot commented Jan 14, 2026

Bundle Report

Changes will increase total bundle size by 670 bytes (0.02%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
antd.min-array-push 3.86MB 670 bytes (0.02%) ⬆️

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 335 bytes 2.12MB 0.02%
antd.min.js 335 bytes 1.74MB 0.02%

@zombieJ zombieJ merged commit 3e0b56d into feature Jan 14, 2026
43 checks passed
@zombieJ zombieJ deleted the color-picker-semantic branch January 14, 2026 09:53
thinkasany pushed a commit to QdabuliuQ/ant-design that referenced this pull request Jan 27, 2026
…6607)

* feat: ColorPicker missing semantic

* chore: fix lint

* test: update snapshot

* chore: fix lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants