[PR #5782] [MERGED] Fix anchored iPhone keyboard viewport displacement #6930

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

📋 Pull Request Information

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

Base: staging ← Head: fix/5710-ios-fixed-body-coordinate-space


📝 Commits (2)

  • 20d917f test: cover anchored iOS keyboard viewport
  • b47b560 fix: anchor iOS shell to rendered body

📊 Changes

3 files changed (+24 additions, -7 deletions)

View changed files

📝 CHANGELOG.md (+1 -1)
📝 e2e/core-flows.e2e.ts (+15 -5)
📝 packages/client/src/components/layout/AppShell.tsx (+8 -1)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.

Linked issue

Closes #5710

Why this change

  • Physical-iPhone testing still shows Roleplay disappearing into the dark document backing when the composer receives focus on the latest staging build.
  • The previous fix always applied visualViewport.pageTop, assuming WebKit had shifted the fixed body by the same amount. On the reported path the fixed body remains anchored, so that compensation moves the whole shell below the visible keyboard viewport.

What changed

  • Derive the iOS shell offset from the fixed body displacement WebKit actually rendered; reported viewport coordinates remain the Android/non-iOS path.
  • Extend the existing mobile keyboard regression with both iOS coordinate spaces: a nonzero pageTop with an anchored body and a genuinely shifted body that still needs compensation.
  • Correct the existing Unreleased changelog 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

Automated verification notes

  • Regression-first proof failed on staging: the shell top became 299px instead of remaining at 0px when pageTop changed but the fixed body stayed anchored.
  • The focused keyboard viewport regression passes after the fix in both mobile-webkit and mobile-chromium, including the shifted-body iOS case, composer bounds, transcript scrolling, and keyboard dismissal.
  • pnpm check passes locally, including Impeccable context, localization, formatting, lint, E2E type checking, and production builds.

Manual verification notes

  • Physical-iPhone confirmation remains required after deployment because desktop Playwright WebKit cannot invoke the native iOS keyboard pan.
  • Manually verify Roleplay composer focus, typing, keyboard dismissal, and transcript scrolling on the staging Docker image.

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] <paths> follow-up issue opened
  • Version/release files updated (only if this PR includes a version bump)

No user documentation, localization catalog, or release metadata changes are needed. The existing Unreleased changelog entry is corrected.

UI evidence (if applicable)

The reporter supplied a current-staging physical-iPhone screenshot showing the shell displaced completely out of view above the keyboard.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an iPhone issue where the chat interface could shift into a dark area when the keyboard opened or the page moved.
    • Improved keyboard handling so the chat composer remains visible within the viewport while the page stays correctly anchored.
    • Reduced lingering background rendering after Roleplay scene transitions, improving visual performance.
    • Updated iOS behavior checks to better reflect how the interface responds during keyboard and viewport movement.

🔄 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/5782 **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-fixed-body-coordinate-space` --- ### 📝 Commits (2) - [`20d917f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/20d917fd89b35fb6cee6616f3bf6922b701bd564) test: cover anchored iOS keyboard viewport - [`b47b560`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b47b560db55f27bd7aa34cd39681543ddd223680) fix: anchor iOS shell to rendered body ### 📊 Changes **3 files changed** (+24 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -1) 📝 `e2e/core-flows.e2e.ts` (+15 -5) 📝 `packages/client/src/components/layout/AppShell.tsx` (+8 -1) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. ## Linked issue Closes #5710 ## Why this change - Physical-iPhone testing still shows Roleplay disappearing into the dark document backing when the composer receives focus on the latest staging build. - The previous fix always applied `visualViewport.pageTop`, assuming WebKit had shifted the fixed body by the same amount. On the reported path the fixed body remains anchored, so that compensation moves the whole shell below the visible keyboard viewport. ## What changed - Derive the iOS shell offset from the fixed body displacement WebKit actually rendered; reported viewport coordinates remain the Android/non-iOS path. - Extend the existing mobile keyboard regression with both iOS coordinate spaces: a nonzero `pageTop` with an anchored body and a genuinely shifted body that still needs compensation. - Correct the existing Unreleased changelog 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` ### Automated verification notes - Regression-first proof failed on staging: the shell top became `299px` instead of remaining at `0px` when `pageTop` changed but the fixed body stayed anchored. - The focused keyboard viewport regression passes after the fix in both `mobile-webkit` and `mobile-chromium`, including the shifted-body iOS case, composer bounds, transcript scrolling, and keyboard dismissal. - `pnpm check` passes locally, including Impeccable context, localization, formatting, lint, E2E type checking, and production builds. ### Manual verification notes - Physical-iPhone confirmation remains required after deployment because desktop Playwright WebKit cannot invoke the native iOS keyboard pan. - Manually verify Roleplay composer focus, typing, keyboard dismissal, and transcript scrolling on the staging Docker image. ## 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] <paths>` follow-up issue opened - [ ] Version/release files updated (only if this PR includes a version bump) No user documentation, localization catalog, or release metadata changes are needed. The existing Unreleased changelog entry is corrected. ## UI evidence (if applicable) The reporter supplied a current-staging physical-iPhone screenshot showing the shell displaced completely out of view above the keyboard. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Fixed an iPhone issue where the chat interface could shift into a dark area when the keyboard opened or the page moved. - Improved keyboard handling so the chat composer remains visible within the viewport while the page stays correctly anchored. - Reduced lingering background rendering after Roleplay scene transitions, improving visual performance. - Updated iOS behavior checks to better reflect how the interface responds during keyboard and viewport movement. <!-- 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:59 +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#6930
No description provided.