From 476bebfe856b41a86cfe759704c8c7d5c7123325 Mon Sep 17 00:00:00 2001 From: Sarto Date: Fri, 8 May 2026 13:37:32 +0330 Subject: [PATCH] fix: adjust background color and scroll view insets for improved layout --- ios/Thefeed/ContentView.swift | 9 +++++++-- ios/Thefeed/WebView.swift | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ios/Thefeed/ContentView.swift b/ios/Thefeed/ContentView.swift index 9ab0327..43c5293 100644 --- a/ios/Thefeed/ContentView.swift +++ b/ios/Thefeed/ContentView.swift @@ -5,10 +5,15 @@ struct ContentView: View { var body: some View { ZStack { - Color.black.ignoresSafeArea() + // Background fills the notch + home-indicator area with the + // same color as the page so there's no visible band; the + // WebView itself stays *inside* the safe area so the page's + // CSS env(safe-area-inset-*) returns 0 and we don't end up + // double-padding (system inset + body padding). + Color(red: 0.07, green: 0.09, blue: 0.13).ignoresSafeArea() if server.port > 0 { WebView(url: URL(string: "http://127.0.0.1:\(server.port)")!) - .ignoresSafeArea() + .ignoresSafeArea(.keyboard) } else if let err = server.lastError { VStack(spacing: 12) { Text("startup failed").font(.headline).foregroundColor(.white) diff --git a/ios/Thefeed/WebView.swift b/ios/Thefeed/WebView.swift index f3f0469..1a385b8 100644 --- a/ios/Thefeed/WebView.swift +++ b/ios/Thefeed/WebView.swift @@ -19,6 +19,12 @@ struct WebView: UIViewRepresentable { let view = WKWebView(frame: .zero, configuration: cfg) view.allowsBackForwardNavigationGestures = true view.scrollView.bounces = true + // Don't double-pad the bottom: the page already adds + // env(safe-area-inset-bottom) via CSS; the WebView's automatic + // content inset would stack on top and leave a huge gap. + view.scrollView.contentInsetAdjustmentBehavior = .never + view.scrollView.contentInset = .zero + view.scrollView.scrollIndicatorInsets = .zero view.navigationDelegate = context.coordinator context.coordinator.webView = view