From 0016dfd9b19ad797c2c85104d518b7864f9723a8 Mon Sep 17 00:00:00 2001 From: Brendan Allan <14191578+Brendonovich@users.noreply.github.com> Date: Wed, 24 Jun 2026 18:21:52 +0800 Subject: [PATCH] fix(app): always apply safe area insets (#33619) --- packages/app/src/components/titlebar.tsx | 6 ------ packages/app/src/index.css | 7 +++++++ packages/app/src/pages/layout-new.tsx | 8 +++++++- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/app/src/components/titlebar.tsx b/packages/app/src/components/titlebar.tsx index 477792d64..ff8bb5574 100644 --- a/packages/app/src/components/titlebar.tsx +++ b/packages/app/src/components/titlebar.tsx @@ -101,10 +101,6 @@ export function Titlebar(props: { update?: TitlebarUpdate }) { const counterZoom = () => (windows() && titlebarZoom() < 1 ? 1 / titlebarZoom() : 1) const minHeight = () => { const height = useV2Titlebar() ? v2TitlebarHeight : legacyTitlebarHeight - if (useV2Titlebar() && mobile()) { - const inset = bottom() ? "env(safe-area-inset-bottom, 0px)" : "env(safe-area-inset-top, 0px)" - return `calc(${height}px + ${inset})` - } if (mac()) return `${height / zoom()}px` if (windows()) return `${height / Math.min(titlebarZoom(), 1)}px` return undefined @@ -246,8 +242,6 @@ export function Titlebar(props: { update?: TitlebarUpdate }) { }} style={{ "min-height": minHeight(), - "padding-top": useV2Titlebar() && mobile() && !bottom() ? "env(safe-area-inset-top, 0px)" : undefined, - "padding-bottom": bottom() ? "env(safe-area-inset-bottom, 0px)" : undefined, "padding-left": mac() && !mobile() ? `${84 / zoom()}px` : 0, width: electronWindows() ? `env(titlebar-area-width, calc(100vw - ${windowsControlsWidth()}))` : undefined, "max-width": electronWindows() diff --git a/packages/app/src/index.css b/packages/app/src/index.css index 88f28c387..467f4ac81 100644 --- a/packages/app/src/index.css +++ b/packages/app/src/index.css @@ -15,6 +15,13 @@ font-style: normal; } +@media (display-mode: standalone) { + /* WebKit excludes safe-area insets from dvh in installed apps. */ + #root { + height: 100vh; + } +} + @layer components { @keyframes session-progress-whip { 0% { diff --git a/packages/app/src/pages/layout-new.tsx b/packages/app/src/pages/layout-new.tsx index 741a9080c..fa5f9c9f9 100644 --- a/packages/app/src/pages/layout-new.tsx +++ b/packages/app/src/pages/layout-new.tsx @@ -32,7 +32,13 @@ export default function NewLayout(props: ParentProps) { } return ( -