fix(ui): Don't count anchor corrections in ScrollablePositionedList#2693
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThe viewport layout logic no longer consumes a layout-cycle slot when applying a one-time fit anchor correction that adjusts ChangesFit Anchor Layout Cycle Budget
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2693 +/- ##
==========================================
- Coverage 65.38% 65.38% -0.01%
==========================================
Files 423 423
Lines 26665 26664 -1
==========================================
- Hits 17436 17434 -2
- Misses 9229 9230 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Submit a pull request
CLA
Description of the pull request
Screenshots / Videos
What was happening:
The performLayout loop has a budget of 10 cycles (_maxLayoutCycles = 10). Each non-converging iteration increments count. With our custom fitAnchor logic, the lifecycle during fast scrolling was:
The fix:
The fitAnchor pass is a deliberate one-time correction, not an oscillation. The upstream library's UnboundedRenderViewport doesn't have this pass at all — it was our addition to handle the edge case where a short list would appear centered instead of bottom-pinned. This pass must not consume a slot from the oscillation budget. Removing count += 1 gives back that cycle, meaning you now get the full 10 cycles for actual sliver oscillations before the assert fires.
Summary by CodeRabbit