Skip to content

type: ConfigProvider support Table rowKey#56095

Merged
afc163 merged 3 commits intofeaturefrom
cp-table-index-key
Dec 8, 2025
Merged

type: ConfigProvider support Table rowKey#56095
afc163 merged 3 commits intofeaturefrom
cp-table-index-key

Conversation

@li-jia-nan
Copy link
Member

中文版模板 / 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 CP 支持 rowKey 传入函数
🇨🇳 Chinese CP 支持 rowKey 传入函数

Copilot AI review requested due to automatic review settings December 6, 2025 10:42
@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 Dec 6, 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 (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cp-table-index-key

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 Dec 6, 2025

👁 Visual Regression Report for PR #56095 Failed ❌

🎯 Target branch: feature (523a911)
📖 View Full Report ↗︎
📖 Alternative Report ↗︎
📊 Summary: 🔄 1 changed

Expected (Branch feature) Actual (Current PR) Diff
table-sticky.dark.png table-sticky.dark.png table-sticky.dark.png table-sticky.dark.png

Important

There are 1 diffs found in this PR: 🔄 1 changed.
Please check all items:

  • Visual diff is acceptable

@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2025

Preview is ready

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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 rowKey property within the TableConfig of the ConfigProvider. By allowing rowKey to be defined as a function or a key of the record type, it significantly enhances the flexibility and type safety for globally configuring table row keys, making it easier to manage complex data structures.

Highlights

  • Enhanced TableConfig rowKey Type: The TableConfig interface within the ConfigProvider now supports more flexible types for the rowKey property. It can now accept a function (GetRowKey) or a key of the record type, in addition to a simple string, providing greater customization options for Ant Design tables.
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.

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

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 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> to TableConfig interface
  • Updated rowKey type from string to string | keyof RecordType | GetRowKey<RecordType> to support functions
  • Imported GetRowKey type from table/interface module

@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2025

size-limit report 📦

Path Size
dist/antd.min.js 522.36 KB
dist/antd-with-locales.min.js 614.75 KB

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 6, 2025

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 6, 2025

Deploying ant-design with  Cloudflare Pages  Cloudflare Pages

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

View logs

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 6, 2025

Deploying ant-design-next with  Cloudflare Pages  Cloudflare Pages

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

View logs

@codecov
Copy link

codecov bot commented Dec 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (58e3f85) to head (d59681c).
⚠️ Report is 20 commits behind head on feature.

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.
📢 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 Dec 7, 2025

Bundle Report

Changes will increase total bundle size by 8.12MB (210.34%) ⬆️⚠️, exceeding the configured threshold of 5%.

Bundle name Size Change
antd.min-array-push 11.97MB 8.12MB (210.34%) ⬆️⚠️

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.js (New) 6.29MB 6.29MB 100.0% 🚀
antd.js (New) 5.68MB 5.68MB 100.0% 🚀
antd-with-locales.min.js (Deleted) -2.12MB 0 bytes -100.0% 🗑️
antd.min.js (Deleted) -1.74MB 0 bytes -100.0% 🗑️

Files in antd-with-locales.js:

  • ./components/config-provider/context.ts → Total Size: 1.93kB

Files in antd.js:

  • ./components/config-provider/context.ts → Total Size: 1.93kB

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 8, 2025
@afc163 afc163 merged commit 25660f1 into feature Dec 8, 2025
44 checks passed
@afc163 afc163 deleted the cp-table-index-key branch December 8, 2025 02:37
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