[PR #7025] [MERGED] fix(chat): keep the edited Chat Summary field above the phone keyboard #7436

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

📋 Pull Request Information

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

Base: staging ← Head: fix/mobile-summaries-keyboard-6993


📝 Commits (9)

  • 75edd96 fix(chat): keep the edited Chat Summary field above the phone keyboard
  • a2c77ae fix(chat): hide Chat Summary's bottom controls while typing on phones
  • a4676bd Merge remote-tracking branch 'origin/staging' into fix/mobile-summaries-keyboard-6993
  • c50584a fix(chat): show a tall Chat Summary field from its first lines in landscape
  • 42b7047 Merge remote-tracking branch 'origin/staging' into fix/mobile-summaries-keyboard-6993
  • 3f653bd fix(chat): keep Chat Summary taps on target while the keyboard is open
  • 79c15e3 Merge remote-tracking branch 'origin/staging' into fix/mobile-summaries-keyboard-6993
  • 2c05325 Merge remote-tracking branch 'origin/staging' into fix/mobile-summaries-keyboard-6993
  • 777466d Merge remote-tracking branch 'origin/staging' into fix/mobile-summaries-keyboard-6993

📊 Changes

6 files changed (+331 additions, -4 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 e2e/summary-controls.e2e.ts (+203 -1)
📝 packages/client/src/components/chat/ChatToolbarControls.tsx (+11 -2)
📝 packages/client/src/components/chat/SummaryPopover.tsx (+3 -1)
➕ packages/client/src/hooks/use-keep-focused-field-above-keyboard.ts (+100 -0)
📝 packages/client/src/styles/globals.css (+12 -0)

📄 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 #6993

Why this change

On phones, the summary prompt and the summaries in Chat Summary (Roleplay) couldn't be edited. When the keyboard opened, the window shrank to the space above it, and the field being typed in was pushed out of view.

What changed

  • Field stays visible: a small hook (use-keep-focused-field-above-keyboard.ts) keeps the focused field in view above the keyboard, including sideways. A tall field is shown from its first lines.

  • Room to type:

    • While you type in a summary or the prompt, the controls at the bottom of the window are hidden and come back when the keyboard closes.
    • The panel is marked with data-keyboard-hides-footer while the keyboard is open. Before, the controls followed live :focus-within, which moved things under the finger.
  • Taps land where you tap:

    • The chat toolbar's pointer handler no longer blurs the field when you press something inside a panel opened from it.
    • So the first tap on Add range, Write, Generate or a summary's Edit works with the keyboard open, instead of being lost or landing on another setting.
  • Tests: e2e/summary-controls.e2e.ts covers:

    • the edited prompt and summaries above the keyboard, upright and sideways;
    • finger taps on Edit (with the list scrolled to its end) and on Add range while the keyboard is open.

    Each fails without its part of the fix.

  • CHANGELOG: one 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

Manual verification notes

Run by the agent:

  • pnpm check, pnpm localization:check, check:e2e-types and git diff --check pass.
  • e2e/summary-controls.e2e.ts and the Chat Summary cases in core-flows pass on mobile-chromium and mobile-webkit.
  • Two adversarial reviews ran:
    • Their major findings are fixed: the field still hidden with 3+ ranges, and the first Android tap on a bottom button being lost.
    • The CHANGELOG was shortened and corrected.

Known and not fixed here, because both already happen on staging:

  • On iPhone (WebKit), a tap on a bottom button while typing can still be dropped. It no longer presses a different setting. WebKit blurs the field on mousedown, and the panel leaves the keyboard layout before the click.
  • Held sideways with 3 or more message ranges, Chat Summary's range list fills the window even with the keyboard closed, so summaries can't be reached.

Still to verify by hand:

  • On an Android phone, open Chat Summary in a Roleplay chat and edit the summary prompt and a summary. The field stays visible above the keyboard while you type, and the bottom controls return when the keyboard closes.
  • With the keyboard open, tap Add range and a summary's Edit. Each works on the first tap.
  • Repeat on an 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)

CHANGELOG updated; no user docs change.


🔄 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/7025 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/3/2026 **Status:** ✅ Merged **Merged:** 10/3/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/mobile-summaries-keyboard-6993` --- ### 📝 Commits (9) - [`75edd96`](https://github.com/Pasta-Devs/Marinara-Engine/commit/75edd96e70cb5822e27b1d6d330a010c8eb94afc) fix(chat): keep the edited Chat Summary field above the phone keyboard - [`a2c77ae`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a2c77ae3fc2c39ecf5fc1722ad7123244bb20295) fix(chat): hide Chat Summary's bottom controls while typing on phones - [`a4676bd`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a4676bdda8956aca024df456c74f3452caf67935) Merge remote-tracking branch 'origin/staging' into fix/mobile-summaries-keyboard-6993 - [`c50584a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c50584a4f35d27e520d766ece7cedefa305ef395) fix(chat): show a tall Chat Summary field from its first lines in landscape - [`42b7047`](https://github.com/Pasta-Devs/Marinara-Engine/commit/42b70478873f6cb04bfbe2baef33e726ceb41cdd) Merge remote-tracking branch 'origin/staging' into fix/mobile-summaries-keyboard-6993 - [`3f653bd`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3f653bd26d0b2658dfad66ddeebf6566b5780b5e) fix(chat): keep Chat Summary taps on target while the keyboard is open - [`79c15e3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/79c15e38cdd0c3e8ad7cb723ccf1aadb8bc93084) Merge remote-tracking branch 'origin/staging' into fix/mobile-summaries-keyboard-6993 - [`2c05325`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2c053254e0933562e838c9a9bcccd8329b34b3f5) Merge remote-tracking branch 'origin/staging' into fix/mobile-summaries-keyboard-6993 - [`777466d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/777466d45c99318077ba5709377fef532cbbdac8) Merge remote-tracking branch 'origin/staging' into fix/mobile-summaries-keyboard-6993 ### 📊 Changes **6 files changed** (+331 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `e2e/summary-controls.e2e.ts` (+203 -1) 📝 `packages/client/src/components/chat/ChatToolbarControls.tsx` (+11 -2) 📝 `packages/client/src/components/chat/SummaryPopover.tsx` (+3 -1) ➕ `packages/client/src/hooks/use-keep-focused-field-above-keyboard.ts` (+100 -0) 📝 `packages/client/src/styles/globals.css` (+12 -0) </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 #6993 ## Why this change On phones, the summary prompt and the summaries in **Chat Summary** (Roleplay) couldn't be edited. When the keyboard opened, the window shrank to the space above it, and the field being typed in was pushed out of view. ## What changed - **Field stays visible:** a small hook (`use-keep-focused-field-above-keyboard.ts`) keeps the focused field in view above the keyboard, including sideways. A tall field is shown from its first lines. - **Room to type:** - While you type in a summary or the prompt, the controls at the bottom of the window are hidden and come back when the keyboard closes. - The panel is marked with `data-keyboard-hides-footer` while the keyboard is open. Before, the controls followed live `:focus-within`, which moved things under the finger. - **Taps land where you tap:** - The chat toolbar's pointer handler no longer blurs the field when you press something inside a panel opened from it. - So the first tap on **Add range**, **Write**, **Generate** or a summary's **Edit** works with the keyboard open, instead of being lost or landing on another setting. - **Tests:** `e2e/summary-controls.e2e.ts` covers: - the edited prompt and summaries above the keyboard, upright and sideways; - finger taps on Edit (with the list scrolled to its end) and on Add range while the keyboard is open. Each fails without its part of the fix. - **CHANGELOG:** one 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` ### Manual verification notes Run by the agent: - `pnpm check`, `pnpm localization:check`, `check:e2e-types` and `git diff --check` pass. - `e2e/summary-controls.e2e.ts` and the Chat Summary cases in `core-flows` pass on mobile-chromium and mobile-webkit. - Two adversarial reviews ran: - Their major findings are fixed: the field still hidden with 3+ ranges, and the first Android tap on a bottom button being lost. - The CHANGELOG was shortened and corrected. Known and not fixed here, because both already happen on staging: - On iPhone (WebKit), a tap on a bottom button while typing can still be dropped. It no longer presses a different setting. WebKit blurs the field on mousedown, and the panel leaves the keyboard layout before the click. - Held sideways with 3 or more message ranges, Chat Summary's range list fills the window even with the keyboard closed, so summaries can't be reached. Still to verify by hand: - On an Android phone, open **Chat Summary** in a Roleplay chat and edit the summary prompt and a summary. The field stays visible above the keyboard while you type, and the bottom controls return when the keyboard closes. - With the keyboard open, tap **Add range** and a summary's **Edit**. Each works on the first tap. - Repeat on an 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) CHANGELOG updated; no user docs change. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:19:46 +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#7436
No description provided.