-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix(brush-select): change onSelect callback return type from state ob… #7348
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(brush-select): change onSelect callback return type from state ob… #7348
Conversation
…ject to void - Changed onSelect callback return type from Record<ID, State | State[]> to void - Updated callback invocation to not expect return value - Fixed linting issue by changing states variable to const - Resolves issue where onSelect callback was incorrectly expected to return modified states Fixes antvis#7303
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.
Summary of Changes
Hello @lyw405, 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!
此拉取请求修复了 brush-select 行为中 onSelect 回调的一个设计缺陷。原先的实现错误地要求 onSelect 回调返回修改后的选中元素状态,这与其作为通知回调的预期语义不符。现在,onSelect 回调被修改为不返回任何值(void),使其纯粹用于通知,并修复了相关的 linting 问题,确保了框选功能的向后兼容性。
Highlights
onSelect回调签名变更: 将onSelect回调的返回类型从Record<ID, State | State[]>修改为void,使其符合纯通知回调的语义。- 回调调用方式更新: 更新了
onSelect回调的调用方式,不再期望其返回任何值。 - 变量声明优化: 将
states变量的声明从let修改为const,以提高代码的不可变性和可读性。
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| 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 issue 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
-
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. ↩
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
本次 PR 修复了 brush-select 行为中 onSelect 回调的设计问题,将其返回类型从 Record<ID, State | State[]> 修改为 void,使其作为纯粹的通知回调,这符合预期。同时,调用方式也相应更新,不再接收其返回值。此外,PR 还修复了一个 linting 问题,将 states 变量声明从 let 改为 const,因为该变量并未被重新赋值。这些改动增强了代码的健壮性和可读性,设计也更加合理。代码修改正确,我没有发现任何问题。
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v5 #7348 +/- ##
=======================================
Coverage 95.59% 95.59%
=======================================
Files 188 188
Lines 9888 9888
Branches 2134 2086 -48
=======================================
Hits 9452 9452
+ Misses 436 404 -32
- Partials 0 32 +32
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
🐛 Bug Fix
Description
修复了
brush-select行为中onSelect回调的设计问题。原实现错误地要求onSelect回调必须返回修改后的选中元素状态,这与预期的通知回调语义不符。Changes
onSelect回调的返回类型从Record<ID, State | State[]>改为voidstates变量改为constBefore
After
Impact
onSelect现在作为纯通知回调,符合预期语义Testing
Fixes #7303