Repository navigation
Measure and report embedded content height on iOS - #776
Merged
Merged
Conversation
Wires the sizeToContent spec to a real measurement on iOS. A GeometryReader behind the embedded view reports its height on every layout pass, and the wrapper forwards changes to onSizeChange after a dead band. Three things worth a reviewer's attention: - Height comes from a background GeometryReader rather than a SwiftUI preference. A preference misses the placeholder-to-content transition, which is exactly the case that has to reset a stale height. - parentWidth/parentHeight now return nil when the host has not sized the view, instead of substituting screen bounds. Nil is the SDK's signal for "no parent stated", so it resolves percentages against the real proposal. While self sizing, parentHeight falls back to the window height: it must not depend on the box the host just set, or measurement and layout feed each other. - Unavailability is signalled from a zero-sized placeholder rather than from a measured zero, which is ambiguous mid-layout. Verified on a simulator: content self-sizes, and dismissing it collapses the view instead of leaving a stale gap. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
crow
approved these changes
Oct 14, 2026
jyaganeh
approved these changes
Oct 15, 2026
The measurement runs on every layout pass, so a fixed-size view was emitting onSizeChange too. The spec documents the event as emitted only while sizing to content, and Android only listens then. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…zing # Conflicts: # ios/AirshipEmbeddedViewWrapper.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What do these changes do?
Measure the embedded content on iOS and report its height through
onSizeChange. AGeometryReaderbehind the view reports on every layoutpass, and the wrapper forwards changes once they clear a small dead band.
This also changes how the view describes its parent to the SDK. Previously an
unsized view passed screen bounds; it now passes nil, which is the SDK's own
signal for "no parent stated" and makes it resolve percentage content against
the real proposal instead.
Why are these changes necessary?
Nothing on iOS ever measured the rendered scene, so an app had no way to find
out how tall the content wanted to be.
How did you verify these changes?
Ran the example app on a simulator against a Scene that renders at its natural
height. The view sizes itself to the content, and dismissing the content
collapses it rather than leaving a gap behind.
🤖 Generated with Claude Code