refactor: Save event data by pointer in an extensible _RecognizerEventData structure#181113
Conversation
…ntData structure instead of just PointerDeviceKind
|
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
There was a problem hiding this comment.
Code Review
This pull request refactors GestureRecognizer to use a more extensible _RecognizerEventData structure for storing event data, instead of just the PointerDeviceKind. This new structure includes the buttons from the event, preparing for future enhancements. The changes are well-contained and correctly update the related methods. I've suggested adding documentation to the new _RecognizerEventData class to align with the project's style guide for maintainability.
|
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
dkwingsmt
left a comment
There was a problem hiding this comment.
LGTM with nits. Can you request a test exempt?
Renzo-Olivares
left a comment
There was a problem hiding this comment.
LGTM modulo the pending comments.
|
@luanpotter Can you get these last nit comments so we can land this? |
|
This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
Hi @luanpotter, is this something you still want to work on? There are still a few comments to address if we want to get this landed. |
Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
3e58ca1
|
@Renzo-Olivares , so sorry for the massive delay here, it is my bad. I got really sidetracked with work and other things. but I am back, and definitely would love to get the whole event button changes in. starting with this that I think is the simplest part at least. I am addressing all comments right now 🙏 thank you for you patience on this |
dkwingsmt
left a comment
There was a problem hiding this comment.
LGTM. Thank you for your work!
|
Thank you very much for continuing this PR in the midst of other issues in life! Contributions are always appreciated. I'll remind @Renzo-Olivares that this PR is ready for another review. Can you request a test exempt in Flutter's Discord, channel |
Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
|
No worries my pleasure! Just asked for the exemtpion 🙏 |
Renzo-Olivares
left a comment
There was a problem hiding this comment.
LGTM, thank you for the contribution @luanpotter!
Save event data by pointer in an extensible
_RecognizerEventDatastructure instead of justPointerDeviceKindThis was extracted from #176968
The goal is to use a more flexible structure when storing event data by pointer on the
GestureRecognizerclass. Instead of storing just thekind, this also stores thebuttonsproperty and allows for adding more properties in the future if ever expanded. This supports the next step to addbuttonsto all events.Note: this PR has no tests as it is a no-op change that should not affect any behaviour.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.