[PR #4199] [MERGED] Fix assigned Roleplay input, swipe, and tool-call regressions #6278

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

📋 Pull Request Information

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

Base: staging ← Head: agent/assigned-issues-4195-4198


📝 Commits (7)

  • 349e98a Fix empty-composer swipe navigation
  • 46defd1 Add required tool-call setting
  • a0cd370 Reduce mobile text input work
  • bcb41f2 Cover assigned chat interaction regressions
  • 52963db Align open-issue guards with staging behavior
  • af4d6b8 Keep sent drafts cleared after stopped generation
  • 6b0acbc Apply CodeRabbit review suggestions

📊 Changes

25 files changed (+670 additions, -106 deletions)

View changed files

📝 CONTRIBUTING.md (+1 -0)
📝 e2e/core-flows.e2e.ts (+382 -43)
📝 e2e/global-setup.mjs (+17 -3)
📝 packages/client/src/components/chat/ChatArea.tsx (+14 -2)
📝 packages/client/src/components/chat/ChatInput.tsx (+2 -9)
📝 packages/client/src/components/chat/ChatMessage.tsx (+1 -1)
📝 packages/client/src/components/chat/ChatRoleplaySurface.tsx (+4 -2)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+2 -0)
📝 packages/client/src/components/chat/ConversationInput.tsx (+2 -9)
📝 packages/client/src/components/chat/ConversationMessageShared.tsx (+1 -1)
📝 packages/client/src/components/presets/PresetEditor.tsx (+4 -4)
📝 packages/client/src/components/ui/MacroTextarea.tsx (+10 -4)
📝 packages/client/src/features/chat-settings/sections/FunctionCallingSection.tsx (+45 -14)
📝 packages/client/src/hooks/use-generate.ts (+5 -2)
📝 packages/client/src/lib/textarea-quotes.ts (+20 -1)
📝 packages/client/src/localization/locales/en.json (+2 -0)
📝 packages/server/src/routes/generate.routes.ts (+5 -1)
📝 packages/server/src/services/generation/tool-resolution-runtime.ts (+7 -0)
📝 packages/server/src/services/llm/base-provider.ts (+2 -0)
📝 packages/server/src/services/llm/providers/openai.provider.ts (+7 -2)

...and 5 more files

📄 Description

Linked issues

Closes #4195
Resolves #4196
Closes #4197
Closes #4198
Closes #4200

Why this change

The assigned chat regressions affect core Roleplay interaction: an empty focused composer blocks keyboard swipe navigation, the requested required tool-call mode is unavailable, mobile typing and deletion do unnecessary synchronous work, and stopping generation can restore text that was already sent. The first-edit report also needs a durable end-to-end guard so the existing staging cache fix cannot regress.

What changed

  • Allow unmodified Left/Right swipe navigation from only an empty main Conversation or Roleplay composer, while preserving modifier, non-empty input, other editable-target, and touch protections.
  • Add the exact Force To Call Tool chat toggle under Function Calls. It sends bare required only for the first tool-capable round, then returns to auto so the model can finish normally; profile persistence and both OpenAI request paths are covered.
  • Avoid full textarea rescans during composition, deletion, autocorrect, and unrelated insertions. Quote normalization now runs only for relevant direct inserts and one-shot paste/drop/yank events.
  • Pause Roleplay ambient visual work on coarse-pointer layouts while the software keyboard or a draft is active.
  • Treat an intentional stop as successful once that generation submitted a user turn, even if no assistant token arrived yet. This keeps already-sent text cleared without changing genuine failure recovery or regeneration behavior.
  • Add exact browser and source regressions for the assigned paths, and make Playwright reset its file-backed data before the test server opens it so full-suite runs cannot race a live store.
  • Refresh smoke fixtures for current staging background thumbnails, object fitting, store schema version, tag focus, and mobile touch-drop coordinates.

Automated evidence

  • pnpm check — passed; one pre-existing NoodleHome.tsx exhaustive-deps warning remains.
  • pnpm localization:check — passed.
  • pnpm regression:issues — passed.
  • pnpm regression:prompt — passed.
  • pnpm regression:providers — passed.
  • pnpm regression:roleplay — passed.
  • pnpm smoke:ui — 147 passed, 77 intentionally skipped, 0 failed across desktop and mobile Chromium.
  • Exact browser coverage verifies #4195, #4196, #4197, #4198, and the stop-before-first-token restoration case from #4200.

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

  • Manually verify empty and non-empty composer arrow-key behavior in Conversation and Roleplay.
  • Manually verify stopped Roleplay generation with a retained draft, a cleared draft, and a stop before the first assistant token.
  • Manually verify the first saved message edit after stopping generation, then reload the chat.
  • Manually verify the Function Calls toggle with a tool-capable model and confirm the model can answer after its tool call.
  • Manually verify sustained typing, deletion, autocorrect/composition, and quote input in Firefox on macOS and a mobile Roleplay viewport.

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

Automated browser coverage exercises the new Function Calls toggle, focused-composer navigation, stopped-generation composer state, mobile Roleplay input behavior, and background library interactions in the rendered application.

Summary by CodeRabbit

  • New Features

    • Added a “Force To Call Tool” option in chat settings for compatible models.
    • Tool selection preferences now persist per conversation and apply during the first tool round.
  • Bug Fixes

    • Improved composer behavior after stopping generation, including draft persistence after reload.
    • Improved mobile swipe navigation and keyboard usability with an empty composer.
    • Prevented roleplay visuals and drafts from changing unexpectedly during text composition.
    • Improved quote formatting across chat, editing, and prompt fields.

🔄 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/4199 **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/assigned-issues-4195-4198` --- ### 📝 Commits (7) - [`349e98a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/349e98a596e28e927a0dd31dc0f749ac7681b7ac) Fix empty-composer swipe navigation - [`46defd1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/46defd18cdd8d8e3bb73658afd702902d8255cc4) Add required tool-call setting - [`a0cd370`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a0cd3705faf3570fac9ec471616eb9316fc4ac1e) Reduce mobile text input work - [`bcb41f2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bcb41f285db8d27fb9db8baffb1f9b45604ec88b) Cover assigned chat interaction regressions - [`52963db`](https://github.com/Pasta-Devs/Marinara-Engine/commit/52963dbef28aab54bfe1f214f931e308e6e6d99b) Align open-issue guards with staging behavior - [`af4d6b8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/af4d6b80104247fbeff52cd7721f44538454bc2d) Keep sent drafts cleared after stopped generation - [`6b0acbc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6b0acbcc10d0508ad2ad9b0cc8d969e2f92c0684) Apply CodeRabbit review suggestions ### 📊 Changes **25 files changed** (+670 additions, -106 deletions) <details> <summary>View changed files</summary> 📝 `CONTRIBUTING.md` (+1 -0) 📝 `e2e/core-flows.e2e.ts` (+382 -43) 📝 `e2e/global-setup.mjs` (+17 -3) 📝 `packages/client/src/components/chat/ChatArea.tsx` (+14 -2) 📝 `packages/client/src/components/chat/ChatInput.tsx` (+2 -9) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+1 -1) 📝 `packages/client/src/components/chat/ChatRoleplaySurface.tsx` (+4 -2) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+2 -0) 📝 `packages/client/src/components/chat/ConversationInput.tsx` (+2 -9) 📝 `packages/client/src/components/chat/ConversationMessageShared.tsx` (+1 -1) 📝 `packages/client/src/components/presets/PresetEditor.tsx` (+4 -4) 📝 `packages/client/src/components/ui/MacroTextarea.tsx` (+10 -4) 📝 `packages/client/src/features/chat-settings/sections/FunctionCallingSection.tsx` (+45 -14) 📝 `packages/client/src/hooks/use-generate.ts` (+5 -2) 📝 `packages/client/src/lib/textarea-quotes.ts` (+20 -1) 📝 `packages/client/src/localization/locales/en.json` (+2 -0) 📝 `packages/server/src/routes/generate.routes.ts` (+5 -1) 📝 `packages/server/src/services/generation/tool-resolution-runtime.ts` (+7 -0) 📝 `packages/server/src/services/llm/base-provider.ts` (+2 -0) 📝 `packages/server/src/services/llm/providers/openai.provider.ts` (+7 -2) _...and 5 more files_ </details> ### 📄 Description ## Linked issues Closes #4195 Resolves #4196 Closes #4197 Closes #4198 Closes #4200 ## Why this change The assigned chat regressions affect core Roleplay interaction: an empty focused composer blocks keyboard swipe navigation, the requested required tool-call mode is unavailable, mobile typing and deletion do unnecessary synchronous work, and stopping generation can restore text that was already sent. The first-edit report also needs a durable end-to-end guard so the existing staging cache fix cannot regress. ## What changed - Allow unmodified Left/Right swipe navigation from only an empty main Conversation or Roleplay composer, while preserving modifier, non-empty input, other editable-target, and touch protections. - Add the exact `Force To Call Tool` chat toggle under Function Calls. It sends bare `required` only for the first tool-capable round, then returns to `auto` so the model can finish normally; profile persistence and both OpenAI request paths are covered. - Avoid full textarea rescans during composition, deletion, autocorrect, and unrelated insertions. Quote normalization now runs only for relevant direct inserts and one-shot paste/drop/yank events. - Pause Roleplay ambient visual work on coarse-pointer layouts while the software keyboard or a draft is active. - Treat an intentional stop as successful once that generation submitted a user turn, even if no assistant token arrived yet. This keeps already-sent text cleared without changing genuine failure recovery or regeneration behavior. - Add exact browser and source regressions for the assigned paths, and make Playwright reset its file-backed data before the test server opens it so full-suite runs cannot race a live store. - Refresh smoke fixtures for current staging background thumbnails, object fitting, store schema version, tag focus, and mobile touch-drop coordinates. ## Automated evidence - `pnpm check` — passed; one pre-existing `NoodleHome.tsx` exhaustive-deps warning remains. - `pnpm localization:check` — passed. - `pnpm regression:issues` — passed. - `pnpm regression:prompt` — passed. - `pnpm regression:providers` — passed. - `pnpm regression:roleplay` — passed. - `pnpm smoke:ui` — 147 passed, 77 intentionally skipped, 0 failed across desktop and mobile Chromium. - Exact browser coverage verifies #4195, #4196, #4197, #4198, and the stop-before-first-token restoration case from #4200. ## 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 - Manually verify empty and non-empty composer arrow-key behavior in Conversation and Roleplay. - Manually verify stopped Roleplay generation with a retained draft, a cleared draft, and a stop before the first assistant token. - Manually verify the first saved message edit after stopping generation, then reload the chat. - Manually verify the Function Calls toggle with a tool-capable model and confirm the model can answer after its tool call. - Manually verify sustained typing, deletion, autocorrect/composition, and quote input in Firefox on macOS and a mobile Roleplay viewport. ## 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 Automated browser coverage exercises the new Function Calls toggle, focused-composer navigation, stopped-generation composer state, mobile Roleplay input behavior, and background library interactions in the rendered application. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a “Force To Call Tool” option in chat settings for compatible models. * Tool selection preferences now persist per conversation and apply during the first tool round. * **Bug Fixes** * Improved composer behavior after stopping generation, including draft persistence after reload. * Improved mobile swipe navigation and keyboard usability with an empty composer. * Prevented roleplay visuals and drafts from changing unexpectedly during text composition. * Improved quote formatting across chat, editing, and prompt fields. <!-- 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:53 +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#6278
No description provided.