[PR #4223] [MERGED] Fix iOS keyboard inset and KoboldCPP Router Mode #6289

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4223
Author: @SpicyMarinara
Created: 7/28/2026
Status: ✅ Merged
Merged: 7/28/2026
Merged by: @SpicyMarinara

Base: staging ← Head: agent/4222-ios-composer-bottom-inset


📝 Commits (4)

  • 7a0309c Start issue #4222
  • 81aa041 Fix mobile composer keyboard inset
  • ba3b286 Fix KoboldCPP Router Mode loopback routing
  • 89da4a9 Reset mobile viewport baseline on rotation

📊 Changes

5 files changed (+110 additions, -9 deletions)

View changed files

📝 e2e/core-flows.e2e.ts (+76 -2)
📝 packages/client/src/components/layout/AppShell.tsx (+21 -3)
📝 packages/client/src/styles/globals.css (+6 -2)
📝 packages/server/src/utils/security.ts (+6 -1)
📝 scripts/regressions/provider-compat.regression.ts (+1 -1)

📄 Description

Linked issues

Closes #4222
Closes #4224

Why this change

  • iOS Safari correctly shrinks the visual viewport around its software keyboard, but the chat composer continued reserving the home-indicator safe area inside that already-reduced viewport, leaving an extra bottom band.
  • KoboldCPP Router Mode replaces its ordinary dual-stack server with an IPv4 proxy. Marinara’s rebinding-safe resolver could pin localhost to the first DNS result (::1 on affected systems), causing an immediate fetch failed before KoboldCPP received the request.

What changed

  • Publish the existing software-keyboard state on the document root and remove it during shell cleanup.
  • Keep bottom safe-area protection while the keyboard is closed, but use the composer’s normal compact spacing while the keyboard is open.
  • Strengthen the mobile viewport smoke test with a simulated 34px iOS safe area and verify generic mobile and iPhone WebKit behavior.
  • Prefer IPv4 when an ambiguous loopback hostname such as localhost resolves to both families, while preserving explicit IPv6 loopback URLs and all existing outbound security validation.
  • Exercise the OpenAI-compatible provider regression through localhost against an IPv4-only fixture, matching KoboldCPP Router Mode’s public proxy.

KoboldCPP documents Router Mode as an OpenAI-compatible reverse proxy that supports /v1/chat/completions, hotswapping, streaming, and automatic wake after unload: https://github.com/LostRuins/koboldcpp/wiki#what-is-router-mode-how-can-i-hotswap-models

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 exec playwright test -c playwright.config.ts --project=mobile-chromium --grep "mobile chat composer follows the visual viewport above the software keyboard" — 1 passed.
  • pnpm regression:providers — passed. Before the resolver fix, the new IPv4-only localhost fixture reproduced the reporter’s exact TypeError: fetch failed with ECONNREFUSED ::1; after the fix, streaming and non-streaming requests both pass.
  • pnpm regression:request-security — passed.
  • pnpm check — passed; the existing NoodleHome.tsx exhaustive-deps warning remains unchanged.
  • Physical iOS Safari and a real KoboldCPP Router Mode process are not available in this environment. Maintainer/device verification remains requested; the KoboldCPP proof uses an IPv4-only OpenAI-compatible local server matching the router proxy’s network behavior.

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)

  • Issue #4222 contains the original iOS recording. The focused browser regression programmatically measures the before/after composer inset because the CI browser does not expose a native iOS home indicator or software keyboard.

Summary by CodeRabbit

  • Bug Fixes
    • Improved mobile chat composer spacing and scrolling during the software keyboard state, including safer safe-area padding and consistent composer layout after reloads (iOS included).
    • Enhanced loopback hostname resolution by preferring IPv4 records to avoid ambiguous dual-stack behavior.
  • Tests
    • Expanded end-to-end coverage for mobile visual-viewport rotation and keyboard-open state.
    • Updated a provider-compat regression test to use localhost-based URLs for the SSE gateway.

🔄 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/4223 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/28/2026 **Status:** ✅ Merged **Merged:** 7/28/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `agent/4222-ios-composer-bottom-inset` --- ### 📝 Commits (4) - [`7a0309c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7a0309c275b355e484343c63eac8c76200c021d0) Start issue #4222 - [`81aa041`](https://github.com/Pasta-Devs/Marinara-Engine/commit/81aa041bc8161a8107b087928a7c7a5734aebd47) Fix mobile composer keyboard inset - [`ba3b286`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ba3b28662840d1eb7969a2117ba044d3f7e48386) Fix KoboldCPP Router Mode loopback routing - [`89da4a9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/89da4a913df0f948b6bfb889d93260f2ef4c2af8) Reset mobile viewport baseline on rotation ### 📊 Changes **5 files changed** (+110 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `e2e/core-flows.e2e.ts` (+76 -2) 📝 `packages/client/src/components/layout/AppShell.tsx` (+21 -3) 📝 `packages/client/src/styles/globals.css` (+6 -2) 📝 `packages/server/src/utils/security.ts` (+6 -1) 📝 `scripts/regressions/provider-compat.regression.ts` (+1 -1) </details> ### 📄 Description ## Linked issues Closes #4222 Closes #4224 ## Why this change - iOS Safari correctly shrinks the visual viewport around its software keyboard, but the chat composer continued reserving the home-indicator safe area inside that already-reduced viewport, leaving an extra bottom band. - KoboldCPP Router Mode replaces its ordinary dual-stack server with an IPv4 proxy. Marinara’s rebinding-safe resolver could pin `localhost` to the first DNS result (`::1` on affected systems), causing an immediate `fetch failed` before KoboldCPP received the request. ## What changed - Publish the existing software-keyboard state on the document root and remove it during shell cleanup. - Keep bottom safe-area protection while the keyboard is closed, but use the composer’s normal compact spacing while the keyboard is open. - Strengthen the mobile viewport smoke test with a simulated 34px iOS safe area and verify generic mobile and iPhone WebKit behavior. - Prefer IPv4 when an ambiguous loopback hostname such as `localhost` resolves to both families, while preserving explicit IPv6 loopback URLs and all existing outbound security validation. - Exercise the OpenAI-compatible provider regression through `localhost` against an IPv4-only fixture, matching KoboldCPP Router Mode’s public proxy. KoboldCPP documents Router Mode as an OpenAI-compatible reverse proxy that supports `/v1/chat/completions`, hotswapping, streaming, and automatic wake after unload: https://github.com/LostRuins/koboldcpp/wiki#what-is-router-mode-how-can-i-hotswap-models ## 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 exec playwright test -c playwright.config.ts --project=mobile-chromium --grep "mobile chat composer follows the visual viewport above the software keyboard"` — 1 passed. - `pnpm regression:providers` — passed. Before the resolver fix, the new IPv4-only `localhost` fixture reproduced the reporter’s exact `TypeError: fetch failed` with `ECONNREFUSED ::1`; after the fix, streaming and non-streaming requests both pass. - `pnpm regression:request-security` — passed. - `pnpm check` — passed; the existing `NoodleHome.tsx` exhaustive-deps warning remains unchanged. - Physical iOS Safari and a real KoboldCPP Router Mode process are not available in this environment. Maintainer/device verification remains requested; the KoboldCPP proof uses an IPv4-only OpenAI-compatible local server matching the router proxy’s network behavior. ## 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) - Issue #4222 contains the original iOS recording. The focused browser regression programmatically measures the before/after composer inset because the CI browser does not expose a native iOS home indicator or software keyboard. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved mobile chat composer spacing and scrolling during the software keyboard state, including safer safe-area padding and consistent composer layout after reloads (iOS included). - Enhanced loopback hostname resolution by preferring IPv4 records to avoid ambiguous dual-stack behavior. - **Tests** - Expanded end-to-end coverage for mobile visual-viewport rotation and keyboard-open state. - Updated a provider-compat regression test to use `localhost`-based URLs for the SSE gateway. <!-- 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:08: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#6289
No description provided.