Repository navigation
fix: widgets a scroll view clips away get no outline - #30
Merged
Merged
Conversation
A list builds rows past its edge (its cache extent). Their highlights kept the full rect, which passed the on-screen check wherever the screen covered them, so a list card's outline could start on a row scrolled under the app bar and count rows the screen did not show. The controller now publishes the part of each highlight that shows: getVisibleGlobalRect cuts the box to each ancestor's paint clip in one walk to the root, and a highlight with no part showing is left out. Detectors still report where a widget is laid out. The controller keeps the hidden highlights whose widget stays built, so a row that scrolls into view gets its outline on the next rect refresh, not the next scan. The visible rect comes from the box's transformed corners, so a flipped or scaled box is not placed beside where it shows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 free
to 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.
A widget that a scroll view clips away (a list row scrolled under the app bar) no longer gets an outline, a marker or a step, and an outline covers only the part of a widget that shows. Found while recording the 1.0 launch film on the iPhone 12, after #29 merged and before the
v1.0.0tag moved.The bug
On the Chat App demo, once new messages had scrolled the list, the crosshair on Oversized Images outlined the avatar of message #42. That row sat above the list, under the tab bar, and the outline and its label were drawn over the screen's top edge. The bar said "Showing Image · 1 of 17", counting rows above and below the list that the screen did not show.
Cause
A list builds rows past each edge (its cache extent, 250 px by default) and paints only the ones inside its viewport. Detectors measure a built row's full rect with
getGlobalRect, and the first-on-screen step (sleuth_controller.dart), the bar's "Showing" state (floating_issues_card.dart) and the outline painter (highlight_overlay.dart) test that rect against the screen, not against the list's clip. A row hidden behind the app bar still overlaps the screen, so it passed. A VM-service read of the controller's highlights on the device showed the selected image at y −26 to 30 and three more rows wholly above the list's top edge (near y 240): 17 highlights, of which the list showed 9.Fix
getGlobalRectis unchanged). The controller now decides what shows when it publishes highlights: the newgetVisibleGlobalRectwalks to the root once, aslocalToGlobaldoes, and on the way reads each ancestor'sdescribeApproximatePaintClip(the method semantics uses for visibility; a viewport answers with its edge, and returns null forClip.none). A highlight is published cut to those clips, or left out when no part of it shows, so the outline, the markers, the step count and the bar only see what the screen shows.MatrixUtils.transformRect) instead of its transformed origin plus its size. UnderTransform.flipthe origin maps to the far edge, so a rect built from it sat beside the widget, and the clip check would have dropped a visible widget. A highlight whose render object is not a box is published as given, as before.Tests
getVisibleGlobalRecton a list scrolled by 75 px: null for the built rows above and below the list, the first visible row cut at the list's top edge, a full row unchanged, and the whole rect when the list does not clip. It measures a flipped box under aClipRectwhere it shows, and returns null for a detached box and for a kept-alive page that is not showing.The clip, flip, detached, publish and scroll tests each fail with their part of the fix taken out.
Checks
After merge
v1.0.0is tagged and has a GitHub Release, but 1.0.0 is not on pub.dev yet. The tag moves to this PR's merge commit and the release notes gain the Fixed line, so the published 1.0.0 includes this fix and #29.🤖 Generated with Claude Code