mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #288] [MERGED] Fix/persona editor avatar refetch clobbers draft #4548
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#4548
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/288
Author: @Xelvanis
Created: 4/28/2026
Status: ✅ Merged
Merged: 4/28/2026
Merged by: @SpicyMarinara
Base:
main← Head:fix/persona-editor-avatar-refetch-clobbers-draft📝 Commits (4)
f71809afeat(persona-editor): enhance persona loading and avatar synchronization9f1839ffix(persona-editor): guard avatar upload races and sync persona cache6f77be4fix(react-query): merge persona cache updates defensivelye3b07bdchore(react-query): tighten persona cache merge typing📊 Changes
2 files changed (+37 additions, -4 deletions)
View changed files
📝
packages/client/src/components/personas/PersonaEditor.tsx(+21 -3)📝
packages/client/src/hooks/use-characters.ts(+16 -1)📄 Description
Linked issue
Closes #290
Summary
Prevents unsaved persona form edits from being overwritten when the persona list refetches after an avatar upload/change.
Why this change
Users editing a Persona could lose in-progress text if they changed the avatar. Avatar uploads trigger a personas refetch; the editor was re-initializing
formDatafrom server data on refetch, clobbering local unsaved edits and causing apparent “field wipes”.What changed
formDatawhen opening/switching personas (or when not dirty).avatarPreviewsynced with server avatar path without resettingformData.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Docs and release impact
UI evidence (if applicable)
Notes for reviewers
This is intentionally scoped to
PersonaEditorlocal state management; no server/shared schema changes.Quick review for errors / unwanted behavior
packages/client/src/components/personas/PersonaEditor.tsxchanged.if (!isSwitchingPersona && dirty) return;which prevents refetch clobbering. That’s exactly what we want for this bug.rawPersona.idchanges (expected).avatarPreviewwhen it’s null, so it won’t override a freshly-selected local preview.pnpm checkpassed locally (lint + build). Only remaining lint warning is unrelated (ConversationInput.tsx).Summary by CodeRabbit
Summary by CodeRabbit
Bug Fixes
New Features
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.