Conversation
…layout Stacks only switch from Row/Column to ConstrainedFillLayout when a min/max is actually declared on the main axis (including in overrides), so paywalls without min/max keep the exact same layout path as before. - Modifier.size honors Fit/Fill min/max - Margins extend Fit/Fill min/max like they do for Fixed - Media keep their aspect ratio while being clamped to min/max - WebView clamps its resolved size - Root stack Fit->Fill conversion preserves min/max
Generated by 🚫 Danger |
…nded cross axis A Fit stack inside the root scroll has an unbounded cross axis, so a cross-axis Fill child had nothing to fill and collapsed to its content. When the constrained layout has such a child, bound it to its own intrinsic cross-axis size (single pass, no re-measure) so Fill children stretch to the largest sibling like flexbox. Modifier.size now clamps the content size to the constraints it resolved so intrinsic measurement honors Fixed/min sizes of empty components.
📸 Snapshot Test632 unchanged
🛸 Powered by Emerge Tools |
…ment
Modifier.layout {} blocks also run for intrinsic queries, with unbounded
constraints. Stretching cross-axis Fill children measures the stack's
intrinsic size, so a nested stack tracking its unbounded main axis flipped
its state on every frame and never settled. Implement the tracker as a
LayoutModifierNode whose intrinsics pass straight through.
0f8fe7d to
20d3d9a
Compare
|
@cursor please review |
|
I posted a review on PR #4217. The flagged merge looks safe: deserialize strips The gaps that will show up once the flag is on: text and other non-stack leaves never call |
ReviewThis is a solid incremental landing. The opt-in story is the right shape: The new layout pieces are thoughtfully built — equal-share allocation that honors mins first, then maxes; hugging a A few things I would treat as follow-ups before turning the flag on, plus one test gap that is worth fixing in this PR. 1. Text (and other non-stack leaves) never resolve parent data
Markdown(
text = text,
modifier = modifier
.size(textState.size, horizontalAlignment = textState.horizontalAlignment)
.padding(textState.margin)Same gap on Text is the most common Fill child. 2.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4217 +/- ##
==========================================
+ Coverage 83.60% 83.62% +0.01%
==========================================
Files 455 455
Lines 18621 18629 +8
Branches 2811 2813 +2
==========================================
+ Hits 15569 15579 +10
+ Misses 2149 2148 -1
+ Partials 903 902 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 20d3d9a. Configure here.
| val contentWidth = placeable.width.coerceIn(widthConstraints.min, widthConstraints.max) | ||
| val contentHeight = placeable.height.coerceIn(heightConstraints.min, heightConstraints.max) | ||
| val layoutWidth = contentWidth.coerceIn(incomingConstraints.minWidth, incomingConstraints.maxWidth) | ||
| val layoutHeight = contentHeight.coerceIn(incomingConstraints.minHeight, incomingConstraints.maxHeight) |
There was a problem hiding this comment.
Min size cannot overflow parent
Medium Severity
The size modifier measures a child at its min when that exceeds the parent, then reports a layout size clamped to the incoming max. Components with Fit/Fill minimums larger than their parent therefore stay parent-sized instead of overflowing, which is the behavior SizeModifierTest and constrained fill allocation expect.
Reviewed by Cursor Bugbot for commit 20d3d9a. Configure here.




Checklist
purchases-iosand hybridsNote
previews were moved to a new branch
Motivation
We want to have more responsive paywalls, to best support that, we should be able to set minimum and maximum sizes.
Description
Wires the new min/max size attributes through the codebase. Puts the bits behind a flag that could cause the SDK to render the changes in production. This way it's a specific opt in until we officially release this. All changes are backward compatible until the flag is on or removed. There are things that need to be iterated on. The flag is there so we can merge this PR and fix those in isolated smaller PRs.
supersedes #4161
Note
Medium Risk
Touches core paywall layout and measurement across stacks and media; behavior is gated at parse time but UI layout changes are substantial and could affect rendering even for paywalls without min/max until the flag is on.
Overview
Adds opt-in paywall min/max sizing via
ENABLE_PAYWALL_MIN_MAX_SIZINGinlocal.properties/ BuildConfig. When the flag is off, JSON deserialization still acceptsmin/maxonFitandFillbut strips them so existing paywalls behave unchanged.When enabled (and in UI either way for layout code paths that read constraints), RevenueCat UI honors limits end-to-end: the custom
Modifier.sizeapplies min/max during measure; margins adjust limits onFit/Fill; image/video sizing uses sharedadjustForMediawith aspect-ratio-aware scaling; WebView content sizing clamps resolved dimensions.Stacks that need more than Row/Column
weightswitch toConstrainedFillLayout(detected byneedsConstrainedFillLayout—limited Fill children, overrides, or Fit stacks with positive minimums plus Fill/SPACE_* children). That layout allocates main-axis space with min/max, hugs content for Fit-with-minimum, passes resolved sizes throughComponentSizeParentDataModifier, and handles scroll/unbounded cross-axis Fill stretching. Horizontal/vertical stacks were simplified to pass child modifiers explicitly;trackMainAxisUnboundedis now a layout node to avoid intrinsic-measure recomposition loops.The root Fit→Fill screen hack now preserves min/max when promoting axes to Fill. Broad unit/UI tests cover deserialization gating, modifiers, margins, media sizing, and constrained-fill distributions.
Reviewed by Cursor Bugbot for commit 20d3d9a. Bugbot is set up for automated code reviews on this repo. Configure here.