-
-
Notifications
You must be signed in to change notification settings - Fork 623
fix(getColumnsKey): allow empty string && getColumnsKey in BodyGrid columnsWidth #1408
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
base: master
Are you sure you want to change the base?
Conversation
|
@evan-lc is attempting to deploy a commit to the React Component Team on Vercel. A member of the Team first needs to authorize it. |
|
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. Walkthrough将 BodyGrid 中列键的来源从直接读取列定义改为通过 Changes
Sequence Diagram(s)(变更为局部键生成与使用,未引入新控制流或异步交互,故不提供序列图。) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 分钟
Possibly related PRs
诗歌
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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 |
Summary of ChangesHello @evan-lc, 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 addresses a critical bug where using an empty string as a column key in the table component would cause 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.
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 addresses an issue where an empty string for a column key was being ignored, leading to problems with fixed columns. The fix involves using the nullish coalescing operator (??) instead of logical OR (||) in getColumnsKey to correctly handle empty string keys. The PR also refactors BodyGrid to use getColumnsKey for determining column widths, which improves consistency. I've identified a potential issue with the new key generation logic and provided a suggestion to ensure the fallback key is used correctly when no explicit key or data index is provided.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1408 +/- ##
=======================================
Coverage 96.09% 96.10%
=======================================
Files 57 57
Lines 3434 3437 +3
Branches 632 632
=======================================
+ Hits 3300 3303 +3
Misses 129 129
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
column 的 key 为空字符串会导致 fixed 失效


https://table-react-component.vercel.app/demo/virtual
原因是 getColumnsKey 使用了 || 导致空字符串被忽略,并且 BodyGrid 的 columnsWidth 的 key 没有使用 getColumnsKey 会有潜在导致 key 取值不一致的问题,不过现在 flattenColumns 默认都会被填充 key 所以没有问题
Summary by CodeRabbit
发布说明