[PR #5666] [MERGED] fix(client): stop Gecko's misreported bottom safe-area inset from obscuring mobile panels #6874

Closed
opened 2026-10-23 04:14:29 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5666
Author: @Romuromylus
Created: 8/30/2026
Status: ✅ Merged
Merged: 8/30/2026
Merged by: @Romuromylus

Base: staging ← Head: fix/android-gecko-bottom-safe-area


📝 Commits (5)

  • 495e25f fix(client): stop Gecko's misreported bottom safe-area inset from obscuring mobile panels
  • 7a8d202 fix(client): fold the Gecko safe-area override into the existing @supports block
  • a5ce6c7 Merge branch 'staging' into fix/android-gecko-bottom-safe-area
  • 987c678 Merge branch 'staging' into fix/android-gecko-bottom-safe-area
  • aae4318 Merge branch 'staging' into fix/android-gecko-bottom-safe-area

📊 Changes

5 files changed (+61 additions, -3 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 packages/client/src/components/layout/AppShell.tsx (+2 -1)
📝 packages/client/src/styles/globals.css (+9 -0)
📝 scripts/regressions/agent-catalog-kind-badges.regression.ts (+2 -2)
➕ scripts/regressions/mobile-safe-area-inset.regression.ts (+47 -0)

📄 Description

Linked issue

Closes #5665

Why this change

Firefox on Android shows a large empty band above the system navigation bar on the mobile shell panels (Agents, Connections, Presets, chats sidebar, detail sheets, tracker) and pushes the chat composer up by the same amount, clipping content. The homepage is unaffected (it isn't a fixed shell panel), the APK wrapper only shows the intended 0.5rem breathing floor, and desktop Firefox is clean — exactly the inconsistency reported in #5665.

Root cause: Gecko on Android reports env(safe-area-inset-bottom) as the system navigation-bar height even though its layout viewport already stops above the bar. With viewport-fit=cover in our viewport meta, every consumer of the raw env() value double-compensates: the panel reserves navigation-bar space that the browser has already reserved, producing a dead band of roughly the bar's height. The 3rem cap added in #5508 bounded the band but could not remove it — a ~48px navigation bar sits right at the cap.

What changed

  • packages/client/src/styles/globals.css: publish a 0px override through the existing --mari-safe-area-inset-bottom hook (introduced by the mobile composer keyboard-inset fix) inside a @supports (-moz-appearance: none) block — the same Gecko probe the stylesheet already uses for the Firefox blur workaround. Desktop Firefox reports env() as 0px, so the override is a no-op there; WebKit/Blink don't match the probe at all. Inline-style injections still win over the :root rule (today only the e2e keyboard-inset hook sets the var; the rule keeps that path open for any shell that publishes a real inset later).
  • packages/client/src/components/layout/AppShell.tsx: MOBILE_SHELL_PANEL_BOTTOM_PADDING_CLASS now prefers var(--mari-safe-area-inset-bottom, env(safe-area-inset-bottom)) over raw env(), matching what .chat-input-container already does. Floor (0.5rem) and cap (3rem) are unchanged.
  • scripts/regressions/mobile-safe-area-inset.regression.ts (new): pins the Gecko override block, the composer's var-preference, and the shell-panel class shape.
  • scripts/regressions/agent-catalog-kind-badges.regression.ts: updated the pinned shell-panel class assertion from #5508 to the new var-preferring form.
  • CHANGELOG.md: Unreleased → Fixed entry.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Ran a cross-engine harness against the real built CSS (Playwright, system Chrome): with the override var unset, the shell-panel class computes the 0.5rem floor via the env() fallback; injecting --mari-safe-area-inset-bottom: 48px inline flips the padding to 48px (proving the hook is preferred over env(), the path iOS shells and the e2e test use); 100px stays capped at 3rem.
  • The Gecko @supports probe is byte-identical to the Firefox blur-workaround block already shipping in globals.css, so engine matching is established behavior.
  • node ./scripts/run-regressions.mjs --filter mobile-safe-area-inset and --filter agent-catalog-kind-badges both pass.
  • Verified on a real Android Firefox against a deployment of this branch: Agents / Connections / Presets / chats sidebar and the in-chat composer now sit flush above the navigation bar with only the small 0.5rem floor, matching the APK wrapper; the reported band is gone.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

  • Reporter screenshots in #5665 show the before state (empty band clipping the agent list and chats sidebar above the Android navigation bar).

Follow-ups

  • #5667 — migrate the remaining ~25 raw env(safe-area-inset-bottom) consumers (full-screen modals, drawers, game overlays) to the same override hook so they stop double-padding on Android Firefox too. Kept out of this PR to keep the diff reviewable.

Summary by CodeRabbit

  • Bug Fixes

    • Fixed duplicated bottom spacing above the system navigation bar in Firefox on Android.
    • Improved mobile layout handling for safe-area insets while preserving existing spacing limits.
    • Prevented incorrect bottom padding behavior in Firefox desktop.
  • Tests

    • Added regression coverage for mobile safe-area handling across key layout areas.
  • Documentation

    • Added a changelog entry describing the Firefox-on-Android fix.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/5666 **Author:** [@Romuromylus](https://github.com/Romuromylus) **Created:** 8/30/2026 **Status:** ✅ Merged **Merged:** 8/30/2026 **Merged by:** [@Romuromylus](https://github.com/Romuromylus) **Base:** `staging` ← **Head:** `fix/android-gecko-bottom-safe-area` --- ### 📝 Commits (5) - [`495e25f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/495e25fcbf3598797078de9888aee2238d1e4c46) fix(client): stop Gecko's misreported bottom safe-area inset from obscuring mobile panels - [`7a8d202`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7a8d2021be493473568331515c418ab631add904) fix(client): fold the Gecko safe-area override into the existing @supports block - [`a5ce6c7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a5ce6c715b21a97cee7198c618257d8d25778e86) Merge branch 'staging' into fix/android-gecko-bottom-safe-area - [`987c678`](https://github.com/Pasta-Devs/Marinara-Engine/commit/987c6786788293ff3fab4af787ec9befa02c6623) Merge branch 'staging' into fix/android-gecko-bottom-safe-area - [`aae4318`](https://github.com/Pasta-Devs/Marinara-Engine/commit/aae4318abfa9d0be30a230d924e2a5b5fed3397e) Merge branch 'staging' into fix/android-gecko-bottom-safe-area ### 📊 Changes **5 files changed** (+61 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `packages/client/src/components/layout/AppShell.tsx` (+2 -1) 📝 `packages/client/src/styles/globals.css` (+9 -0) 📝 `scripts/regressions/agent-catalog-kind-badges.regression.ts` (+2 -2) ➕ `scripts/regressions/mobile-safe-area-inset.regression.ts` (+47 -0) </details> ### 📄 Description ## Linked issue Closes #5665 ## Why this change Firefox on Android shows a large empty band above the system navigation bar on the mobile shell panels (Agents, Connections, Presets, chats sidebar, detail sheets, tracker) and pushes the chat composer up by the same amount, clipping content. The homepage is unaffected (it isn't a fixed shell panel), the APK wrapper only shows the intended 0.5rem breathing floor, and desktop Firefox is clean — exactly the inconsistency reported in #5665. Root cause: Gecko on Android reports `env(safe-area-inset-bottom)` as the system navigation-bar height even though its layout viewport already stops **above** the bar. With `viewport-fit=cover` in our viewport meta, every consumer of the raw `env()` value double-compensates: the panel reserves navigation-bar space that the browser has already reserved, producing a dead band of roughly the bar's height. The 3rem cap added in #5508 bounded the band but could not remove it — a ~48px navigation bar sits right at the cap. ## What changed - `packages/client/src/styles/globals.css`: publish a `0px` override through the existing `--mari-safe-area-inset-bottom` hook (introduced by the mobile composer keyboard-inset fix) inside a `@supports (-moz-appearance: none)` block — the same Gecko probe the stylesheet already uses for the Firefox blur workaround. Desktop Firefox reports `env()` as `0px`, so the override is a no-op there; WebKit/Blink don't match the probe at all. Inline-style injections still win over the `:root` rule (today only the e2e keyboard-inset hook sets the var; the rule keeps that path open for any shell that publishes a real inset later). - `packages/client/src/components/layout/AppShell.tsx`: `MOBILE_SHELL_PANEL_BOTTOM_PADDING_CLASS` now prefers `var(--mari-safe-area-inset-bottom, env(safe-area-inset-bottom))` over raw `env()`, matching what `.chat-input-container` already does. Floor (0.5rem) and cap (3rem) are unchanged. - `scripts/regressions/mobile-safe-area-inset.regression.ts` (new): pins the Gecko override block, the composer's var-preference, and the shell-panel class shape. - `scripts/regressions/agent-catalog-kind-badges.regression.ts`: updated the pinned shell-panel class assertion from #5508 to the new var-preferring form. - `CHANGELOG.md`: Unreleased → Fixed entry. ## Validation - [x] `pnpm check` passes locally - [x] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Ran a cross-engine harness against the real built CSS (Playwright, system Chrome): with the override var unset, the shell-panel class computes the 0.5rem floor via the `env()` fallback; injecting `--mari-safe-area-inset-bottom: 48px` inline flips the padding to 48px (proving the hook is preferred over `env()`, the path iOS shells and the e2e test use); `100px` stays capped at 3rem. - The Gecko `@supports` probe is byte-identical to the Firefox blur-workaround block already shipping in `globals.css`, so engine matching is established behavior. - `node ./scripts/run-regressions.mjs --filter mobile-safe-area-inset` and `--filter agent-catalog-kind-badges` both pass. - Verified on a real Android Firefox against a deployment of this branch: Agents / Connections / Presets / chats sidebar and the in-chat composer now sit flush above the navigation bar with only the small 0.5rem floor, matching the APK wrapper; the reported band is gone. ## Docs and release impact - [ ] No docs changes needed - [x] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) - Reporter screenshots in #5665 show the before state (empty band clipping the agent list and chats sidebar above the Android navigation bar). ## Follow-ups - #5667 — migrate the remaining ~25 raw `env(safe-area-inset-bottom)` consumers (full-screen modals, drawers, game overlays) to the same override hook so they stop double-padding on Android Firefox too. Kept out of this PR to keep the diff reviewable. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed duplicated bottom spacing above the system navigation bar in Firefox on Android. * Improved mobile layout handling for safe-area insets while preserving existing spacing limits. * Prevented incorrect bottom padding behavior in Firefox desktop. * **Tests** * Added regression coverage for mobile safe-area handling across key layout areas. * **Documentation** * Added a changelog entry describing the Firefox-on-Android fix. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:14:29 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#6874
No description provided.