Repository navigation
Research iOS: paint safe-area strips with the page background again - #1425
Merged
Merged
Conversation
wry 0.57 (tauri-apps/wry#1824, pulled in by the Tauri 2.12 upgrade) makes the iOS WKWebView non-opaque with a systemBackgroundColor background. The page uses viewport-fit=auto, so the strips by the status bar and home indicator turned plain black (dark) or white (light) instead of the page background. Make the WebView opaque after the first page load so WebKit paints them from the page again, without the white launch flash that an opaque WebView shows before the first paint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 the black (dark mode) or white (light mode) bars above and below Research on iPhone since the Xcode 27.1 / Tauri 2.12 upgrade (PR #1264).
Cause
Tauri 2.12 pulls in wry 0.57, which includes tauri-apps/wry#1824: on iOS the WKWebView is now non-opaque with a
systemBackgroundColorbackground. Our page usesviewport-fit=auto, so WebKit leaves the status-bar and home-indicator strips outside the page. An opaque WebView used to paint those strips with the page background. The non-opaque one shows its own system color there, which is pure black or white instead of#0A0A0A/#FAFAFA.Fix
Set the WKWebView back to opaque in an iOS
on_page_loadhook (src-tauri/src/ios_webview_background.rs). WebKit then paints the strips from the page again. The switch waits for the first page load, so the launch keeps wry's no-white-flash behavior.Verification
Logged in with the Dev test account on the chat screen. The simulator is an iPhone 18 Pro on iOS 27.0. The "PR #1425" build comes from CI (run 41371448478,
research-ioslane). All three builds are installed over the same session.Pixel samples down the left edge (identical on an iOS 26.5 iPhone 17 Pro):
#0A0A0A/#0A0A0A#FAFAFA/#FAFAFA#000000/#0A0A0A#FFFFFF/#FAFAFA#0A0A0A/#0A0A0A#FAFAFA/#FAFAFAsetOpaque:YESon the live WebView. The strips went from#000000to#0A0A0A.#FEFEFE) for about 4 frames before the page paints. This PR goes black, then straight to the page, with no white frame (checked over two launches).cargo check --target aarch64-apple-ios-sim,cargo fmt, and the pre-commit Research tests pass.Not covered by this PR: the signed-out entry pages (gray
#E2E2E2) still show#FAFAFAstrips in light mode, the same as 3.4.5. Those strips use the body background, and the entry pages paint their own gray on top of it. Not tested: in-app theme overrides and rotation.🤖 Generated with Claude Code