Uh oh!
There was an error while loading. Please reload this page.
fix: settle a thread stranded outside its scroll range - #35
Closed
divyanshub024 wants to merge 2 commits into
Closed
fix: settle a thread stranded outside its scroll range#35divyanshub024 wants to merge 2 commits into
divyanshub024 wants to merge 2 commits into
Conversation
8 tasks
divyanshub024force-pushed
the
fix/thread-settle-fitting-offset
branch
from
August 29, 2026 22:15
87774fb to
bc923e1CompareThere was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bc923e1. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
divyanshub024
commented
Aug 30, 2026
MemberAuthor
Folded into #37, which now targets main with these commits unchanged. |
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Fixes the thread stranding at a scroll offset outside its range: the newest message clipped under the list's bottom edge with blank space beneath (a short, fitting thread), or a blank band above the oldest (a long one).
RangeMaintainingScrollPhysicsstops enforcing the boundary once a position is out of range and carries the overshoot as the range shrinks; only the next gesture's ballistic pulls it back. The keyboard is the way in: a drag dismisses it (the defaultkeyboardDismissBehavior), the viewport grows mid-gesture while a reply is still growing, and the range collapses under the offset.FlowThreadnow clamps an idle position back into range. It runs on every metrics change and on every scroll end, since the range collapses mid-gesture (when a jump would fight the physics) and a gesture merely ending changes no metrics. Each covers the other's blind spot.Screenshots
Interaction only; the fix removes a broken state rather than changing a drawn one. The original report's screenshot (reply cut mid-screen, blank below) is the before.
How this was verified
flutter analyzeclean at the root and inexample/andplayground/;dart format .applied.Checklist
flutter analyze libandflutter analyzeinexample/andplayground/are cleandart format .applieddependencies:inpubspec.yamlis flutter.dev-published, forces no configuration on hosts that never use the feature, and is argued in this PRlib/flow_ui.dartand documented indocs/and the README tableCHANGELOG.mdupdated for user-facing changes, with breaking changes called outfeat:,fix:,refactor:,docs:,chore:)Note
Low Risk
Localized scroll-position correction in the thread widget; avoids fighting in-flight scroll physics with explicit guards.
Overview
Fixes
FlowThreadleaving the conversation scrolled to an invalid offset after the viewport grows (e.g. keyboard dismissed on drag while a reply is still streaming), which could clip the newest message or show blank space above the oldest.Adds
_settleIfOff: when metrics show the list idle and outside range (with a small tolerance), itjumpTo-clamps pixels between min/max extent on the post-frame callback, skipping active gestures and duplicate work via_settling. Settlement runs fromScrollMetricsNotification(inside existing_handleMetrics) and a new outerScrollEndNotificationlistener so mid-gesture range collapse and gesture-end cases are both covered. Position is resolved from the notification’sScrollableState, so hosts can keep sharing an externalScrollController.CHANGELOG.mddocuments the user-facing fix.Reviewed by Cursor Bugbot for commit 1ee0935. Bugbot is set up for automated code reviews on this repo. Configure here.