[PR #8541] [MERGED] feat(mari): Prof. Mari companion and in-field review in the Persona editor #8660

Closed
opened 2026-11-07 16:46:18 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8541
Author: @Gunterlie
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @Gunterlie

Base: feat/mari-editors ← Head: feat/mari-persona-editor


📝 Commits (1)

  • 54a779d feat(mari): Prof. Mari companion and in-field review in the Persona editor

📊 Changes

12 files changed (+643 additions, -321 deletions)

View changed files

📝 packages/client/src/components/characters/CharacterEditor.tsx (+15 -9)
📝 packages/client/src/components/characters/MariFieldReview.tsx (+12 -14)
📝 packages/client/src/components/chat/HomeProfessorMariChat.tsx (+11 -5)
📝 packages/client/src/components/chat/MariApprovalCards.tsx (+11 -6)
📝 packages/client/src/components/chat/MariEditEasyViewer.tsx (+20 -20)
📝 packages/client/src/components/layout/GlobalOmnibar.tsx (+5 -4)
📝 packages/client/src/components/layout/omnibar/use-mari-companion.tsx (+3 -2)
📝 packages/client/src/components/personas/PersonaEditor.tsx (+229 -121)
📝 packages/client/src/hooks/use-mari-editor-fields.ts (+39 -8)
📝 packages/client/src/lib/mari-editor-fields.ts (+181 -97)
📝 packages/client/src/stores/ui.store.ts (+6 -6)
📝 scripts/regressions/mari-editor-fields.regression.ts (+111 -29)

📄 Description

Linked issue

No issue: planned work, slice 7a of the Professor Mari companion feature (#8418 shipped it for the Character editor). Slices 7a–7c are PRed into the integration branch feat/mari-editors.

Why this change

Prof. Mari's companion features (anchored fields, panel / sheet beside the editor, in-field review with Keep / Not this one / Edit / Undo, unsaved field text in her context) only worked in the Character editor. Personas are the next most-edited record, and the review code was character-only, so every further editor would have needed a copy.

What changed

  • lib/mari-editor-fields.ts: one MARI_EDITOR_KINDS table (character, persona): update action, change-card table, id argument, patch wrappers, field ids, aliases, review order — each matching its server handler. Helpers mariEditorKindForAction, mariEditorKindForTable, isMariEditorKind, mariPatchFieldId; renames heldCharacterFields → heldEditorFields, keptCharacterFields → keptEditorFields, characterFieldValue → formFieldValue, withCharacterFieldValue → withFormFieldValue.
  • Action names are normalized like the server (-, _, spaces removed) and the id is read id first, like the server, so the editor never shows a review the server would refuse or target (this also corrects the character path for calls that send both ids).
  • hooks/use-mari-editor-fields.ts: openCharacterAtField → openEditorAtField(kind, …), isMariEditorOpen. Store review / reveal / working state: characterId → entityId (transient, no migration).
  • PersonaEditor.tsx: field anchors (header name, Metadata, every Card textarea), "Prof. Mari is here" chip, companion opt-in (panel / sheet), in-field review on 9 textareas, pre-save on Keep, Edit takeover restore. Form rebase reuses the existing mergeAuthoritativePersonaEditorDraft.
  • Both editors: the Edit takeover text is cleared when a review goes back to waiting, so a failed Keep cannot restore stale text later.
  • Callers moved to the table: MariApprovalCards, MariEditEasyViewer, GlobalOmnibar (open-field), HomeProfessorMariChat, CharacterEditor.

No new copy. Not anchored: About me / convo name / behavior (shared ConvoProfileFields, also not anchored in the Character editor). imageAppearance stays on her card only (its anchor exists only while its toggle is on).

Lorebook and preset join with one MARI_EDITOR_KINDS entry plus anchors.

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

Agent-run (not manual): client tsc -b; ESLint clean on touched files (one pre-existing warning); Prettier; localization:check; regressions mari-editor-fields (persona cases + action/wrapper/id cases), character-form-rebase, omnibar-settings-sync, mobile-safe-area-inset pass. Opus read-only review: no blocker/high; 5 low (server-shape mismatches and edge cases), all fixed. Playwright on a throwaway instance (seeded held change, no model): 37/37 then 16/16 after fixes — persona 1440 panel + review (Keep all 3, Tab, Edit + Ctrl+Enter keeps your edit, Undo, Esc / Not this one, typing defers review, Save after her change keeps it, Cmd+J field text, Open at this field), persona 390 sheet auto-peek, character 1440 review + 390 sheet unchanged. Not run with a real model.

Note: #8524 (staging) touches HomeProfessorMariChat.tsx / MariFieldReview.tsx too; the integration branch will merge staging before it goes to staging.

To verify manually:

  1. Open a persona, open Prof. Mari: she docks beside it (phone: sheet).
  2. Ask her (Manual mode) to change the persona's description and personality: both fields show her diff; Keep all, then Undo.
  3. Type in a field, then Keep: your text is saved with her change.
  4. Repeat 2 in a character: unchanged behavior.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Screenshots are local (~/scratch/mari-persona/.tmp/shots/); attach on request.


🔄 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/8541 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `feat/mari-editors` ← **Head:** `feat/mari-persona-editor` --- ### 📝 Commits (1) - [`54a779d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/54a779da4ea903f0639159068fa994c620a67e34) feat(mari): Prof. Mari companion and in-field review in the Persona editor ### 📊 Changes **12 files changed** (+643 additions, -321 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/characters/CharacterEditor.tsx` (+15 -9) 📝 `packages/client/src/components/characters/MariFieldReview.tsx` (+12 -14) 📝 `packages/client/src/components/chat/HomeProfessorMariChat.tsx` (+11 -5) 📝 `packages/client/src/components/chat/MariApprovalCards.tsx` (+11 -6) 📝 `packages/client/src/components/chat/MariEditEasyViewer.tsx` (+20 -20) 📝 `packages/client/src/components/layout/GlobalOmnibar.tsx` (+5 -4) 📝 `packages/client/src/components/layout/omnibar/use-mari-companion.tsx` (+3 -2) 📝 `packages/client/src/components/personas/PersonaEditor.tsx` (+229 -121) 📝 `packages/client/src/hooks/use-mari-editor-fields.ts` (+39 -8) 📝 `packages/client/src/lib/mari-editor-fields.ts` (+181 -97) 📝 `packages/client/src/stores/ui.store.ts` (+6 -6) 📝 `scripts/regressions/mari-editor-fields.regression.ts` (+111 -29) </details> ### 📄 Description ## Linked issue No issue: planned work, slice 7a of the Professor Mari companion feature (#8418 shipped it for the Character editor). Slices 7a–7c are PRed into the integration branch `feat/mari-editors`. ## Why this change Prof. Mari's companion features (anchored fields, panel / sheet beside the editor, in-field review with Keep / Not this one / Edit / Undo, unsaved field text in her context) only worked in the Character editor. Personas are the next most-edited record, and the review code was character-only, so every further editor would have needed a copy. ## What changed - `lib/mari-editor-fields.ts`: one `MARI_EDITOR_KINDS` table (character, persona): update action, change-card table, id argument, patch wrappers, field ids, aliases, review order — each matching its server handler. Helpers `mariEditorKindForAction`, `mariEditorKindForTable`, `isMariEditorKind`, `mariPatchFieldId`; renames `heldCharacterFields` → `heldEditorFields`, `keptCharacterFields` → `keptEditorFields`, `characterFieldValue` → `formFieldValue`, `withCharacterFieldValue` → `withFormFieldValue`. - Action names are normalized like the server (`-`, `_`, spaces removed) and the id is read `id` first, like the server, so the editor never shows a review the server would refuse or target (this also corrects the character path for calls that send both ids). - `hooks/use-mari-editor-fields.ts`: `openCharacterAtField` → `openEditorAtField(kind, …)`, `isMariEditorOpen`. Store review / reveal / working state: `characterId` → `entityId` (transient, no migration). - `PersonaEditor.tsx`: field anchors (header name, Metadata, every Card textarea), "Prof. Mari is here" chip, companion opt-in (panel / sheet), in-field review on 9 textareas, pre-save on Keep, Edit takeover restore. Form rebase reuses the existing `mergeAuthoritativePersonaEditorDraft`. - Both editors: the Edit takeover text is cleared when a review goes back to waiting, so a failed Keep cannot restore stale text later. - Callers moved to the table: `MariApprovalCards`, `MariEditEasyViewer`, `GlobalOmnibar` (open-field), `HomeProfessorMariChat`, `CharacterEditor`. No new copy. Not anchored: About me / convo name / behavior (shared `ConvoProfileFields`, also not anchored in the Character editor). `imageAppearance` stays on her card only (its anchor exists only while its toggle is on). Lorebook and preset join with one `MARI_EDITOR_KINDS` entry plus anchors. ## 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 Agent-run (not manual): client `tsc -b`; ESLint clean on touched files (one pre-existing warning); Prettier; `localization:check`; regressions `mari-editor-fields` (persona cases + action/wrapper/id cases), `character-form-rebase`, `omnibar-settings-sync`, `mobile-safe-area-inset` pass. Opus read-only review: no blocker/high; 5 low (server-shape mismatches and edge cases), all fixed. Playwright on a throwaway instance (seeded held change, no model): 37/37 then 16/16 after fixes — persona 1440 panel + review (Keep all 3, Tab, Edit + Ctrl+Enter keeps your edit, Undo, Esc / Not this one, typing defers review, Save after her change keeps it, Cmd+J field text, Open at this field), persona 390 sheet auto-peek, character 1440 review + 390 sheet unchanged. Not run with a real model. Note: #8524 (staging) touches `HomeProfessorMariChat.tsx` / `MariFieldReview.tsx` too; the integration branch will merge staging before it goes to staging. To verify manually: 1. Open a persona, open Prof. Mari: she docks beside it (phone: sheet). 2. Ask her (Manual mode) to change the persona's description and personality: both fields show her diff; Keep all, then Undo. 3. Type in a field, then Keep: your text is saved with her change. 4. Repeat 2 in a character: unchanged behavior. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) Screenshots are local (`~/scratch/mari-persona/.tmp/shots/`); attach on request. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:46:18 +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#8660
No description provided.