[PR #7499] [MERGED] fix(mobile): keep World Maps' editor full height with the phone keyboard #7763

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

📋 Pull Request Information

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

Base: staging ← Head: fix/7452-keyboard-viewport-restore


📝 Commits (2)

  • ef71fc3 fix(mobile): keep full-screen package editors full height with the keyboard (#7452)
  • eb2d4b6 test(mobile): note the after-close keyboard check is a regression guard

📊 Changes

2 files changed (+110 additions, -4 deletions)

View changed files

📝 e2e/core-flows.e2e.ts (+99 -0)
📝 packages/client/src/styles/globals.css (+11 -4)

📄 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

Closes #7452

Warning

Not proven yet: the issue's main symptom. #7452 reports that the editor stays compressed after the keyboard closes. I could not reproduce that part in emulation: with staging's CSS, the editor already returns to full height with Save visible once the keyboard closes. This PR fixes the compressed, unscrollable editor with Save off-screen while the keyboard is open, which emulation does reproduce. If the real-device "stays compressed" state has another cause, this PR will not fix it. Please check manual steps 3 and 4 on a real Android phone before merging. If the editor still stays compressed after closing, keep #7452 open (or reopen it). Closes stays because the PR triage check requires Closes/Fixes/Resolves #N.

Why this change

On Android Chrome, editing a map in the World Maps library broke once the on-screen keyboard opened: the editor shrank, its form stopped scrolling, and the header with Save went out of reach, so changes could not be saved.

The cause is in the Engine, not in World Maps. The Engine has a keyboard rule for floating panels portalled into <body> (html[data-mari-software-keyboard-open] body > [data-chat-floating-panel]:focus-within). It moves the focused panel to the top of the visible screen and lets it shrink to its content. That works for small chat menus. World Maps, though, opens its map editor and library as a full-screen layer carrying data-chat-floating-panel, so that Chat Settings treats taps inside it as its own. Once that layer shrinks to its content, its inner panes lose their fixed height. The form grows to its full length instead of scrolling, and the browser scrolls the whole clipped editor to show the field, which pushes the header and Save off the top. The Engine already kept its own full-screen layers out of this rule (.mari-modal, ExpandedTextarea). Package editors were not kept out.

Ownership: Engine (host keyboard/viewport CSS in packages/client/src/styles/globals.css). World Maps' markup did nothing wrong, and no package release is needed. The published World Maps 1.5.1 overlays all have a direct .mari-editor-shell.flex-1 child, so they are covered as soon as this Engine change ships.

What changed

  • Phones: a floating panel whose editor shell fills it now stays out of the floating-menu keyboard rule. On Android it keeps following the resized screen, so a full-screen editor such as World Maps' map editor and library keeps its header and Save in view, and its form keeps scrolling while the keyboard is open. When the keyboard closes it fills the screen again, as it already did in emulation on staging (see the warning above).
  • iPhone: those same full-screen editors use the visible-screen sizing the Engine's own modals already use (.mari-modal), so they fit the area above the keyboard.
  • Menus, dialogs, Chat Settings windows and Engine editors keep their current behavior. Only body-level floating panels with a direct .mari-editor-shell.flex-1 child match. No Engine panel has that shape (Preset Variables' editor shell has no flex-1). Engine editors (characters, lorebooks, agents and so on) open in the app's detail sheet, which this rule never touched.
  • New mobile Playwright test in e2e/core-flows.e2e.ts: builds the same layer World Maps uses, opens the keyboard (Android: layout viewport resize; iPhone: mocked visual viewport), scrolls the field into view as the browser does, then checks that Save and the field stay visible. It then closes the keyboard with the field still focused and checks that the editor fills the screen again. Only the keyboard-open half fails on staging; the after-close half is a regression guard and is commented as such.

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 notes (commands run, not a substitute for the boxes above):

  • npx playwright test -c playwright.config.ts e2e/core-flows.e2e.ts --project=mobile-chromium --project=mobile-webkit -g "full-screen package editor" on eb2d4b640: 2 passed.
  • Same test with globals.css restored to staging (on ef71fc3e9): fails on both mobile projects at the keyboard-open check: the layer sits at 9–472 px instead of 0–480 px, and saveVisible is false.
  • Review probe with staging's CSS, World Maps' DOM and the same keyboard emulation: after the keyboard closes (field still focused), the layer is back at full height with Save visible on both mobile-chromium (0–844 px) and mobile-webkit (0–659 px). So the after-close persistence in #7452 was not reproduced.
  • pnpm check on eb2d4b640: exit 0. The one ESLint warning is the pre-existing react-hooks/exhaustive-deps warning in HomeProfessorMariChat.tsx, which this PR does not touch.
  • Regressions that read globals.css on eb2d4b640 (node scripts/run-regressions.mjs --filter ...): floating-window, mobile-safe-area-inset, music-dj-and-floating-ui, mobile-tracker-help-layout: all passed.
  • Earlier on ef71fc3e9: neighbouring mobile keyboard e2e (Chat Summary, Conversation Presence, chat composer, pinch zoom): 13 passed, 5 skipped by their own project guards; open-issues and tracker-gallery-ui regressions passed.
  • Local CodeRabbit (coderabbit review --agent --committed --base-commit 9fd6e0900): completed on ef71fc3e9 with 0 findings. On eb2d4b640 (which only adds a two-line comment to the test) it could not run: the shared CodeRabbit quota was rate limited on all 7 attempts over about 15 minutes. GitHub CodeRabbit also reported "Review rate limited" on this PR, so it has not reviewed it yet either.

Manual verification notes

Manual verification needed (not done by the agent; no Android device was available). Steps 3 and 4 are the issue's main symptom and should gate merging:

  1. On an Android phone in Chrome, open Agents → World Maps → the map library, then open a template or shared world to edit.
  2. Switch to Details, scroll down, and tap a text field low on the screen. The keyboard opens. Check that the editor fits above it, the header with Save stays visible, and the form still scrolls.
  3. Tap an empty spot to close the keyboard. Check that the editor fills the whole screen again and Save works.
  4. Repeat step 2, then close the keyboard with the back gesture or button instead (the field keeps focus). Check that the editor again fills the screen.
  5. Open the map editor for a chat (Chat Settings → World Maps → edit) and repeat steps 2–3.
  6. On an iPhone, repeat steps 1–3. Check that the editor stays inside the screen above the keyboard and returns to full height afterwards.
  7. Spot-check a small chat menu with a text field on a phone (for example Conversation Presence's activity field, or Chat Summary). It should still move above the keyboard as before.

Docs and release impact

  • No docs changes needed (agent note: none expected; this restores expected behavior and no guide describes the keyboard layout)
  • 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)

Playwright screenshots are kept under test-results/ on failure only. None are attached; the manual steps above cover the device check.


🔄 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/7499 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/12/2026 **Status:** ✅ Merged **Merged:** 10/12/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/7452-keyboard-viewport-restore` --- ### 📝 Commits (2) - [`ef71fc3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ef71fc3e9bcd790a4a67332cabe72fd1c25ad150) fix(mobile): keep full-screen package editors full height with the keyboard (#7452) - [`eb2d4b6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/eb2d4b6408dc6c2c2d48e20b9675618896ea6f0a) test(mobile): note the after-close keyboard check is a regression guard ### 📊 Changes **2 files changed** (+110 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `e2e/core-flows.e2e.ts` (+99 -0) 📝 `packages/client/src/styles/globals.css` (+11 -4) </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 Closes #7452 > [!WARNING] > **Not proven yet: the issue's main symptom.** #7452 reports that the editor *stays* compressed after the keyboard closes. I could not reproduce that part in emulation: with `staging`'s CSS, the editor already returns to full height with Save visible once the keyboard closes. This PR fixes the compressed, unscrollable editor with Save off-screen *while the keyboard is open*, which emulation does reproduce. If the real-device "stays compressed" state has another cause, this PR will not fix it. Please check manual steps 3 and 4 on a real Android phone before merging. If the editor still stays compressed after closing, keep #7452 open (or reopen it). `Closes` stays because the PR triage check requires `Closes`/`Fixes`/`Resolves #N`. ## Why this change On Android Chrome, editing a map in the World Maps library broke once the on-screen keyboard opened: the editor shrank, its form stopped scrolling, and the header with **Save** went out of reach, so changes could not be saved. The cause is in the Engine, not in World Maps. The Engine has a keyboard rule for floating panels portalled into `<body>` (`html[data-mari-software-keyboard-open] body > [data-chat-floating-panel]:focus-within`). It moves the focused panel to the top of the visible screen and lets it shrink to its content. That works for small chat menus. World Maps, though, opens its map editor and library as a **full-screen** layer carrying `data-chat-floating-panel`, so that Chat Settings treats taps inside it as its own. Once that layer shrinks to its content, its inner panes lose their fixed height. The form grows to its full length instead of scrolling, and the browser scrolls the whole clipped editor to show the field, which pushes the header and Save off the top. The Engine already kept its own full-screen layers out of this rule (`.mari-modal`, `ExpandedTextarea`). Package editors were not kept out. Ownership: **Engine** (host keyboard/viewport CSS in `packages/client/src/styles/globals.css`). World Maps' markup did nothing wrong, and no package release is needed. The published World Maps 1.5.1 overlays all have a direct `.mari-editor-shell.flex-1` child, so they are covered as soon as this Engine change ships. ## What changed - Phones: a floating panel whose editor shell fills it now stays out of the floating-menu keyboard rule. On Android it keeps following the resized screen, so a full-screen editor such as World Maps' map editor and library keeps its header and **Save** in view, and its form keeps scrolling while the keyboard is open. When the keyboard closes it fills the screen again, as it already did in emulation on `staging` (see the warning above). - iPhone: those same full-screen editors use the visible-screen sizing the Engine's own modals already use (`.mari-modal`), so they fit the area above the keyboard. - Menus, dialogs, Chat Settings windows and Engine editors keep their current behavior. Only body-level floating panels with a direct `.mari-editor-shell.flex-1` child match. No Engine panel has that shape (Preset Variables' editor shell has no `flex-1`). Engine editors (characters, lorebooks, agents and so on) open in the app's detail sheet, which this rule never touched. - New mobile Playwright test in `e2e/core-flows.e2e.ts`: builds the same layer World Maps uses, opens the keyboard (Android: layout viewport resize; iPhone: mocked visual viewport), scrolls the field into view as the browser does, then checks that Save and the field stay visible. It then closes the keyboard with the field still focused and checks that the editor fills the screen again. Only the keyboard-open half fails on `staging`; the after-close half is a regression guard and is commented as such. ## 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 notes (commands run, not a substitute for the boxes above): - `npx playwright test -c playwright.config.ts e2e/core-flows.e2e.ts --project=mobile-chromium --project=mobile-webkit -g "full-screen package editor"` on `eb2d4b640`: 2 passed. - Same test with `globals.css` restored to `staging` (on `ef71fc3e9`): fails on both mobile projects at the keyboard-open check: the layer sits at 9–472 px instead of 0–480 px, and `saveVisible` is `false`. - Review probe with `staging`'s CSS, World Maps' DOM and the same keyboard emulation: after the keyboard closes (field still focused), the layer is back at full height with Save visible on both mobile-chromium (0–844 px) and mobile-webkit (0–659 px). So the after-close persistence in #7452 was **not** reproduced. - `pnpm check` on `eb2d4b640`: exit 0. The one ESLint warning is the pre-existing `react-hooks/exhaustive-deps` warning in `HomeProfessorMariChat.tsx`, which this PR does not touch. - Regressions that read `globals.css` on `eb2d4b640` (`node scripts/run-regressions.mjs --filter ...`): `floating-window`, `mobile-safe-area-inset`, `music-dj-and-floating-ui`, `mobile-tracker-help-layout`: all passed. - Earlier on `ef71fc3e9`: neighbouring mobile keyboard e2e (Chat Summary, Conversation Presence, chat composer, pinch zoom): 13 passed, 5 skipped by their own project guards; `open-issues` and `tracker-gallery-ui` regressions passed. - Local CodeRabbit (`coderabbit review --agent --committed --base-commit 9fd6e0900`): completed on `ef71fc3e9` with 0 findings. On `eb2d4b640` (which only adds a two-line comment to the test) it could **not** run: the shared CodeRabbit quota was rate limited on all 7 attempts over about 15 minutes. GitHub CodeRabbit also reported "Review rate limited" on this PR, so it has not reviewed it yet either. ### Manual verification notes Manual verification needed (not done by the agent; no Android device was available). Steps 3 and 4 are the issue's main symptom and should gate merging: 1. On an Android phone in Chrome, open Agents → World Maps → the map library, then open a template or shared world to edit. 2. Switch to **Details**, scroll down, and tap a text field low on the screen. The keyboard opens. Check that the editor fits above it, the header with **Save** stays visible, and the form still scrolls. 3. Tap an empty spot to close the keyboard. Check that the editor fills the whole screen again and **Save** works. 4. Repeat step 2, then close the keyboard with the back gesture or button instead (the field keeps focus). Check that the editor again fills the screen. 5. Open the map editor for a chat (Chat Settings → World Maps → edit) and repeat steps 2–3. 6. On an iPhone, repeat steps 1–3. Check that the editor stays inside the screen above the keyboard and returns to full height afterwards. 7. Spot-check a small chat menu with a text field on a phone (for example Conversation Presence's activity field, or Chat Summary). It should still move above the keyboard as before. ## Docs and release impact - [ ] No docs changes needed (agent note: none expected; this restores expected behavior and no guide describes the keyboard layout) - [ ] 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) Playwright screenshots are kept under `test-results/` on failure only. None are attached; the manual steps above cover the device check. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:07:16 +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#7763
No description provided.