Skip to content

Prevent reentrant self-sizing layout on iPhone Duo - #73

Merged
muukii merged 3 commits into
mainfrom
muukii/prevent-self-sizing-layout-reentry-main
Oct 10, 2026
Merged

muukii merged 3 commits into
mainfrom
muukii/prevent-self-sizing-layout-reentry-main

Conversation

@muukii

@muukii muukii commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Self-sizing sheets can synchronously reenter their host's layout when body bounds change during .autoPointsFromBottom measurement. The reported Duo stack repeats the container notification and host layout until it crashes.

Separate body-bounds observations from explicit sizing requests and guard the whole host layout transaction. Defer reentrant requests until the current UIKit stack returns, preserving the previous vertical geometry so supplied animators can animate the new height. Coalesce mixed requests without dropping animator completions, retain safe-area propagation before fitting, and avoid redundant constraint assignments.

Validation:

  • All 19 package tests passed on iPhone 18 Pro / iOS 27.0 and a dedicated iPhone Duo / iOS 27.1, on both patched main and the 2.5.0 backport.
  • New regressions fail on 2.5.0 for synchronous parent layout and nested fitting, then pass with the fix. They also check both resizing options, intermediate presentation heights and completions, and hosted SwiftUI reflow with safe-area and size changes.
  • In a dedicated Duo lab linked to the 2.5.0 backport, visible-area and fixed-body sizing, Auto/70% snaps, content grow/shrink, Open/Closed folding, and rotation kept the sheet usable. In fixed-body mode, the actual software keyboard appeared, accepted an on-screen key, and dismissed with the sheet restored; input persisted across folding. Captured process logs contain no observation feedback loop, EXC_BAD_ACCESS, or unsatisfiable-constraint messages during this pass.
  • Full consuming-app integration remains to be verified; Pairs still pins 2.5.0 and needs a separate dependency update.

The 2.5.0 backport is preserved on muukii/prevent-self-sizing-layout-reentry; this PR retains main's current drag handling and intrinsic-size observation.

@muukii
muukii marked this pull request as ready for review October 10, 2026 14:06
@muukii
muukii merged commit ac9376f into main Oct 10, 2026
2 checks passed
@muukii
muukii deleted the muukii/prevent-self-sizing-layout-reentry-main branch October 10, 2026 14:07
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.

1 participant