diff --git a/src/app/globals.css b/src/app/globals.css index 6a6bda59..b0c43984 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -338,3 +338,17 @@ html { html { overflow-x: clip; } + +/* iOS in-app WebView (Telegram, Instagram, Facebook, Twitter, TikTok) + downgrade only: drop sticky on the site header so the iOS 26 WebKit + jitter bug (bugs.webkit.org/297779) cannot expose a gap at the top. + The `ios-webview` class is set by an inline script in layout.tsx + based on userAgent (iOS device with no `Safari/` token = WebView). + Regular mobile Safari / Chrome iOS keep sticky because the symptom + does not visibly trigger there. Desktop is sticky everywhere. */ +@media (max-width: 767px) { + html.ios-webview .site-header-root { + position: relative; + top: auto; + } +} diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 6ae2e892..84324b72 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -124,6 +124,18 @@ export default function RootLayout({ __html: `(function(){try{var t=localStorage.getItem('ocb-theme');var d=t==='dark'||(!t&&window.matchMedia('(prefers-color-scheme: dark)').matches);if(d)document.documentElement.classList.add('dark');}catch(e){}})();`, }} /> + {/* Detect iOS in-app WebView (Telegram, Instagram, FB, Twitter, etc.). + These hosts hit the iOS 26 WebKit fixed/sticky jitter bug + (bugs.webkit.org/297779) harder than regular Safari because their + own URL-bar overlay animates the layout viewport on top of the + WebKit regression. CSS below downgrades the site header to + non-sticky only when this class is present. Inline so the class + is on the html element before React hydrates — no flash. */} +