mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8670] [MERGED] test(chat): guard speaker-tag boundary rerenders against duplicated words #8736
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#8736
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/8670
Author: @SpicyMarinara
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/speaker-tag-keys-8661📝 Commits (1)
f2dbf4ftest(chat): guard speaker-tag boundary rerenders against duplicated words (#8661)📊 Changes
1 file changed (+44 additions, -0 deletions)
View changed files
📝
e2e/chat-widget-dialogue-colors.e2e.ts(+44 -0)📄 Description
Linked issue
Closes #8661
Why this change
<speaker>tags. The reporter is on v2.5.1, built frommain.renderWithSpeakerTags()inChatMessage.tsxonmain. Each narration chunk'shighlightDialogue()output was spread into one children list. Every call restarts its key counter, so two narration chunks that both quote someone each produce a<strong key="d0">. When the speaker boundaries move, React matches up the wrong nodes and words show twice until the message remounts.6d96cf9195), which wraps each narration chunk in its own keyed Fragment. That fix hasn't reachedmainyet. This PR adds the missing regression for the issue's exact scenario. It doesn't change any production code.What changed
e2e/chat-widget-dialogue-colors.e2e.ts: new test, "Roleplay speaker-tag boundary changes rerender the same words".<speaker>boundaries. Before:Alpha "One" <speaker=Bram>*Beta*</speaker> "Two" Gamma. After:<speaker=Bram>Alpha "One"</speaker> *Beta* <speaker=Ada>"Two" Gamma</speaker>.Alpha "One" Beta "Two" Gamma, that the speaker colors moved, and that React logged no duplicate-key warning.maincode), the test fails with the reported doubling:"One"Alpha "One" Beta "Two" Gamma. On staging it passes.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
What the agent ran locally:
node ./scripts/pnpm-runner.mjs checkandcheck:e2e-typespass.e2e/chat-widget-dialogue-colors.e2e.tsande2e/roleplay-vn.e2e.tspass on desktop-chromium (29/29). The new test and #8632's speaker-tag swipe tests pass on mobile-chromium and mobile-webkit (6/6).Betainside Bram's tag takes Bram's color. Tried in the test, it fails because narration inside a speaker tag keeps the normal text color (rgb(212, 212, 212)); only quoted dialogue is colored, which theOne/Twochecks already cover.maincode and that its duplicate-key check catches React's warning. It found no defects.For a human to verify:
<speaker>boundaries. Manually verify that the message shows each word once and recolors immediately.main.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)No docs change: test only.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.