Conversation
This reverts commit 6b1376b.
Summary of ChangesHello, 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 resolves an unintended behavior in the JetNews app where the pull-to-refresh mechanism would trigger even when a user was scrolling up from the middle of a list. By implementing a custom nested scroll connection, the application now intelligently distinguishes between a deliberate pull-down from the top and a continuous scroll, ensuring the refresh action is only initiated under the correct conditions, thereby improving user experience. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
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.
Code Review
This pull request effectively resolves an issue where pull-to-refresh was incorrectly triggered during a continuous scroll-to-top gesture. The solution, which involves a custom NestedScrollConnection to conditionally consume overscroll, is well-implemented and directly addresses the problem. The code is clear and includes helpful comments explaining the logic. I have one minor suggestion to enhance readability.
Early-return when the scroll source is not UserInput instead of wrapping the body in a conditional block. No behavior change.
|
@raystatic Can you take a look at if this is a valid bug and a valid fix for the bug or if we need to file an issue internally? Thanks |
Fix pull-to-refresh activating from continuous scroll-to-top gesture in JetNews app.
PullToRefreshBox triggers on any overscroll with NestedScrollSource.UserInput,
which means dragging from the bottom of the list to the top in a single gesture
incorrectly activates refresh once the list hits its top bound.
Add a NestedScrollConnection above PullToRefreshBox that tracks whether the
child consumed any downward scroll during the current gesture. If it did, the
gesture started mid-list, so overscroll is consumed to prevent PullToRefreshBox
from seeing it. The flag resets on fling (finger lift) so the next fresh
pull-down from the top still works normally.