[PR #8105] [MERGED] fix(mobile): keep the app out from under the camera on a sideways phone #8106

Closed
opened 2026-10-24 04:10:25 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8105
Author: @SpicyMarinara
Created: 10/22/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @SpicyMarinara

Base: staging ← Head: claude/landscape-camera-safe-area


📝 Commits (4)

  • c648dee fix(mobile): keep the app out from under the camera on a sideways phone
  • 139faf4 fix(mobile): slide phone sheets fully off-screen past the camera strip
  • a9e909b fix(mobile): anchor the panel selection bar to its sheet and fade the detail sheet
  • ea99fbe test(mobile): tighten the camera-strip proofs and scope the Android note

📊 Changes

20 files changed (+334 additions, -47 deletions)

View changed files

📝 docs/development/ios-pwa-safe-area.md (+12 -0)
📝 e2e/core-flows.e2e.ts (+188 -0)
📝 packages/client/src/components/chat/ChatResourceMobileDropDock.tsx (+1 -1)
📝 packages/client/src/components/chat/ConversationMessageShared.tsx (+1 -1)
📝 packages/client/src/components/chat/YouTubePlayer.tsx (+3 -1)
📝 packages/client/src/components/game-assets/FileEditorModal.tsx (+1 -1)
📝 packages/client/src/components/layout/AppShell.tsx (+35 -14)
📝 packages/client/src/components/layout/GlobalOmnibar.tsx (+1 -1)
📝 packages/client/src/components/layout/PersonalExtensionContributionsMenu.tsx (+1 -1)
📝 packages/client/src/components/layout/TopBar.tsx (+1 -1)
📝 packages/client/src/components/presets/PresetVariablesEditor.tsx (+1 -1)
📝 packages/client/src/components/ui/AppBanner.tsx (+1 -1)
📝 packages/client/src/components/ui/AvatarCropWidget.tsx (+1 -1)
📝 packages/client/src/components/ui/ExpandedTextarea.tsx (+1 -1)
📝 packages/client/src/components/ui/FloatingWindow.tsx (+2 -2)
📝 packages/client/src/components/ui/MacroTextarea.tsx (+2 -2)
📝 packages/client/src/components/ui/Modal.tsx (+2 -2)
📝 packages/client/src/styles/globals.css (+28 -11)
📝 packages/client/src/styles/mari.css (+3 -2)
📝 scripts/regressions/mobile-safe-area-inset.regression.ts (+49 -3)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

No issue was opened. The maintainer reported this directly from an iPhone and asked for a fix. Translated-docs follow-up: https://github.com/Pasta-Devs/Marinara-Engine/issues/8106.

Why this change

On an iPhone turned to landscape, Marinara Engine ran underneath the camera (notch or Dynamic Island), so part of the UI was covered. In portrait, the app keeps a strip in the page-backing colour where the status bar sits. The maintainer asked for the same in landscape, flipped to the sides.

The cause is old. Since an early alpha, the body has had padding-left/right: env(safe-area-inset-left/right) in the phone layout. But the app shell is fixed inset-0, and on iOS it is position: absolute with no left or right, so it always ignored that padding and spanned the whole width.

What changed

  • On a phone turned sideways, Marinara Engine now stops short of the camera on both sides. The two side strips show the same page-backing colour as the status-bar strip in portrait. iPhone reports the inset on both sides, so both get a strip whichever way you turn it.

  • Overlays keep out of the camera too:

    • the chat list, settings, detail editors and tracker sheet;
    • dialogs, the search/Professor Mari window and the full-screen text editor;
    • the selection bar, the chat drop dock, the floating YouTube player and the extension menu;
    • the close buttons on full-screen image viewers.

    Dimmed backgrounds stay out of the strips, as they stay below the status-bar strip in portrait.

  • Phone sheets now slide in and out from fully off-screen, so no slice of them shows in a strip while they move.

  • The app's decorative stars stay inside the app instead of floating in the strips.

  • Nothing changes in portrait, on iPad, on desktop or in the Android app. Those report no side insets; Android keeps pages clear of the cutout itself.

For developers:

  • The side insets are read from env() once, into --mari-safe-area-inset-left/right (globals.css). Everything else uses these variables.
  • scripts/regressions/mobile-safe-area-inset.regression.ts now rejects raw side env() anywhere else, and pins the shell rule and the five phone sheets and backdrops (MOBILE_SHELL_PANEL_X_CLASS).
  • Rules inside the shell that added the inset themselves (TopBar padding under 768px, the roleplay transcript, the Mari status pill) are plain values now, so the inset is never applied twice.
  • docs/development/ios-pwa-safe-area.md has a new "Landscape: the camera's side insets" section.

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

Agent-run checks on head ea99fbef1 (earlier revisions where noted):

  • pnpm check exited 0.
  • pnpm regression: 1019/1019 passed (first revision).
  • node scripts/run-regressions.mjs --filter mobile-safe-area-inset passed.
  • New e2e a phone turned sideways keeps the app out from under its camera (874×402, both mobile projects):
    • mobile-chromium emulates real env() insets of 59px through the DevTools Protocol (Emulation.setSafeAreaInsetsOverride).
    • mobile-webkit, which takes the iOS absolute-shell path, sets the variables instead.
    • Checked: the shell sits at x=59 and is 756px wide; the TopBar and every bar button, Home's tabs, the chat list sheet and the wide FAQ dialog panel stay inside 59–815.
    • Checked: neither strip is part of the app, both paint the TopBar's backing colour, and nothing in the app paints into them.
    • With insets back at 0, the shell is full width again.
  • Negative controls: without the shell rule the test fails (x=0 instead of 59), and without the dialog's side padding it fails on the FAQ panel.
  • Core Home and top-bar specs (home shell, landscape compact chrome, typing in a package tab, mobile topbar, mobile composer viewport) on desktop-chromium, mobile-chromium and mobile-webkit, one worker: 13 passed, 5 skipped by design.
  • e2e/phone-bubbles.e2e.ts and e2e/command-palette.e2e.ts on both mobile projects: 33 passed, 27 skipped by design (first revision).
  • pnpm smoke:ui passed.
  • In one parallel run (3 workers sharing one server), installed Home destinations appear as browser tabs failed once on mobile-webkit. It was waiting for an accent colour that another test had changed. It passes alone (2/2), and CI runs one worker per shard.
  • Screenshots with emulated 59px insets show Home and the chat list clear of both strips, and the strips plain.

Manual verification notes

Still needs a human:

  • Manually verify on a real iPhone (Safari and the home-screen app), turned both ways: nothing sits under the camera, and the side strips match the portrait status-bar strip.
  • Manually verify on that iPhone: the chat list, settings, a character editor, the tracker, a wide dialog (FAQ) and the search/Professor Mari window all stay clear of the camera.
  • Manually verify the keyboard on that iPhone: open it in a chat and in an editor while sideways (the iOS visual-viewport path).
  • Manually verify Firefox on Android in landscape with 3-button navigation, looking for an empty band beside the navigation bar. Gecko misreports the bottom inset (#5665), and it's unverified whether it does the same for the sides.
  • Manually verify that portrait, iPad and desktop look unchanged.

Review notes

  • Local CodeRabbit: 0 findings on 139faf480. 4 minor on a9e909b1f, all addressed in the head commit. 1 on ea99fbef1, dismissed: it flags the tracker sheet's bg-zinc-950/95 palette colour, which is unchanged and predates this PR (the only edit to that line removed w-screen). Theming the tracker sheet is out of scope here.
  • Dottore's first review found two defects, both fixed in a9e909b1f:
    • Selection bar inset twice. The panel's selection bar took the right inset again inside an already-inset sheet. It is right-0 again, and the chats/settings sheet is contain: layout, so on iOS (where that sheet's blur is off) it is still the bar's frame. Today framer-motion's own styles already make the sheet that frame, so contain: layout pins down existing behaviour rather than changing it.
    • Detail sheet slide. The phone detail sheet's 24px slide crossed the strip. On phones it now fades only.
    • The sheets rest at x: 0 again, so framer-motion leaves no transform behind.
    • The e2e now checks the selection bar against the panel sheet within 1px, and samples every frame of the detail sheet's entrance. Negative control: restoring the 24px slide fails it (right edge 834 > 815).
  • CodeRabbit's second run raised four minor findings, all addressed in the head commit:
    • Sampler timing. The sampler now waits for the sheet's first frame.
    • Stray-element check (two findings). It now fails on any visible fixed element overlapping a strip, and names it. Negative control: fixed stars fail it.
    • Android note. The doc scopes the zero-inset claim to Marinara's Android app.
  • A local multi-pass review with adversarial verification confirmed two minor findings, both fixed in 139faf480:
    • Sheets slid by their own width, leaving a slice in the strip while moving.
    • The dialog check measured a narrow dialog that passed either way.
  • Rejected:
    • Gecko side-inset misreporting is an unverified premise; it's listed above as a manual check, and the variable is the upgrade path.
    • A regression-scan blind spot with image/* strings is a nit in a lint-style guard.
    • Translated docs are handled by the follow-up issue.
  • Not changed here (narrow, lower risk):
    • The game storyboard viewer clamps to innerWidth with 8px margins.
    • The tutorial's tooltip clamp uses 12px margins.
    • Two max-w-3xl dialogs overlap the inset by about 6px.
    • The World Maps package's full-screen editor is package-owned DOM.
  • The rest of docs/development/ios-pwa-safe-area.md is out of date: its viewport tag and interactive-widget advice no longer match index.html. That needs a separate docs pass.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) 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)

docs/development/ios-pwa-safe-area.md has a new section; translations are tracked in https://github.com/Pasta-Devs/Marinara-Engine/issues/8106. No version bump.

UI evidence (if applicable)

Local Playwright screenshots (Home and the chat list at 874×402 with emulated 59px insets) are not attached. Please use the manual checks above.

🤖 Generated with Claude Code


🔄 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/8105 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `claude/landscape-camera-safe-area` --- ### 📝 Commits (4) - [`c648dee`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c648dee915ead14f66eaede73651b07fba75ff85) fix(mobile): keep the app out from under the camera on a sideways phone - [`139faf4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/139faf480a46a1c2b3913eb313643ca9d1a0ed7f) fix(mobile): slide phone sheets fully off-screen past the camera strip - [`a9e909b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a9e909b1ff7ab2dd5f09a548408d71cee9827cb6) fix(mobile): anchor the panel selection bar to its sheet and fade the detail sheet - [`ea99fbe`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ea99fbef1b8033baeb01808afef1c0b99dfc2c75) test(mobile): tighten the camera-strip proofs and scope the Android note ### 📊 Changes **20 files changed** (+334 additions, -47 deletions) <details> <summary>View changed files</summary> 📝 `docs/development/ios-pwa-safe-area.md` (+12 -0) 📝 `e2e/core-flows.e2e.ts` (+188 -0) 📝 `packages/client/src/components/chat/ChatResourceMobileDropDock.tsx` (+1 -1) 📝 `packages/client/src/components/chat/ConversationMessageShared.tsx` (+1 -1) 📝 `packages/client/src/components/chat/YouTubePlayer.tsx` (+3 -1) 📝 `packages/client/src/components/game-assets/FileEditorModal.tsx` (+1 -1) 📝 `packages/client/src/components/layout/AppShell.tsx` (+35 -14) 📝 `packages/client/src/components/layout/GlobalOmnibar.tsx` (+1 -1) 📝 `packages/client/src/components/layout/PersonalExtensionContributionsMenu.tsx` (+1 -1) 📝 `packages/client/src/components/layout/TopBar.tsx` (+1 -1) 📝 `packages/client/src/components/presets/PresetVariablesEditor.tsx` (+1 -1) 📝 `packages/client/src/components/ui/AppBanner.tsx` (+1 -1) 📝 `packages/client/src/components/ui/AvatarCropWidget.tsx` (+1 -1) 📝 `packages/client/src/components/ui/ExpandedTextarea.tsx` (+1 -1) 📝 `packages/client/src/components/ui/FloatingWindow.tsx` (+2 -2) 📝 `packages/client/src/components/ui/MacroTextarea.tsx` (+2 -2) 📝 `packages/client/src/components/ui/Modal.tsx` (+2 -2) 📝 `packages/client/src/styles/globals.css` (+28 -11) 📝 `packages/client/src/styles/mari.css` (+3 -2) 📝 `scripts/regressions/mobile-safe-area-inset.regression.ts` (+49 -3) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue No issue was opened. The maintainer reported this directly from an iPhone and asked for a fix. Translated-docs follow-up: https://github.com/Pasta-Devs/Marinara-Engine/issues/8106. ## Why this change On an iPhone turned to landscape, Marinara Engine ran underneath the camera (notch or Dynamic Island), so part of the UI was covered. In portrait, the app keeps a strip in the page-backing colour where the status bar sits. The maintainer asked for the same in landscape, flipped to the sides. The cause is old. Since an early alpha, the body has had `padding-left/right: env(safe-area-inset-left/right)` in the phone layout. But the app shell is `fixed inset-0`, and on iOS it is `position: absolute` with no left or right, so it always ignored that padding and spanned the whole width. ## What changed - **On a phone turned sideways, Marinara Engine now stops short of the camera on both sides.** The two side strips show the same page-backing colour as the status-bar strip in portrait. iPhone reports the inset on both sides, so both get a strip whichever way you turn it. - Overlays keep out of the camera too: - the chat list, settings, detail editors and tracker sheet; - dialogs, the search/Professor Mari window and the full-screen text editor; - the selection bar, the chat drop dock, the floating YouTube player and the extension menu; - the close buttons on full-screen image viewers. Dimmed backgrounds stay out of the strips, as they stay below the status-bar strip in portrait. - Phone sheets now slide in and out from fully off-screen, so no slice of them shows in a strip while they move. - The app's decorative stars stay inside the app instead of floating in the strips. - Nothing changes in portrait, on iPad, on desktop or in the Android app. Those report no side insets; Android keeps pages clear of the cutout itself. For developers: - The side insets are read from `env()` once, into `--mari-safe-area-inset-left/right` (`globals.css`). Everything else uses these variables. - `scripts/regressions/mobile-safe-area-inset.regression.ts` now rejects raw side `env()` anywhere else, and pins the shell rule and the five phone sheets and backdrops (`MOBILE_SHELL_PANEL_X_CLASS`). - Rules inside the shell that added the inset themselves (TopBar padding under 768px, the roleplay transcript, the Mari status pill) are plain values now, so the inset is never applied twice. - `docs/development/ios-pwa-safe-area.md` has a new "Landscape: the camera's side insets" section. ## 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` Agent-run checks on head `ea99fbef1` (earlier revisions where noted): - `pnpm check` exited 0. - `pnpm regression`: 1019/1019 passed (first revision). - `node scripts/run-regressions.mjs --filter mobile-safe-area-inset` passed. - **New e2e `a phone turned sideways keeps the app out from under its camera`** (874×402, both mobile projects): - mobile-chromium emulates real `env()` insets of 59px through the DevTools Protocol (`Emulation.setSafeAreaInsetsOverride`). - mobile-webkit, which takes the iOS absolute-shell path, sets the variables instead. - Checked: the shell sits at x=59 and is 756px wide; the TopBar and every bar button, Home's tabs, the chat list sheet and the wide FAQ dialog panel stay inside 59–815. - Checked: neither strip is part of the app, both paint the TopBar's backing colour, and nothing in the app paints into them. - With insets back at 0, the shell is full width again. - **Negative controls:** without the shell rule the test fails (x=0 instead of 59), and without the dialog's side padding it fails on the FAQ panel. - Core Home and top-bar specs (home shell, landscape compact chrome, typing in a package tab, mobile topbar, mobile composer viewport) on desktop-chromium, mobile-chromium and mobile-webkit, one worker: 13 passed, 5 skipped by design. - `e2e/phone-bubbles.e2e.ts` and `e2e/command-palette.e2e.ts` on both mobile projects: 33 passed, 27 skipped by design (first revision). - `pnpm smoke:ui` passed. - In one parallel run (3 workers sharing one server), `installed Home destinations appear as browser tabs` failed once on mobile-webkit. It was waiting for an accent colour that another test had changed. It passes alone (2/2), and CI runs one worker per shard. - Screenshots with emulated 59px insets show Home and the chat list clear of both strips, and the strips plain. ### Manual verification notes Still needs a human: - Manually verify on a real iPhone (Safari and the home-screen app), turned both ways: nothing sits under the camera, and the side strips match the portrait status-bar strip. - Manually verify on that iPhone: the chat list, settings, a character editor, the tracker, a wide dialog (FAQ) and the search/Professor Mari window all stay clear of the camera. - Manually verify the keyboard on that iPhone: open it in a chat and in an editor while sideways (the iOS visual-viewport path). - Manually verify Firefox on Android in landscape with 3-button navigation, looking for an empty band beside the navigation bar. Gecko misreports the bottom inset (#5665), and it's unverified whether it does the same for the sides. - Manually verify that portrait, iPad and desktop look unchanged. ## Review notes - Local CodeRabbit: 0 findings on `139faf480`. 4 minor on `a9e909b1f`, all addressed in the head commit. 1 on `ea99fbef1`, dismissed: it flags the tracker sheet's `bg-zinc-950/95` palette colour, which is unchanged and predates this PR (the only edit to that line removed `w-screen`). Theming the tracker sheet is out of scope here. - Dottore's first review found two defects, both fixed in `a9e909b1f`: - **Selection bar inset twice.** The panel's selection bar took the right inset again inside an already-inset sheet. It is `right-0` again, and the chats/settings sheet is `contain: layout`, so on iOS (where that sheet's blur is off) it is still the bar's frame. Today framer-motion's own styles already make the sheet that frame, so `contain: layout` pins down existing behaviour rather than changing it. - **Detail sheet slide.** The phone detail sheet's 24px slide crossed the strip. On phones it now fades only. - The sheets rest at `x: 0` again, so framer-motion leaves no transform behind. - The e2e now checks the selection bar against the panel sheet within 1px, and samples every frame of the detail sheet's entrance. Negative control: restoring the 24px slide fails it (right edge 834 > 815). - CodeRabbit's second run raised four minor findings, all addressed in the head commit: - **Sampler timing.** The sampler now waits for the sheet's first frame. - **Stray-element check** (two findings). It now fails on any visible fixed element overlapping a strip, and names it. Negative control: fixed stars fail it. - **Android note.** The doc scopes the zero-inset claim to Marinara's Android app. - A local multi-pass review with adversarial verification confirmed two minor findings, both fixed in `139faf480`: - Sheets slid by their own width, leaving a slice in the strip while moving. - The dialog check measured a narrow dialog that passed either way. - Rejected: - Gecko side-inset misreporting is an unverified premise; it's listed above as a manual check, and the variable is the upgrade path. - A regression-scan blind spot with `image/*` strings is a nit in a lint-style guard. - Translated docs are handled by the follow-up issue. - Not changed here (narrow, lower risk): - The game storyboard viewer clamps to `innerWidth` with 8px margins. - The tutorial's tooltip clamp uses 12px margins. - Two max-w-3xl dialogs overlap the inset by about 6px. - The World Maps package's full-screen editor is package-owned DOM. - The rest of `docs/development/ios-pwa-safe-area.md` is out of date: its viewport tag and `interactive-widget` advice no longer match `index.html`. That needs a separate docs pass. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) 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) `docs/development/ios-pwa-safe-area.md` has a new section; translations are tracked in https://github.com/Pasta-Devs/Marinara-Engine/issues/8106. No version bump. ## UI evidence (if applicable) Local Playwright screenshots (Home and the chat list at 874×402 with emulated 59px insets) are not attached. Please use the manual checks above. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:10:25 +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#8106
No description provided.