Skip to content

RenderViewport max layout cycles should depend on number of slivers - #144104

Merged
knopp merged 2 commits into
flutter:masterfrom
knopp:render_viewport_max_layout_cycles
Mar 13, 2024
Merged

RenderViewport max layout cycles should depend on number of slivers#144104
knopp merged 2 commits into
flutter:masterfrom
knopp:render_viewport_max_layout_cycles

Conversation

@knopp

Copy link
Copy Markdown
Member

Fixes#144102

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actionsgithub-actionsBot added framework flutter/packages/flutter repository. See also f: labels. f: scrolling Viewports, list views, slivers, etc. labels Feb 25, 2024
@knopp
knoppforce-pushed the render_viewport_max_layout_cycles branch from 993f23f to ccab25bCompareFebruary 25, 2024 17:32
@knoppknopp changed the title RenderViewport max layout cycles should depend on number of childrenRenderViewport max layout cycles should depend on number of sliversFeb 25, 2024
@knopp
knopp requested a review from PiinksFebruary 25, 2024 17:51

@PiinksPiinks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @knopp! Thanks for the PR!

I don't recall why it is 10, and I tracked it all the way down to #7790, which did not give much insight either. :)
Maybe @Hixie knows.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a little lower now that it is per child? Before a viewport with 3 sliver children would allow 10 passes, now it would be 30.

@knoppknoppFeb 29, 2024

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think any reasonable sliver would need more than a handful of passes, the problem is that you can have nested slivers in MultiSliver or even SliverMainAxisGroup (but I don't think that one properly propagates scrollOffsetCorrection?) and we have no good way to count correction count per actual source sliver. For that we would probably need changes to SliverGeometry.

So lowering the mainLayoutCycles could potentially be breaking change for someone that has nested slivers.

More importantly I do think that the check is meant to detect pathological cases where the layout is stuck in a loop of corrections, and as such it does matter if it is 10 passes or 30? It will throw an exception anyway so it is not something that happens during regular layout process.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM, thanks for explaining your thinking here. :)

@PiinksPiinks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flutter_LGTM

Is there an issue filed for SliverMainAxisGroup not handling the correction? We should follow up on that. :)

@knopp
knoppforce-pushed the render_viewport_max_layout_cycles branch from c87da01 to 7ad984fCompareMarch 9, 2024 09:11
@knopp

knopp commented Mar 9, 2024

Copy link
Copy Markdown
MemberAuthor

@Piinks, seems like maybe you still need to approve the PR? :)

I'll create issue for SliverMainAxisGroup.

@PiinksPiinks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry about that! I had that happen a couple times last week. 🙃

@PiinksPiinks added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 13, 2024
@knopp
knoppforce-pushed the render_viewport_max_layout_cycles branch from 7ad984f to ec2cfadCompareMarch 13, 2024 19:17
@knopp
knopp merged commit 1908744 into flutter:masterMar 13, 2024
@knopp
knopp deleted the render_viewport_max_layout_cycles branch March 13, 2024 21:28
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 14, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 14, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 14, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 14, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 14, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 14, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 14, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 14, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 14, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 15, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 15, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 15, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 15, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 15, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 15, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 16, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 16, 2024
moffatman pushed a commit to moffatman/flutter that referenced this pull request Apr 1, 2024
…lutter#144104)
Fixesflutter#144102
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
[Data Driven Fixes]:
https://github.com/flutter/flutter/wiki/Data-driven-Fixes
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 14, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmitMerge PR when tree becomes green via auto submit Appf: scrollingViewports, list views, slivers, etc.frameworkflutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RenderViewport maxLayoutCycles should depend on number of slivers in viewport

2 participants

@knopp@Piinks