mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8401] [MERGED] fix(characters): merge refetched edits into an unsaved Character editor form #8577
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#8577
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/8401
Author: @Gunterlie
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/28/2026
Merged by: @Gunterlie
Base:
feat/mari-companion← Head:fix/mari-character-form-rebase📝 Commits (2)
78c64ebfix(characters): merge refetched edits into an unsaved Character editor form998bb7efix(characters): keep the merge base until the save lands; guard the conflict action📊 Changes
5 files changed (+107 additions, -2 deletions)
View changed files
📝
packages/client/src/components/characters/CharacterEditor.tsx(+38 -2)➕
packages/client/src/lib/form-rebase.ts(+30 -0)📝
packages/client/src/localization/locales/en.json(+2 -0)➕
scripts/regressions/character-form-rebase.regression.ts(+36 -0)📝
scripts/regressions/tsconfig.client-lanes.json(+1 -0)📄 Description
Linked issue
No issue: this is planned work, slice 1 of the Professor Mari companion feature (Prof. Mari floats next to real editors and live-edits them). Slices are PRed into the integration branch
feat/mari-companion, which goes tostagingwhen the feature is ready.Why this change
When the Character editor had unsaved edits, it ignored every refetch of the character. So when the user approved a Professor Mari change (Mari's chat invalidates the character query), the open editor silently dropped her change, and the next Save wrote the old values back over it. The same happened to a version restore made while the form was dirty.
The companion feature needs Mari's approved changes to land in an editor the user is still typing in, so this has to work first.
What changed
packages/client/src/lib/form-rebase.ts: a three-way merge (base = card as last loaded, mine = unsaved form, server = refetch). Server-only changes land, the user's unsaved edits stay; a field both sides changed differently keeps the user's value and is reported.CharacterEditor.tsx: keeps the loaded card as the merge base and merges a refetch into a dirty form instead of ignoring it. On a conflict, a warning toast offers "Use the new version" (swapped merge; marks the form dirty, does nothing after a character switch, 12 s).en.json.scripts/regressions/character-form-rebase.regression.ts(also added to the client-lanes typecheck).Not merged on a dirty refetch, same as before: the character comment and the avatar preview.
Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Agent-run (not manual): full
pnpm checkexit 0 (one pre-existing warning inHomeProfessorMariChat.tsx:380, file not touched here);node ./scripts/run-regressions.mjs --filter scripts/regressions/character-form-rebase.regression.tspassed; an Opus read-only review found 4 issues (refetch during save could drop edits; conflict action after a character switch; action not marking dirty; toast too short), all fixed in the second commit.To verify manually:
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)UI evidence (if applicable)
No new UI apart from the conflict toast (sonner warning with one action).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.