[PR #5816] [MERGED] fix(mari): retain iOS viewport baseline across keyboard focus #6953

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

📋 Pull Request Information

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

Base: staging ← Head: fix/5710-ios-repeat-keyboard-focus


📝 Commits (2)

  • f93832b test(mari): reproduce repeated iOS keyboard focus
  • 8f90868 fix(mari): retain iOS keyboard viewport baseline

📊 Changes

3 files changed (+67 additions, -6 deletions)

View changed files

📝 CHANGELOG.md (+1 -1)
📝 e2e/core-flows.e2e.ts (+63 -3)
📝 packages/client/src/components/layout/AppShell.tsx (+3 -2)

📄 Description

Linked issue

Closes #5710

Why this change

  • Physical-iPhone testing shows the Roleplay composer is positioned correctly only for the first keyboard focus. After dismissing the keyboard, later focus cycles move the visible viewport away from the app shell and expose the dark document backing.
  • The existing regression modeled only one focus cycle and kept window.innerHeight stable, missing WebKit's later state where the layout viewport can collapse to the keyboard-shrunken visual viewport height.

What changed

  • Retain the largest settled viewport height as the iOS layout baseline when clamping the document-coordinate visual viewport offset; Android and desktop retain their existing calculation.
  • Extend the iPhone-sized WebKit regression through keyboard open → dismiss → reopen while window.innerHeight matches the shrunken visual viewport.
  • Update the Unreleased changelog entry to cover repeated keyboard cycles.

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

  • pnpm check — passed (Impeccable context, localization, Prettier, lint, e2e types, and production builds).
  • Focused viewport regression — passed in both mobile-webkit and mobile-chromium.
  • The regression was proven red first on untouched staging at the second focus: viewport height 360px, expected shell top 299px, actual shell top 0px.
  • Full pnpm smoke:ui ran all 618 cases: the target passed in both mobile projects; the shared three-worker run ended with 11 unrelated failures. Ten passed immediately when isolated. The remaining Character-folder counter geometry check is independent of this diff and alternated pass/fail by 2–3 px on repeated WebKit runs (it also passed on untouched staging). Required hosted matrices remain the merge gate.
  • Built marinara-engine:pr-5816, started it with a fresh anonymous data volume, and confirmed /api/health returned status: ok on arm64 Linux.
  • Manually verify on the affected physical iPhone after the staging image publishes: enter a Roleplay chat, tap the composer, dismiss the keyboard, then tap the composer at least twice more.
  • Manually verify Create Character and Create Persona fields remain visible through repeated keyboard open/dismiss cycles.

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 issue contains the physical-iPhone before/after evidence. This patch changes viewport anchoring without altering visual styling.

Summary by CodeRabbit

  • Bug Fixes
    • Improved iPhone keyboard handling so the app shell and shared dialogs remain aligned with the visible screen when the keyboard is repeatedly opened and dismissed.
    • Prevented layout shifts caused by changing viewport dimensions during keyboard focus on iOS.

🔄 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/5816 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/3/2026 **Status:** ✅ Merged **Merged:** 9/3/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/5710-ios-repeat-keyboard-focus` --- ### 📝 Commits (2) - [`f93832b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f93832b983e314d57467252115ad19b90389a5fb) test(mari): reproduce repeated iOS keyboard focus - [`8f90868`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8f90868985e212396b2086236edef32cc92d471b) fix(mari): retain iOS keyboard viewport baseline ### 📊 Changes **3 files changed** (+67 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -1) 📝 `e2e/core-flows.e2e.ts` (+63 -3) 📝 `packages/client/src/components/layout/AppShell.tsx` (+3 -2) </details> ### 📄 Description ## Linked issue Closes #5710 ## Why this change - Physical-iPhone testing shows the Roleplay composer is positioned correctly only for the first keyboard focus. After dismissing the keyboard, later focus cycles move the visible viewport away from the app shell and expose the dark document backing. - The existing regression modeled only one focus cycle and kept `window.innerHeight` stable, missing WebKit's later state where the layout viewport can collapse to the keyboard-shrunken visual viewport height. ## What changed - Retain the largest settled viewport height as the iOS layout baseline when clamping the document-coordinate visual viewport offset; Android and desktop retain their existing calculation. - Extend the iPhone-sized WebKit regression through keyboard open → dismiss → reopen while `window.innerHeight` matches the shrunken visual viewport. - Update the Unreleased changelog entry to cover repeated keyboard cycles. ## 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 - `pnpm check` — passed (Impeccable context, localization, Prettier, lint, e2e types, and production builds). - Focused viewport regression — passed in both `mobile-webkit` and `mobile-chromium`. - The regression was proven red first on untouched staging at the second focus: viewport height `360px`, expected shell top `299px`, actual shell top `0px`. - Full `pnpm smoke:ui` ran all 618 cases: the target passed in both mobile projects; the shared three-worker run ended with 11 unrelated failures. Ten passed immediately when isolated. The remaining Character-folder counter geometry check is independent of this diff and alternated pass/fail by 2–3 px on repeated WebKit runs (it also passed on untouched staging). Required hosted matrices remain the merge gate. - Built `marinara-engine:pr-5816`, started it with a fresh anonymous data volume, and confirmed `/api/health` returned `status: ok` on arm64 Linux. - Manually verify on the affected physical iPhone after the staging image publishes: enter a Roleplay chat, tap the composer, dismiss the keyboard, then tap the composer at least twice more. - Manually verify Create Character and Create Persona fields remain visible through repeated keyboard open/dismiss cycles. ## 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 issue contains the physical-iPhone before/after evidence. This patch changes viewport anchoring without altering visual styling. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved iPhone keyboard handling so the app shell and shared dialogs remain aligned with the visible screen when the keyboard is repeatedly opened and dismissed. * Prevented layout shifts caused by changing viewport dimensions during keyboard focus on iOS. <!-- 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:11 +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#6953
No description provided.