From 13875d02624253f97bffa534be0473e1288afada Mon Sep 17 00:00:00 2001 From: Erwan Leboucher Date: Thu, 20 Aug 2026 00:05:10 +0200 Subject: [PATCH] fix(android): pad mobile sheet from injected safe-area inset The sheet container fell back to env(safe-area-inset-bottom) directly, which Android WebView reports as 0px on devices with three-button navigation and certain WebView versions. Prefer the edge-to-edge plugin's injected --safe-area-inset-bottom (native insets) first, matching the rest of the app. --- src/app/features/room/message/styles.css.ts | 3 ++- src/app/styles/edgeToEdgeInsets.test.ts | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/app/features/room/message/styles.css.ts b/src/app/features/room/message/styles.css.ts index 0086205f4..267d28525 100644 --- a/src/app/features/room/message/styles.css.ts +++ b/src/app/features/room/message/styles.css.ts @@ -125,7 +125,8 @@ export const MessageMobileOptionsContainer = style({ borderTopLeftRadius: toRem(20), borderTopRightRadius: toRem(20), boxShadow: '0 -4px 24px rgba(0, 0, 0, 0.15)', - paddingBottom: 'var(--mobile-sheet-safe-bottom, env(safe-area-inset-bottom, 0px))', + paddingBottom: + 'var(--mobile-sheet-safe-bottom, var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)))', }); export const MessageMobileOptionsContainerContained = style({ diff --git a/src/app/styles/edgeToEdgeInsets.test.ts b/src/app/styles/edgeToEdgeInsets.test.ts index 6c5121a74..07c869945 100644 --- a/src/app/styles/edgeToEdgeInsets.test.ts +++ b/src/app/styles/edgeToEdgeInsets.test.ts @@ -57,6 +57,17 @@ describe('android edge-to-edge inset contract', () => { expect(sheet.match(/zIndex,/g)).toHaveLength(2); }); + it('falls back to the injected edge-to-edge inset before env() for the mobile sheet', () => { + const messageStyles = readWorkspaceFile('src/app/features/room/message/styles.css.ts'); + + expect(messageStyles).toContain( + "'var(--mobile-sheet-safe-bottom, var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)))'" + ); + expect(messageStyles).not.toContain( + "'var(--mobile-sheet-safe-bottom, env(safe-area-inset-bottom, 0px))'" + ); + }); + it('uses the App shell as the only safe-area owner', () => { const appShell = readWorkspaceFile('src/app/components/app-shell/AppShell.tsx'); const systemBarShell = readWorkspaceFile('src/app/components/app-shell/SystemBarShell.tsx');