SDK-291 Fix in-app message position in landscape#1074
Merged
Conversation
In-app message width and center were computed from the full parent width, so on notched devices in landscape a message could span or center across the unsafe edge where the Dynamic Island sits. Use the left and right safe-area insets to constrain width and center.x, and center a .center message within the top and bottom safe bounds. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1074 +/- ##
==========================================
- Coverage 71.61% 71.60% -0.01%
==========================================
Files 114 114
Lines 9462 9467 +5
==========================================
+ Hits 6776 6779 +3
- Misses 2686 2688 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
In-app HTML messages could be mispositioned after rotating to landscape on notched devices. The webview width and center were computed from the full parent width, ignoring the side safe-area inset where the Dynamic Island or notch sits.
Changes
center.xusingsafeAreaInsets.leftand.right, so a message stays inside the safe area in any orientation..centermessage within the top and bottom safe-area bounds..centerand.full) so a future case fails to compile until handled.Impact
Testing
How to test:
./agent_test.sh IterableHtmlMessageViewControllerTests(34 tests, including new portrait and landscape cases).Visual check still needed (not covered by unit tests): on a notched device or simulator, show a top, bottom, and center HTML in-app message, rotate to both landscape orientations, and confirm the message stays inside the safe area and clear of the Dynamic Island and home indicator. The unit tests verify the inset math but cannot confirm live rotation behavior or how customer HTML renders in the adjusted frame.
Jira: https://iterable.atlassian.net/browse/SDK-291