[PR #881] [MERGED] Fix character avatar upload preserving drafts #4816

Closed
opened 2026-10-22 04:10:54 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/881
Author: @Xelvanis
Created: 5/15/2026
Status: ✅ Merged
Merged: 5/15/2026
Merged by: @Xelvanis

Base: staging ← Head: fix/character-image-preserves-description


📝 Commits (3)

  • 0929377 Fix character avatar upload preserving drafts
  • 1662379 Fix character avatar upload editor races
  • 58db59d Fix character avatar ref update timing

📊 Changes

1 file changed (+207 additions, -27 deletions)

View changed files

📝 packages/client/src/components/characters/CharacterEditor.tsx (+207 -27)

📄 Description

Linked issue

No linked GitHub issue; this came from a user-reported bug.

Why this change

  • Character creators can lose an unsaved description draft if they set a profile image/avatar before saving the character.
  • Persona editing already preserves unsaved drafts during avatar uploads, so Character editing should behave the same way.

What changed

  • Character editor now tracks the loaded character id and skips same-character refetch parsing while the editor has unsaved changes.
  • Same-character avatar upload refetches can update server data without wiping the local draft fields.
  • Character switching still reloads the selected character into the editor.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Ran pnpm check locally.
  • Reproduced the bug before the fix with a temporary local app: typed an unsaved Character description, uploaded an avatar, and confirmed the description field cleared after the avatar upload refetched the character.
  • Verified the fix with the same flow: typed an unsaved Character description, uploaded another avatar, confirmed the description stayed in the editor after the avatar upload/refetch, then saved and confirmed the API returned both the description and avatar path.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

No visual design change; this is editor state preservation during avatar upload.

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Prevented concurrent avatar uploads in the character editor for improved stability.
    • Enhanced handling of unsaved changes while avatar operations are in progress.
    • Improved character state tracking during parsing and editing workflows.
    • Character comments now properly mark modifications as unsaved.

Review Change Stack


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/881 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 5/15/2026 **Status:** ✅ Merged **Merged:** 5/15/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `staging` ← **Head:** `fix/character-image-preserves-description` --- ### 📝 Commits (3) - [`0929377`](https://github.com/Pasta-Devs/Marinara-Engine/commit/09293770e9c3fd14697a9595305d7269a36daba0) Fix character avatar upload preserving drafts - [`1662379`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1662379069924463afd9a7505c4feb1b93aab4bc) Fix character avatar upload editor races - [`58db59d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/58db59d1770c82978b6b38626480dcdba8b1ce87) Fix character avatar ref update timing ### 📊 Changes **1 file changed** (+207 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/characters/CharacterEditor.tsx` (+207 -27) </details> ### 📄 Description ## Linked issue No linked GitHub issue; this came from a user-reported bug. ## Why this change - Character creators can lose an unsaved description draft if they set a profile image/avatar before saving the character. - Persona editing already preserves unsaved drafts during avatar uploads, so Character editing should behave the same way. ## What changed - Character editor now tracks the loaded character id and skips same-character refetch parsing while the editor has unsaved changes. - Same-character avatar upload refetches can update server data without wiping the local draft fields. - Character switching still reloads the selected character into the editor. ## Validation - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Ran `pnpm check` locally. - Reproduced the bug before the fix with a temporary local app: typed an unsaved Character description, uploaded an avatar, and confirmed the description field cleared after the avatar upload refetched the character. - Verified the fix with the same flow: typed an unsaved Character description, uploaded another avatar, confirmed the description stayed in the editor after the avatar upload/refetch, then saved and confirmed the API returned both the description and avatar path. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) No visual design change; this is editor state preservation during avatar upload. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **Bug Fixes** * Prevented concurrent avatar uploads in the character editor for improved stability. * Enhanced handling of unsaved changes while avatar operations are in progress. * Improved character state tracking during parsing and editing workflows. * Character comments now properly mark modifications as unsaved. <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/881) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:10:54 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4816
No description provided.