-
Notifications
You must be signed in to change notification settings - Fork 220
fix: 复制时相同前缀判断不准确 #3255
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
fix: 复制时相同前缀判断不准确 #3255
Conversation
|
你好 @Alexzjt,非常感谢你的贡献. Hello, @Alexzjt, Thanks for your contribution. In order to make the code more robust, please add the corresponding unit tests, and update the docs if there are API changes. |
Summary of ChangesHello @Alexzjt, 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! 此拉取请求旨在修复一个关键的复制功能缺陷,该缺陷导致在处理具有相似前缀的行或列ID时,数据选择和复制行为不准确。通过引入更精确的节点ID匹配策略,并为树形数据提供专门处理,确保了用户在复制表格数据时能够获得预期且正确的结果,从而提升了数据操作的可靠性。 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 introduces a new test case and a bug fix related to copying data in pivot tables. A new snapshot test should copy correct row in grid mode with same prefix was added to validate the copy behavior when row headers have similar prefixes. The core change is in the PivotDataCellCopy class, specifically in the getBrushSelectedRowOrColNodes method. The logic for filtering selected nodes has been refined to correctly identify row or column leaf nodes by either an exact ID match or by matching direct descendants using the NODE_ID_SEPARATOR, preventing incorrect matches that could occur with simple startsWith checks on similar prefixes. Additionally, a specific handling for isTreeData was introduced to filter nodes based on selected metadata IDs.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## next #3255 +/- ##
==========================================
+ Coverage 75.77% 79.63% +3.86%
==========================================
Files 257 217 -40
Lines 11994 12006 +12
Branches 2464 2692 +228
==========================================
+ Hits 9088 9561 +473
+ Misses 1398 817 -581
- Partials 1508 1628 +120 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Size Change: +60 B (+0.01%) Total Size: 628 kB
ℹ️ View Unchanged
|
|
🎉 This PR is included in version @antv/s2-v2.4.12-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version @antv/s2-v2.4.12 🎉 The release is available on: Your semantic-release bot 📦🚀 |
👀 PR includes
✨ Feature
🎨 Enhance
🐛 Bugfix
🔧 Chore
📝 Description
selectedMeta的某个id是"root[&]四川省",那么通过startsWith匹配时,"root[&]四川省"和"root[&]四川省省"都会被匹配到,导致bug出现。我理解原作者这里通过startsWith这个函数的本意是"root[&]四川省"可以匹配 "root[&]四川省"、"root[&]四川省[&]成都市"、"root[&]四川省[&]雅安市"。
🖼️ Screenshot
🔗 Related issue link
🔍 Self-Check before the merge