From a6408c3f840031b794525bef3a525ad5fe8daab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20Boduro=C4=9Flu?= <80620802+burakboduroglu@users.noreply.github.com> Date: Sun, 23 Aug 2026 23:21:05 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=93=B1=20keep=20modal=20surfaces?= =?UTF-8?q?=20out=20from=20under=20the=20system=20bars=20-=20side=20panels?= =?UTF-8?q?,=20dialogs=20and=20alert=20dialogs=20are=20positioned=20agains?= =?UTF-8?q?t=20the=20raw=20=20=20viewport,=20so=20on=20a=20phone=20their?= =?UTF-8?q?=20header=20=E2=80=94=20title=20and=20close=20button=20?= =?UTF-8?q?=E2=80=94=20sat=20under=20=20=20the=20status=20bar=20and=20thei?= =?UTF-8?q?r=20footer=20behind=20the=20gesture=20bar;=20a=20form=20that=20?= =?UTF-8?q?opens=20=20=20with=20no=20visible=20way=20to=20close=20it=20rea?= =?UTF-8?q?ds=20as=20the=20app=20having=20frozen=20-=20all=20three=20now?= =?UTF-8?q?=20inset=20themselves=20by=20the=20safe=20area,=20and=20dialogs?= =?UTF-8?q?=20cap=20their=20=20=20height=20at=20the=20inset=20box=20instea?= =?UTF-8?q?d=20of=2090vh=20so=20a=20tall=20one=20is=20never=20clipped=20-?= =?UTF-8?q?=20the=20gesture-bar=20height=20is=20read=20from=20the=20shell'?= =?UTF-8?q?s=20HezarfenShell=20bridge=20in=20=20=20the=20boot=20script=20r?= =?UTF-8?q?ather=20than=20waiting=20to=20be=20pushed=20in:=20a=20value=20p?= =?UTF-8?q?ushed=20into=20=20=20a=20document=20dies=20with=20that=20docume?= =?UTF-8?q?nt,=20so=20a=20reload=20lost=20the=20inset=20and=20the=20=20=20?= =?UTF-8?q?tab=20bar=20dropped=20back=20under=20the=20gesture=20pill=20-?= =?UTF-8?q?=20the=20nav=20sheet=20is=20only=20role=3Ddialog=20while=20it?= =?UTF-8?q?=20is=20open=20=E2=80=94=20mounted=20permanently,=20=20=20it=20?= =?UTF-8?q?was=20answering=20every=20[role=3Ddialog]=20query=20and=20sitti?= =?UTF-8?q?ng=20in=20the=20=20=20accessibility=20tree=20beside=20whatever?= =?UTF-8?q?=20modal=20was=20really=20open?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 8 ++++++++ src/components/layout/mobile-nav-sheet.tsx | 7 +++++-- src/components/ui/alert-dialog.tsx | 3 ++- src/components/ui/dialog.tsx | 6 ++++-- src/components/ui/side-panel.tsx | 4 ++++ 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index fe738c3..b4d4be0 100644 --- a/index.html +++ b/index.html @@ -22,6 +22,14 @@ if (dark) document.documentElement.classList.add("dark"); const locale = localStorage.getItem("hezarfen.locale"); if (locale === "en" || locale === "tr") document.documentElement.lang = locale; + // Android reports only the display cutout through CSS env(), so the + // gesture bar is invisible to the page. The Tauri shell exposes its + // height here; read before first paint so nothing renders under it. + // Absent in a browser, where env(safe-area-inset-bottom) is enough. + const shell = window.HezarfenShell; + if (shell && typeof shell.bottomInsetPx === "function") { + document.documentElement.style.setProperty("--android-nav-inset", shell.bottomInsetPx() + "px"); + } } catch {} })(); diff --git a/src/components/layout/mobile-nav-sheet.tsx b/src/components/layout/mobile-nav-sheet.tsx index 1441991..f91d1d7 100644 --- a/src/components/layout/mobile-nav-sheet.tsx +++ b/src/components/layout/mobile-nav-sheet.tsx @@ -82,8 +82,11 @@ export function MobileNavSheet(props: { />