Skip to content

Comments

feat(result): Support better customization with semantic classNames/styles as function#55044

Merged
thinkasany merged 44 commits intoant-design:nextfrom
ccc1018:feature/result
Sep 30, 2025
Merged

feat(result): Support better customization with semantic classNames/styles as function#55044
thinkasany merged 44 commits intoant-design:nextfrom
ccc1018:feature/result

Conversation

@ccc1018
Copy link
Contributor

@ccc1018 ccc1018 commented Sep 17, 2025

中文版模板 / 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 Support better customization with semantic classNames/styles
🇨🇳 Chinese Support better customization with semantic classNames/styles

ccc1018 and others added 26 commits September 15, 2025 18:06
…ture/result"

This reverts commit a64cb1b, reversing
changes made to 2343dd9.
@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 Sep 17, 2025

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
  • 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
🧪 Early access (Sonnet 4.5): enabled

We are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.

Note:

  • Public repositories are always opted into early access features.
  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

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

@github-actions
Copy link
Contributor

github-actions bot commented Sep 17, 2025

👁 Visual Regression Report for PR #55044 Failed ❌

🎯 Target branch: next (38fc1dc)
📖 View Full Report ↗︎
📖 Alternative Report ↗︎
📊 Summary: 🆕 3 added

Expected (Branch next) Actual (Current PR) Diff
result-style-class.compact.png result-style-class.compact.png 🆕🆕🆕 Added 🆕🆕🆕
result-style-class.dark.png result-style-class.dark.png 🆕🆕🆕 Added 🆕🆕🆕
result-style-class.default.png result-style-class.default.png 🆕🆕🆕 Added 🆕🆕🆕

Important

There are 3 diffs found in this PR: 🆕 3 added.
Please check all items:

  • Visual diff is acceptable

@github-actions
Copy link
Contributor

github-actions bot commented Sep 17, 2025

Preview is ready

@ccc1018
Copy link
Contributor Author

ccc1018 commented Sep 28, 2025

@thinkasany 麻烦大佬帮我看看这个,pr有没有问题
image

@thinkasany thinkasany requested a review from Copilot September 28, 2025 02:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the Result component to support better customization through semantic classNames and styles that can accept either objects or functions. This allows for more dynamic styling based on component props.

  • Enhanced the classNames and styles props to accept functions in addition to objects
  • Added proper TypeScript types for function-based styling
  • Created comprehensive demo and test coverage for the new functionality

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
components/result/index.tsx Added type imports and updated props types to support function-based classNames/styles
components/result/index.en-US.md Updated API documentation to describe the new function-based styling capabilities
components/result/index.zh-CN.md Updated Chinese API documentation for the new styling functionality
components/result/demo/style-class.tsx Added comprehensive demo showcasing both object and function-based styling
components/result/demo/style-class.md Added demo documentation explaining the new styling features
components/result/tests/index.test.tsx Enhanced tests with proper types and added function-based styling test coverage
components/result/tests/snapshots/demo.test.ts.snap Updated snapshots for the new demo
components/result/tests/snapshots/demo-extend.test.ts.snap Updated extended snapshots for the new demo

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@thinkasany
Copy link
Member

@thinkasany 麻烦大佬帮我看看这个,pr有没有问题 image

都通过啦,我看起来没啥问题,等其他同学再看看~

感谢你的贡献~

@ccc1018
Copy link
Contributor Author

ccc1018 commented Sep 28, 2025

@thinkasany 麻烦大佬帮我看看这个,pr有没有问题 image

都通过啦,我看起来没啥问题,等其他同学再看看~

感谢你的贡献~

好的好的,麻烦了

};

const stylesObject: ResultProps['styles'] = {
root: { borderWidth: 2, borderStyle: 'dashed', padding: 16 },
Copy link
Member

Choose a reason for hiding this comment

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

@meet-student 调色师过来调一下 🎨

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 30, 2025
@thinkasany thinkasany merged commit 446c4a6 into ant-design:next Sep 30, 2025
38 of 39 checks passed
@github-actions
Copy link
Contributor

🎉 Thank you for your contribution! If you have not yet joined our DingTalk community group, please feel free to join us (when joining, please provide the link to this PR).

🎉 感谢您的贡献!如果您还没有加入钉钉社区群,请扫描下方二维码加入我们(加群时请提供此 PR 链接)。

钉钉社区群二维码

@zombieJ zombieJ mentioned this pull request Nov 4, 2025
17 tasks
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.

4 participants