Skip to content

fix: wait for rendering before reading margin scroll geometry - #4829

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-4233
Oct 31, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-4233

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

The margin source-tracking test can sample the reverse scroll before placement has finished. On current main, the original upward-clamping assertion fails on Linux at 20× CPU slowdown. A frame trace at 40× captures the same failure: card and source both stand at 516.84px, with the card bottom at 1122.64px; the next sampled frame has the card correctly clamped at 892px, and subsequent frames keep that position.

Read each scroll through the existing rendered() helper before measuring geometry. This waits for rendering to settle instead of assuming two animation frames suffice. All source-following, panel-clearance and bottom-clamping assertions remain intact, and product placement behavior is unchanged.

Validation: the targeted test passes at normal speed and at 40× CPU slowdown after the change. The reproduction and frame trace were collected on Linux; macOS was not run locally.

Closes #4233 — automated triage

The source-tracking test measured inside its second animation-frame callback, before placement had settled. At 40x CPU slowdown the failing read put the card bottom at 1122.64px; the next sampled frame correctly clamped it at 892px. Use the shared rendered wait after each scroll, retaining every geometry assertion.

Closes #4233
@leaf-agent
leaf-agent merged commit 89a01a6 into main Oct 31, 2026
5 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-4233 branch October 31, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Margin thread does not move down when its source changes on macOS

1 participant