Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(color-picker): preset colors support collapsing at initialization #45607

Merged

Conversation

Wxh16144
Copy link
Member

@Wxh16144 Wxh16144 commented Oct 31, 2023

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English feat(color-picker): preset colors support collapsing at initialization
🇨🇳 Chinese color-picker 预设颜色支持默认折叠模式

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

🚀 Summary

🤖 Generated by Copilot at f88d3a8

This pull request adds a new feature to the color picker component, which allows the user to specify the initial folding state of the presets using the collapsed property. It also refactors the code for generating and managing the collapse panel keys, and adds tests and documentation for the new feature.

🔍 Walkthrough

🤖 Generated by Copilot at f88d3a8

  • Add collapsed property to presets prop of color picker component, allowing users to control the initial folding state of the presets (link, link, link)
  • Generate unique keys for collapse panels based on preset labels using genCollapsePanelKey helper function (link, link)
  • Filter out collapsed presets from default active keys using genCollapsePanelKey function (link)
  • Test color picker behavior with collapsed and non-collapsed presets in components/color-picker/__tests__/index.test.tsx (link)

(cherry picked from commit 74f6d70)
(cherry picked from commit 2ef2af4)
Copy link

stackblitz bot commented Oct 31, 2023

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

Copy link
Contributor

github-actions bot commented Oct 31, 2023

Preview Is ready

Copy link

argos-ci bot commented Oct 31, 2023

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) 🧿 Changes detected (Review) 1 change Nov 3, 2023, 3:14 AM

Copy link

codecov bot commented Oct 31, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d8fbefc) 100.00% compared to head (fb9c988) 100.00%.
Report is 23 commits behind head on feature.

Additional details and impacted files
@@            Coverage Diff            @@
##           feature    #45607   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          699       699           
  Lines        11806     11810    +4     
  Branches      3149      3150    +1     
=========================================
+ Hits         11806     11810    +4     
Files Coverage Δ
...omponents/color-picker/components/ColorPresets.tsx 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

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

Signed-off-by: MadCcc <1075746765@qq.com>
@MadCcc MadCcc merged commit 99138cb into ant-design:feature Nov 3, 2023
51 of 52 checks passed
@MadCcc MadCcc mentioned this pull request Nov 3, 2023
20 tasks
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.

None yet

4 participants