[PR #8559] [MERGED] feat(mari): Prof. Mari in the Persona and Lorebook editors #8672

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

📋 Pull Request Information

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

Base: staging ← Head: feat/mari-editors


📝 Commits (4)

  • 89ff304 feat(mari): Prof. Mari companion and in-field review in the Persona editor (#8541)
  • 9e61d6c feat(mari): Prof. Mari in the Lorebook editor and its entries (#8552)
  • c15c0d5 Merge origin/staging into feat/mari-editors
  • 038e3a5 fix(mari): clear the Edit takeover when a background entry save fails Keep

📊 Changes

18 files changed (+2425 additions, -1602 deletions)

View changed files

📝 packages/client/src/components/characters/CharacterEditor.tsx (+15 -9)
📝 packages/client/src/components/characters/MariFieldReview.tsx (+23 -14)
📝 packages/client/src/components/chat/HomeProfessorMariChat.tsx (+10 -8)
📝 packages/client/src/components/chat/MariApprovalCards.tsx (+11 -6)
📝 packages/client/src/components/chat/MariEditEasyViewer.tsx (+22 -20)
📝 packages/client/src/components/chat/mari/use-mari-workspace-run.ts (+3 -7)
📝 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/lorebooks/LorebookEditor.tsx (+1469 -1231)
📝 packages/client/src/components/lorebooks/LorebookEntryRow.tsx (+83 -25)
📝 packages/client/src/components/lorebooks/LorebookFormFields.tsx (+4 -1)
📝 packages/client/src/components/personas/PersonaEditor.tsx (+229 -121)
📝 packages/client/src/hooks/use-mari-editor-fields.ts (+99 -14)
📝 packages/client/src/lib/mari-editor-fields.ts (+236 -103)
📝 packages/client/src/stores/ui.store.ts (+6 -6)
📝 packages/server/src/services/professor-mari/workspace-agent.service.ts (+1 -1)
📝 scripts/regressions/mari-editor-fields.regression.ts (+202 -30)
📝 scripts/regressions/mari/review-cards.regression.ts (+4 -0)

📄 Description

Linked issue

No issue: planned work, slices 7a and 7b of the Professor Mari companion (#8418). Integration PR for feat/mari-editors: #8541 (Persona editor) and #8552 (Lorebook editor and its entries), each reviewed on its own PR.

Why this change

Prof. Mari's companion (anchored fields, panel / sheet beside the editor, in-field review with Keep / Not this one / Edit / Undo, the field's unsaved text in her context) only worked in the Character editor. Personas and lorebooks are the next most-edited records.

What changed

  • lib/mari-editor-fields.ts: one MARI_EDITOR_KINDS table (character, persona, lorebook, lorebook entry) with update action, change-card table, id arguments, patch wrappers, field ids, aliases and review order, each matching its server handler. Character helpers renamed to generic ones (heldEditorFields, keptEditorFields, formFieldValue, openEditorAtField, mariPatchFieldId).
  • PersonaEditor.tsx: field anchors, companion, in-field review on 9 textareas, pre-save on Keep, Edit takeover restore.
  • LorebookEditor.tsx / LorebookEntryRow.tsx: same for the book and its entries (entries.<entryId>.<key>); form rebase on refetch; saves only changed keys; Keep waits for in-flight and background entry saves; a collapsed entry opens on Next / Open at this field.
  • Server workspace-agent.service.ts: a held entry edit that sends both ids is read by entryId first (HELD_ID_ARGS order).
  • Merge of staging (#8524 field focus, #8548 field streaming): streaming now uses the generic mariPatchFieldId("character", …) / reviewRank helpers; the store keeps both entityId working field and mariFieldStream.

Streaming into the field stays character-only. Preset / agent / tool editors follow in a later PR.

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): on the slice PRs, Opus reviews (persona: 5 low; lorebook: 3 medium + 3 low) all fixed; Playwright on throwaway instances without a model: persona 37/37, lorebook 35/35, character/persona quick pass 16/16, at 1440 and 390. On this merge: client and server tsc, ESLint (one pre-existing warning, serverRun), Prettier, regressions mari-editor-fields, field-stream, review-cards, omnibar-settings-sync, mobile-safe-area-inset pass. Not run with a real model; full pnpm check not run locally.

To verify manually:

  1. Open a persona, open Prof. Mari: she docks beside it (phone: sheet). Ask her to change two fields: both show her diff; Keep all, then Undo.
  2. Open a lorebook, ask her to change an entry's content: the entry opens and shows her diff; Keep saves it.
  3. Type in an entry, then press Keep on her change to another entry: both texts are saved.
  4. Character editor: her text still streams into the field while she writes; review works as before.

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; 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/8559 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `staging` ← **Head:** `feat/mari-editors` --- ### 📝 Commits (4) - [`89ff304`](https://github.com/Pasta-Devs/Marinara-Engine/commit/89ff304d0fb02f0fcdad0e809620c28f54628f9f) feat(mari): Prof. Mari companion and in-field review in the Persona editor (#8541) - [`9e61d6c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9e61d6cfb1a637697a194e99edbde2a985a429c4) feat(mari): Prof. Mari in the Lorebook editor and its entries (#8552) - [`c15c0d5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c15c0d5ac5ba1d6d04df11af37dfb771f75da28b) Merge origin/staging into feat/mari-editors - [`038e3a5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/038e3a51e10d1a6a4736f3c7d8e691cea343fc0e) fix(mari): clear the Edit takeover when a background entry save fails Keep ### 📊 Changes **18 files changed** (+2425 additions, -1602 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/characters/CharacterEditor.tsx` (+15 -9) 📝 `packages/client/src/components/characters/MariFieldReview.tsx` (+23 -14) 📝 `packages/client/src/components/chat/HomeProfessorMariChat.tsx` (+10 -8) 📝 `packages/client/src/components/chat/MariApprovalCards.tsx` (+11 -6) 📝 `packages/client/src/components/chat/MariEditEasyViewer.tsx` (+22 -20) 📝 `packages/client/src/components/chat/mari/use-mari-workspace-run.ts` (+3 -7) 📝 `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/lorebooks/LorebookEditor.tsx` (+1469 -1231) 📝 `packages/client/src/components/lorebooks/LorebookEntryRow.tsx` (+83 -25) 📝 `packages/client/src/components/lorebooks/LorebookFormFields.tsx` (+4 -1) 📝 `packages/client/src/components/personas/PersonaEditor.tsx` (+229 -121) 📝 `packages/client/src/hooks/use-mari-editor-fields.ts` (+99 -14) 📝 `packages/client/src/lib/mari-editor-fields.ts` (+236 -103) 📝 `packages/client/src/stores/ui.store.ts` (+6 -6) 📝 `packages/server/src/services/professor-mari/workspace-agent.service.ts` (+1 -1) 📝 `scripts/regressions/mari-editor-fields.regression.ts` (+202 -30) 📝 `scripts/regressions/mari/review-cards.regression.ts` (+4 -0) </details> ### 📄 Description ## Linked issue No issue: planned work, slices 7a and 7b of the Professor Mari companion (#8418). Integration PR for `feat/mari-editors`: #8541 (Persona editor) and #8552 (Lorebook editor and its entries), each reviewed on its own PR. ## Why this change Prof. Mari's companion (anchored fields, panel / sheet beside the editor, in-field review with Keep / Not this one / Edit / Undo, the field's unsaved text in her context) only worked in the Character editor. Personas and lorebooks are the next most-edited records. ## What changed - `lib/mari-editor-fields.ts`: one `MARI_EDITOR_KINDS` table (character, persona, lorebook, lorebook entry) with update action, change-card table, id arguments, patch wrappers, field ids, aliases and review order, each matching its server handler. Character helpers renamed to generic ones (`heldEditorFields`, `keptEditorFields`, `formFieldValue`, `openEditorAtField`, `mariPatchFieldId`). - `PersonaEditor.tsx`: field anchors, companion, in-field review on 9 textareas, pre-save on Keep, Edit takeover restore. - `LorebookEditor.tsx` / `LorebookEntryRow.tsx`: same for the book and its entries (`entries.<entryId>.<key>`); form rebase on refetch; saves only changed keys; Keep waits for in-flight and background entry saves; a collapsed entry opens on Next / Open at this field. - Server `workspace-agent.service.ts`: a held entry edit that sends both ids is read by `entryId` first (`HELD_ID_ARGS` order). - Merge of staging (#8524 field focus, #8548 field streaming): streaming now uses the generic `mariPatchFieldId("character", …)` / `reviewRank` helpers; the store keeps both `entityId` working field and `mariFieldStream`. Streaming into the field stays character-only. Preset / agent / tool editors follow in a later PR. ## 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): on the slice PRs, Opus reviews (persona: 5 low; lorebook: 3 medium + 3 low) all fixed; Playwright on throwaway instances without a model: persona 37/37, lorebook 35/35, character/persona quick pass 16/16, at 1440 and 390. On this merge: client and server `tsc`, ESLint (one pre-existing warning, `serverRun`), Prettier, regressions `mari-editor-fields`, `field-stream`, `review-cards`, `omnibar-settings-sync`, `mobile-safe-area-inset` pass. Not run with a real model; full `pnpm check` not run locally. To verify manually: 1. Open a persona, open Prof. Mari: she docks beside it (phone: sheet). Ask her to change two fields: both show her diff; Keep all, then Undo. 2. Open a lorebook, ask her to change an entry's content: the entry opens and shows her diff; Keep saves it. 3. Type in an entry, then press Keep on her change to another entry: both texts are saved. 4. Character editor: her text still streams into the field while she writes; review works as before. ## 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; 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:24 +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#8672
No description provided.