type: ConfigProvider support Table rowKey#56095
Conversation
|
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit 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)
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. Comment |
👁 Visual Regression Report for PR #56095 Failed ❌
Important There are 1 diffs found in this PR: 🔄
|
Summary of ChangesHello @li-jia-nan, 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 refines the type definition for the Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request updates the TableConfig in ConfigProvider to support a function for the rowKey property, which is a great enhancement. The change correctly makes TableConfig generic and expands the type of rowKey.
I have one suggestion to simplify the new type definition for rowKey by removing a redundant type.
Additionally, it would be beneficial to add a test case to cover the new functionality of passing a function as rowKey through ConfigProvider to ensure it works as expected and prevent future regressions.
There was a problem hiding this comment.
Pull request overview
This PR enhances the TypeScript definitions for ConfigProvider's Table configuration to support function-based rowKey values in addition to strings. It adds a generic parameter to TableConfig and imports the GetRowKey type from the table interface, allowing type-safe function-based row key extraction through ConfigProvider.
Key Changes
- Added generic parameter
<RecordType extends AnyObject = AnyObject>toTableConfiginterface - Updated
rowKeytype fromstringtostring | keyof RecordType | GetRowKey<RecordType>to support functions - Imported
GetRowKeytype from table/interface module
size-limit report 📦
|
More templates
commit: |
Deploying ant-design with
|
| Latest commit: |
d59681c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://da5ca5e4.ant-design.pages.dev |
| Branch Preview URL: | https://cp-table-index-key.ant-design.pages.dev |
Deploying ant-design-next with
|
| Latest commit: |
d59681c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b272ced7.ant-design-next.pages.dev |
| Branch Preview URL: | https://cp-table-index-key.ant-design-next.pages.dev |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feature #56095 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 804 804
Lines 14838 14838
Branches 3919 3919
=========================================
Hits 14838 14838 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Bundle ReportChanges will increase total bundle size by 8.12MB (210.34%) ⬆️
Affected Assets, Files, and Routes:view changes for bundle: antd.min-array-pushAssets Changed:
Files in
Files in
|




中文版模板 / Chinese template
🤔 This is a ...
🔗 Related Issues
💡 Background and Solution
📝 Change Log