mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6618] [MERGED] fix(narration): fix translation caching and segment sync for edited messages #7256
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#7256
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/6618
Author: @menemorofaan
Created: 9/24/2026
Status: ✅ Merged
Merged: 9/24/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/translation-edit-cache📝 Commits (10+)
1ab31b2fix(narration): fix translation caching and segment sync for edited messages87bb871style: format GameNarration with prettier167694dMerge branch 'staging' into fix/translation-edit-cache00b2030Merge branch 'staging' into fix/translation-edit-cachec4689fafix(narration): restrict raw content translation match to unedited messages541dbeaMerge branch 'staging' into fix/translation-edit-cache18860b3Merge branch 'staging' into fix/translation-edit-cache3e37ae7Merge remote-tracking branch 'origin/staging' into codex/6618-translation-review3151034fix(game): finish translation invalidation and segment alignmentb32f824Merge remote-tracking branch 'origin/staging' into codex/6618-translation-review📊 Changes
7 files changed (+404 additions, -36 deletions)
View changed files
📝
CHANGELOG.md(+2 -0)➕
e2e/game-translation-edits.e2e.ts(+180 -0)📝
e2e/roleplay-commands.e2e.ts(+25 -3)📝
packages/client/src/components/game/GameNarration.tsx(+148 -20)📝
packages/client/src/components/game/GameSurface.tsx(+4 -0)📝
packages/client/src/hooks/use-translate.ts(+37 -13)📝
packages/client/src/stores/translation.store.ts(+8 -0)📄 Description
Linked issue #6615
Closes #6615
Why this change
In Game (GM) mode, editing a narration segment does not update its translation. The translator continues to receive the pre-edit draft, so the translation still reflects the original text. Furthermore, because the stored translation source still matches that stale draft, the outdated translation is considered fresh and remains on screen, while auto-translate is prevented from re-running.
What changed
Validation
Completed on the updated staging base:
pnpm check. The targeted translation browser suite passed 19 cases across desktop Chromium, mobile Chromium and mobile WebKit; 2 mobile cases are deliberately skipped because the active-segment editor is a desktop control. Existing Conversation/Roleplay/Game navigation and persistence cases pass. Both whisper presentations also pass all 6 browser cases after the fixture fix, andpnpm check:e2e-typespasses for that final test-only change. Before the fixes, the browser proofs reproduced raw-source alias reuse, quoted-narration misalignment, and stale-result persistence.Local CodeRabbit completed the combined review, including all files in this PR. Its queued-request and whitespace-only-blank-line findings were reproduced with failing browser regressions and fixed. An additional suggestion to index override keys with another derived Set was not adopted: full translation sources are already memoized per message, while the remaining direct scans only inspect edit/delete keys. The follow-up local review completed across all 9 files in the combined review. It repeated optional source/override-index optimizations and suggested deleting saved translations on invalidation. The latter is not needed for correctness: every Game translation display uses current-source matching, manual translation accepts the raw-content alias only without overrides, and automatic translation compares the rebuilt source. The manual/automatic browser cases explicitly seed an obsolete saved translation, verify the edited text/retranslation, and repeat after reload and deletion. Saved values may remain cached with their old source, but cannot display as current or suppress the new request. No additional persistence writes are added. Hosted CodeRabbit completed on this head; its optional override-index suggestion has the same documented disposition.
The required hosted container build is the container validation; no local container run or live translation-provider verification is claimed.
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Original contributor's manual verification notes are retained below:
npm run build) completed successfully with 0 TypeScript/build errors.Docs and release impact
Includes an Unreleased changelog entry for #6615. No settings, provider API, localization copy, storage format, or version change.
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)UI evidence (if applicable)
No UI layout changes — purely state management, translation cache invalidation, and narration segment reassembly.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.