fix(ios): strip phantom top inset when presented as a page sheet (#42)#43
Merged
Conversation
A page sheet already sits below the status bar, but CMP 1.11 sources safeDrawing from the UIWindow, so the sheet paid the status-bar inset twice — a ~62pt dead band above the header (iPhone 16 Pro). presentSharingan() now presents an internal sheet variant that provides LocalStripTopInset, and the Scaffold drops the top side of safeDrawing when it is set. The public SharinganViewController() factory is unchanged, so full-screen/embedded hosts keep their top inset. No public API changes (apiCheck + checkApiParity green). Fixes #42 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Kotlin/Native forbids ',' in identifiers; commonTest also compiles for the iOS targets, so the #42 inset test broke compileTestKotlinIosArm64. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Review polish for #42: the raw-VC KDoc now warns that a self-presented page sheet shows the phantom top gap and points at presentSharingan(); the inset test also pins the right side surviving the strip. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Owner
Author
Verification evidence (issue #42)All iOS captures via
The fix: ~62pt gray band above the header (left) is gone (right) — header flush at the sheet top via Verified by two independent agents (behavioral pass + evidence-backed diff review); CI green ×5 including the Android emulator locale-regression suite. 🤖 Generated with Claude Code |
This was referenced Jul 3, 2026
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.







Fixes #42.
Root cause
A page sheet already sits below the status bar, but CMP 1.11 sources
WindowInsets.safeDrawingfrom theUIWindow(62pt on iPhone 16 Pro), not the sheet's own view (0) — so the sheet paid the top inset twice, showing as a ~60pt dead gray band above the header.Fix (entry-point-scoped, no public API change)
commonMain:internal LocalStripTopInsetCompositionLocal + puresharinganContentInsets()helper; theScaffolddrops the top side ofsafeDrawingwhen the local is set.iosMain:presentSharingan()now presents aninternal sharinganSheetViewController()that provides the local astrue. The publicSharinganViewController()factory is byte-for-byte behavior-identical (strip = false), so full-screen/embedded/pushed hosts keep their top inset.Verification
ScreenInsetsTest, written RED-first).:sharingan:testDebugUnitTest,:sharingan:apiCheck,checkApiParityall green locally —internaldeclarations stay off the checked API surface.presentSharingan()sheet shows the header flush at the sheet top (band gone); a directly-createdSharinganViewControllerpresented full-screen still gets its status-bar top inset.Upstream context: known class of CMP inset bug (CMP-7588, JetBrains/compose-multiplatform#4121/#4944); no config flag exists in CMP 1.11, hence the library-side scoped exclusion.
🤖 Generated with Claude Code