mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8689] [MERGED] feat(cards): share one card editor between characters and personas #8750
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#8750
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/8689
Author: @ylli-selmani
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/shared-cards-a📝 Commits (8)
0a04a22test: pin persona patch omission and clear semantics3f5e517Share authored card mapping across character and persona copiesa067a0cShare one card editor between characters and personas1226300Keep shared card drafts to the card fieldsdf4bafdTreat a character save as the merge base for its own refetch5fece1cPreserve persona defaults and wait for character saves before Mari editsfc9d81aType the optional browser test result before it is registered498b3e3Merge branch 'staging' into feat/shared-cards-a📊 Changes
20 files changed (+2573 additions, -2117 deletions)
View changed files
➕
e2e/shared-card-editor.e2e.ts(+117 -0)➕
packages/client/src/components/cards/CardColors.tsx(+209 -0)➕
packages/client/src/components/cards/CardEditor.tsx(+235 -0)➕
packages/client/src/components/cards/CardFieldsTab.tsx(+225 -0)➕
packages/client/src/components/cards/CardIdentityFields.tsx(+92 -0)➕
packages/client/src/components/cards/CardProse.tsx(+178 -0)➕
packages/client/src/components/cards/CardRpgFields.tsx(+255 -0)➕
packages/client/src/components/cards/use-card-gallery-selection.ts(+52 -0)📝
packages/client/src/components/characters/CharacterEditor.tsx(+475 -1134)📝
packages/client/src/components/personas/PersonaEditor.tsx(+320 -967)➕
packages/client/src/hooks/use-card-editor-draft.ts(+13 -0)➕
packages/client/src/hooks/use-card-editor-save.ts(+46 -0)📝
packages/client/src/localization/locales/en.json(+4 -0)📝
packages/shared/src/index.ts(+1 -0)➕
packages/shared/src/utils/authored-card.ts(+141 -0)➕
scripts/regressions/authored-card.regression.ts(+127 -0)📝
scripts/regressions/open-issues.regression.ts(+14 -9)📝
scripts/regressions/persona-api-normalization.regression.ts(+43 -0)📝
scripts/regressions/persona-client-contract.regression.ts(+12 -4)📝
scripts/regressions/prompt-token-counters.regression.ts(+14 -3)📄 Description
Linked issue
Part of #8688. This is PR A of 3; the issue stays open for B (unified storage and migration) and C (chat roles and alias parity).
Why this change
What changed
Shared card model (
packages/shared)utils/authored-card.ts: one typed adapter between the character payload and the flat persona shape (personaFromCard,cardFromPersona,independentCardFields). The "add as persona / add as character" copy actions in both editors now use it instead of two hand-written key lists. Role-specific fields (greetings, persona status bars, RPG settings, crop, tags, conversation profile) round-trip losslessly.Shared editor (
packages/client/src/components/cards/)CardEditor,CardIdentityFields,CardColors,CardRpgFields,CardProse,use-card-gallery-selection: the editor shell, metadata/identity fields, colors tab, RPG fields, prose textareas (with the shared token counter) and gallery selection, used by both editors.CardFieldsTab: one binding for each Card-tab field, including the Prof. Mari wand and alternatives.CharacterCardTabandPersonaCardTabonly pass their copy, section order and role-only parts (character summary, greetings and onboarding dialogue, variable chips).hooks/use-card-editor-draft.tsanduse-card-editor-save.ts: async save and upload handlers always read the latest keystroke, so typing during an in-flight save is never lost or overwritten.CharacterEditor.tsxfix (also onstagingtoday): typing in a field while a save of that field is in flight no longer raises a false "This character changed while you were editing" warning. The save now becomes the merge base, so its own refetch isn't mistaken for an edit made elsewhere. On desktop that warning also covered the Save button.CharacterEditor.tsxandPersonaEditor.tsxshrink to their entry points (about 1,300 lines smaller together; the shared components above hold that code once). Layout, tabs, the word "Persona" and both libraries are unchanged.Tests
e2e/shared-card-editor.e2e.ts(new): for both kinds, opens the editor and the Card tab, edits the title and description while a save is held in flight, then verifies both persist, no false conflict warning appears, and both survive a reopen.scripts/regressions/authored-card.regression.ts(new): both legacy shapes round-trip, independent copies, the tags default.open-issues,persona-client-contractandprompt-token-countersnow assert on the shared files instead of the old per-editor markup.Validation
pnpm checkpasses locallyCONTRIBUTING.mdAgent-run checks on the rebased branch (
origin/staging+ 5 commits):pnpm checkgreen (0 errors, the 12 existing lint warnings).e2e/shared-card-editor.e2e.tspassed on desktop-chromium, mobile-chromium and mobile-webkit.tags ?? []), fixed with regressions in the last commit.Manual verification notes
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 intended visual change. Both editors render the same tabs and fields through shared components.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.