[PR #5791] [MERGED] fix(mari): anchor iOS focus surfaces to visual viewport #6934

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5791
Author: @SpicyMarinara
Created: 9/2/2026
Status: ✅ Merged
Merged: 9/2/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/5710-ios-shared-keyboard-viewport


📝 Commits (2)

  • dd31ece test(mari): reproduce shared iOS keyboard displacement
  • 17073dd fix(mari): share iOS keyboard viewport across focus surfaces

📊 Changes

4 files changed (+63 additions, -53 deletions)

View changed files

📝 CHANGELOG.md (+1 -1)
📝 e2e/core-flows.e2e.ts (+46 -41)
📝 packages/client/src/components/layout/AppShell.tsx (+1 -7)
📝 packages/client/src/styles/globals.css (+15 -4)

📄 Description

Linked issue

Closes #5710

Why this change

  • Physical iPhones on current staging still pan the entire app away when the software keyboard focuses the Roleplay composer or a Create Character/Create Persona input.
  • The previous patch compensated one chat-shell displacement but left both the shell and body-portal modals beneath a fixed-position body, so the failure remained shared across focusable surfaces.

What changed

  • Removed the fixed body ancestor on mobile iOS WebKit so focus cannot pan the shared containing block away from the visible screen.
  • Anchored both AppShell and common body-portal Modal overlays to the reported visual viewport in document coordinates.
  • Replaced the old synthetic fixed-body-pan assertion with regression coverage for Roleplay and the auto-focused Create Persona form; the same common Modal covers Create Character.
  • Updated the Unreleased changelog entry for the broader correction.

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

Automated evidence:

  • pnpm check — passed (Impeccable context, localization, formatting, lint, e2e types, and production builds).
  • Focused visual-viewport regression — passed on mobile-webkit and mobile-chromium.
  • pnpm smoke:ui — the new regression passed in both mobile projects. The whole local shared run finished with 387 passed / 217 skipped / 14 unrelated failures; rerunning those failures produced 11 passes and left three unrelated staging failures (desktop provider request delivery, a WebKit overlay intercept, and a 0.6px library control overlap). Required PR checks remain authoritative.

Manual verification notes

  • Manually verify Roleplay composer focus, typing, transcript scrolling, and keyboard dismissal on the affected physical iPhone.
  • Manually verify Create Character and Create Persona name-field focus with the software keyboard on the affected physical iPhone.

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)

  • The linked issue contains the physical-iPhone before/after screenshots. The automated regression checks the Roleplay shell, composer, shared modal, and focused Persona field against the simulated iOS visual viewport.

Summary by CodeRabbit

  • Bug Fixes
    • Improved iPhone keyboard behavior so the app remains aligned with the visible screen when an input is focused.
    • Prevented Roleplay and character creation dialogs from being shifted into the dark document background.
    • Improved positioning of shared dialogs while the iOS keyboard is open.
  • Tests
    • Expanded iOS coverage to verify dialog positioning during keyboard focus.

🔄 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/5791 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/2/2026 **Status:** ✅ Merged **Merged:** 9/2/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/5710-ios-shared-keyboard-viewport` --- ### 📝 Commits (2) - [`dd31ece`](https://github.com/Pasta-Devs/Marinara-Engine/commit/dd31ecec2462f326579b4b876edccd0d85bb3d10) test(mari): reproduce shared iOS keyboard displacement - [`17073dd`](https://github.com/Pasta-Devs/Marinara-Engine/commit/17073dd482fd38fb704171a5d3c3b980e7e05df8) fix(mari): share iOS keyboard viewport across focus surfaces ### 📊 Changes **4 files changed** (+63 additions, -53 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -1) 📝 `e2e/core-flows.e2e.ts` (+46 -41) 📝 `packages/client/src/components/layout/AppShell.tsx` (+1 -7) 📝 `packages/client/src/styles/globals.css` (+15 -4) </details> ### 📄 Description ## Linked issue Closes #5710 ## Why this change - Physical iPhones on current staging still pan the entire app away when the software keyboard focuses the Roleplay composer or a Create Character/Create Persona input. - The previous patch compensated one chat-shell displacement but left both the shell and body-portal modals beneath a fixed-position body, so the failure remained shared across focusable surfaces. ## What changed - Removed the fixed body ancestor on mobile iOS WebKit so focus cannot pan the shared containing block away from the visible screen. - Anchored both AppShell and common body-portal Modal overlays to the reported visual viewport in document coordinates. - Replaced the old synthetic fixed-body-pan assertion with regression coverage for Roleplay and the auto-focused Create Persona form; the same common Modal covers Create Character. - Updated the Unreleased changelog entry for the broader correction. ## 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` Automated evidence: - `pnpm check` — passed (Impeccable context, localization, formatting, lint, e2e types, and production builds). - Focused visual-viewport regression — passed on `mobile-webkit` and `mobile-chromium`. - `pnpm smoke:ui` — the new regression passed in both mobile projects. The whole local shared run finished with 387 passed / 217 skipped / 14 unrelated failures; rerunning those failures produced 11 passes and left three unrelated staging failures (desktop provider request delivery, a WebKit overlay intercept, and a 0.6px library control overlap). Required PR checks remain authoritative. ### Manual verification notes - Manually verify Roleplay composer focus, typing, transcript scrolling, and keyboard dismissal on the affected physical iPhone. - Manually verify Create Character and Create Persona name-field focus with the software keyboard on the affected physical iPhone. ## 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) - The linked issue contains the physical-iPhone before/after screenshots. The automated regression checks the Roleplay shell, composer, shared modal, and focused Persona field against the simulated iOS visual viewport. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved iPhone keyboard behavior so the app remains aligned with the visible screen when an input is focused. - Prevented Roleplay and character creation dialogs from being shifted into the dark document background. - Improved positioning of shared dialogs while the iOS keyboard is open. - **Tests** - Expanded iOS coverage to verify dialog positioning during keyboard focus. <!-- 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:15:01 +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#6934
No description provided.