Repository navigation
refactor: [SDK-5661] extract IAM horizontal inset math and unit test it - #1791
Open
fadi-george wants to merge 1 commit into
Open
fadi-george wants to merge 1 commit into
fadi-george wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fadi-george
requested review from
abdulraqeeb33 and
nan-li
and removed request for
abdulraqeeb33
November 3, 2026 20:44
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.
Description
One Line Summary
Move the IAM horizontal inset math into a pure
OSInAppMessageInsetshelper and unit test it.Details
Motivation
Follow-up to #1789 review:
horizontalInsetsmixed window lookup, safe area, margin and iOS 27.1 reserved regions, so it was only verified by screenshot runs.Scope
OSInAppMessageInsetstakesmargin,safeArea,width, region frames andisFullscreen, and returns the left/right insets. Same rules as before: each side is max(margin, safe area), full screen ignores the safe area and regions, and a region adds clearance only when it sits inside a side safe area and isn't flush with the edge.OSInAppMessageViewControllerkeeps the scene view and reserved-region lookup (still behind the local protocol shim for Xcode 15.2 builds) and passes plainCGRects in.Testing
Unit testing
OSInAppMessageInsetsTests(12 cases): max vs sum, with and without the width margin, full screen ignoring regions, regions inside, flush with and straddling a side safe area, left, right and both sides, and the 1pt tolerance.OneSignalInAppMessagesTestspasses on an iOS 26.5 simulator (52 tests).Manual testing
Not rerun. This is a pure refactor and the unit tests cover the math. The Duo capture comparison from #1789 can be rerun if wanted.
Affected code checklist
Checklist
Overview
Testing
Final pass
🤖 Generated with Claude Code