Skip to content

fix(ios): keep the web view inside the safe area - #49

Merged
funnycups merged 12 commits into
funnycups:releasefrom
AX995:fix/ios-safe-area-webview
Oct 29, 2026
Merged

funnycups merged 12 commits into
funnycups:releasefrom
AX995:fix/ios-safe-area-webview

Conversation

@AX995

@AX995 AX995 commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

What

The iOS shell pins its WKWebView to view instead of the safe area:

webView.leadingAnchor.constraint(equalTo: view.leadingAnchor)
webView.topAnchor.constraint(equalTo: view.topAnchor)
webView.bottomAnchor.constraint(equalTo: view.bottomAnchor)

The web layer declares viewport-fit=cover but never uses env(safe-area-inset-*) (the string safe-area-inset does not appear anywhere in public/index.html), and the viewport meta also sets maximum-scale=1.0, user-scalable=no, so the page cannot be zoomed out either.

On a Dynamic Island device the top bar renders under the status bar and the message composer under the home indicator. Those strips belong to the system, so the taps never reach the page: the settings button and the send button are unreachable.

Fix

Pin the web view to safeAreaLayoutGuide and give the hosting view a matching background so the inset strips do not flash white:

view.backgroundColor = .systemBackground
NSLayoutConstraint.activate([
    webView.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor),
    webView.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor),
    webView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor),
    webView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor),
])

The insets are resolved by UIKit per device, so nothing is hard-coded: rotation, iPad and devices without a notch keep working (the safe area there is just the status-bar inset).

How to test

  1. Build the unsigned IPA and install it with SideStore/AltStore on a notched or Dynamic Island device (tested on iPhone 17 Pro Max).
  2. Open the app: the top bar sits below the status bar, the composer above the home indicator.
  3. Tap the settings gear, the close button and the send button: all of them respond.
  4. Rotate to landscape: the layout still fits and nothing is clipped.

Notes

  • Verified on a CI build of release plus this patch (unsigned IPA, installed through SideStore).
  • The branch also carries a few fork-only CI commits that cancel each other out, so the net diff is the single file above.

@funnycups
funnycups merged commit af2b026 into funnycups:release Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants