mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8485] [MERGED] fix(chat): keep translation prompt edits stable until commit #8629
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#8629
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/8485
Author: @SpicyMarinara
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/8475-translator-prompt-editing📝 Commits (9)
9136b7etest(chat): cover translation prompt editing and ownership3aceebbfix: buffer translator prompts until blur5ebb666test: match the RP settings close label206777btest: frame the edited translation promptsee5396aMerge remote-tracking branch 'origin/staging' into fix/8475-translator-prompt-editinga5a4a41fix: await complete prompt saves before translator defaults7113257fix: retain both prompt intents for explicit save retries6f245fafix: retain pending prompt text and live token estimates1b81844test: defer translator live counters to browser proof📊 Changes
4 files changed (+397 additions, -24 deletions)
View changed files
📝
e2e/chat-sweep.e2e.ts(+105 -1)➕
e2e/translation-prompt-editing.e2e.ts(+212 -0)📝
packages/client/src/features/chat-settings/sections/TranslationSection.tsx(+79 -19)📝
scripts/regressions/prompt-token-counters.regression.ts(+1 -4)📄 Description
Linked issue
Closes #8475.
Why this change
RP Translation prompt textboxes sent a metadata mutation on every keystroke and rendered the persisted value. A middle insertion could lose a character and jump to the end; clearing a field immediately restored its default. Buffering the edit also requires Save translator defaults to wait for the complete prompt commit, including asynchronous query preparation, so it cannot save an older value.
What changed
DraftTextareafor both prompt fields, keyed by chat and direction. Focused typing stays local; blur and unmount commit through the existing metadata API and preserve the existing blank/default normalization.DraftTextarearemains unchanged.TranslationSection.tsx, two E2E files and that one regression guard; it includes staging1403a98185060ab2dc18b466299d9b220a838e45.Validation
Final candidate:
1b81844838108eebeaa9691cab21162c140a9f4b. Its runtime and browser files are byte-identical to tested/reviewed6f245fa00f6c9864fb5bf2ad2a072e3fbd4e2359; the final commit only removes the obsolete source-text assertion.Standard
pnpm checkpassed, including localization, formatting, lint/types, E2E types and both production builds. The one existingHomeProfessorMariChat.tsxHook warning is in an unchanged file. Final outputs are retained; this successful run used no phased cleanup or modified command.Six focused browser cases passed: the editing case and strengthened defaults case across desktop Chromium, mobile Chromium and mobile WebKit, with one worker. Guards cover caret insertion, replacement, clear/save/reload, correct-chat unmount flush, synthetic composition/native CJK insertion, Restore, preparation-before-PATCH, held PATCH, failed writes, both-field failure handling, explicit retry without retyping and fresh-edit recovery. The editing spec also holds an earlier real serialized save, blurs/refocuses two queued prompt edits, verifies their visible values and final persisted latest text, and checks both live counters before blur, including zero for a focused cleared field. All final assertions are hard; the original RED aggregated the two counter failures before the pending-value failure.
pnpm smoke:uipassed all seven desktop cases. Browser runs used the same assertions and budgets with video/trace disabled in a temporary artifact-only config; screenshots, error contexts and raw logs remain. Desktop light and phone dark captures were checked. Browser emulation/synthetic composition do not establish physical-device or OS IME behavior.Local CodeRabbit first found one major save-ordering defect and then one minor retry defect; both were fixed. Hosted Dottore review on
711325773944f6429ab56d1481779645591a4d7cthen reported two LOW contracts:e531592b0b81415e(pending text reset) andf0ec6be7d121d7bb(live token estimate). Both were reproduced on that exact runtime and repaired. The final genuine local incremental review passed with 0 findings across both changed files, against reviewed candidate711325773944f6429ab56d1481779645591a4d7c. This is not a claim that the earlier reviews had zero findings.The previously unrun token-counter guard reproduced RED on
6f245fabecause it required the old exact source expression. After removing only that obsolete assertion, the token-counter and tracker-gallery regression files both pass. Existing browser live-counter assertions and every other source guard remain unchanged. No runtime rebuild or browser repeat was needed for this test-only follow-up. Final test-only local CodeRabbit completed with 0 findings across its one changed file, against6f245fa00f6c9864fb5bf2ad2a072e3fbd4e2359. The focused source-guard RED and final GREEN logs are/tmp/engine-8485-6f-token-guard-red.log,/tmp/engine-8485-token-guard-final-green.logand/tmp/engine-8485-tracker-gallery-final-green.log; the incremental review log is/tmp/engine-8485-token-guard-coderabbit.log.Preserved RED proofs reproduce the original caret bug, Save completing while prompt preparation/PATCH was held, and one stale defaults write when a different field succeeded after a held failure. The original caret trace has a documented ENOSPC network-capture limitation; its direct failure log and DOM context remain valid. Later control failures and final successful checks are preserved separately.
Current evidence:
/tmp/engine-8485-dottore-both-low-red.log,/tmp/engine-8485-dottore-low-green.log,/tmp/engine-8485-dottore-repair-smoke.log,/tmp/engine-8485-dottore-repair-pnpm-check.log,/tmp/engine-8485-dottore-repair-coderabbit.log. Earlier receipts and failed traces remain preserved. Hosted Dottore on runtime head6f245faconcluded Viable With Notes (0 defects, one optional note); the final test-only head still requires its own hosted verdict and required checks before merge.Manually verify middle insertion, rapid typing and deleting/replacing both prompts in RP chat.
Manually verify failed prompt text, explicit Save retry and Save translator defaults after changing both fields.
Manually verify native OS IME composition and desktop/mobile focus while switching chats or closing settings.
Docs and release impact
UI bugfix using existing controls and localized messages. No release metadata, dependencies, provider integration or generation-prompt change.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.