mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6040] [MERGED] fix(chat): guard Echo reactions and preserve native text selection #7036
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#7036
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6040
Author: @SpicyMarinara
Created: 9/10/2026
Status: ✅ Merged
Merged: 9/10/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/mobile-selection-echo-crash📝 Commits (3)
3904f21fix(roleplay): clarify editing existing character notescb1a794fix(chat): validate Echo reactions and respect native text selection4f3be26fix(chat): cover deferred scrolling and selection review edge cases📊 Changes
20 files changed (+393 additions, -34 deletions)
View changed files
📝
CHANGELOG.md(+3 -0)📝
e2e/assigned-chat-sweep.e2e.ts(+199 -0)📝
e2e/core-flows.e2e.ts(+12 -6)📝
packages/client/src/components/chat/ChatArea.tsx(+11 -1)📝
packages/client/src/components/chat/ChatInput.tsx(+2 -0)📝
packages/client/src/components/chat/ChatMessage.tsx(+6 -0)📝
packages/client/src/components/chat/ConversationInput.tsx(+2 -0)📝
packages/client/src/components/chat/ConversationMessage.tsx(+2 -0)📝
packages/client/src/components/chat/ConversationView.tsx(+13 -4)📝
packages/client/src/components/chat/EchoChamberPanel.tsx(+3 -1)📝
packages/client/src/hooks/use-generate.ts(+5 -6)📝
packages/client/src/hooks/use-visual-viewport-chat-bottom.ts(+2 -1)📝
packages/client/src/lib/echo-chamber-queue.ts(+26 -7)📝
packages/client/src/lib/text-selection.ts(+15 -0)📝
packages/client/src/stores/agent.store.ts(+4 -3)📝
packages/server/src/services/generation/roleplay-commands.ts(+1 -1)📝
packages/server/src/services/storage/agents.storage.ts(+7 -2)📝
scripts/regressions/assigned-chat-sweep.regression.ts(+35 -0)📝
scripts/regressions/roleplay-commands.regression.ts(+4 -0)📝
scripts/regressions/roleplay-streaming.regression.ts(+41 -2)📄 Description
Linked issue
Closes #6039
Why this change
A nameless Echo Chamber reaction could crash the entire chat at
characterName.length. Native iPhone text selection could also lose its position to automatic scrolling or be mistaken for a message-editing gesture. The Roleplay notes prompt needed a clearer explanation of updating an existing note.What changed
Validation
pnpm checkpasses locallyCONTRIBUTING.mdCompleted locally:
pnpm check(including localization, types, lint, and production build),pnpm regression:prompt, and theroleplay-streaming,assigned-chat-sweep, androleplay-commandsNode regressions. Nine focused Playwright cases pass across desktop Chromium, mobile Chromium, and iPhone-sized WebKit, including opening another chat during a selection. The existing mobile Chromium composer focus/history test also passes after bounding its missing-textarea retry waits (10 passed, 2 existing project skips). Five additional mobile keyboard, viewport-menu, and older-message-editing checks passed in the surrounding smoke run.Before the fix, the browser regression reproduced a 260 px jump during selection and selection being replaced by message editing. The same checks now preserve the selection and scroll position; normal bottom-follow resumes after returning to the latest message. Missing names, non-string names/reactions, null entries, malformed containers, and valid siblings are covered for saved/live Echo data.
Manual verification notes
Browser screenshots were inspected. Manually verify the physical iPhone selection handles and Copy/Cut menu in messages, composers, and message editors, including during streaming and keyboard opening. Desktop WebKit automation cannot reproduce the native iOS selection-handle UI. No physical iPhone was available here. Final-commit build validation, container build, CodeQL, CodeRabbit review, and the complete Node/browser regression matrix passed. One unchanged Game dice-history test timed out on the first WebKit attempt; both variants passed locally, and the affected CI shard passed on one retry (80 passed, 5 existing skips). The original failure and baseline comparison are recorded in the PR comments. Container boot was not tested locally.
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue openedChangelog updated. No user-facing labels, translated documentation, dependencies, or release versions changed.
UI evidence (if applicable)
WebKit selection regression screenshots. These show browser selection ranges, not physical iOS handles.
Roleplay message selection and Conversation draft selection during streaming
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.