[PR #8411] [MERGED] feat(mari): review Prof. Mari's held change inside the Character editor fields #8584

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

📋 Pull Request Information

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

Base: feat/mari-companion ← Head: feat/mari-in-field-review


📝 Commits (1)

  • a6e4594 feat(mari): review Prof. Mari's held character change inside the fields

📊 Changes

9 files changed (+1220 additions, -413 deletions)

View changed files

📝 packages/client/src/components/characters/CharacterEditor.tsx (+485 -403)
➕ packages/client/src/components/characters/MariFieldReview.tsx (+321 -0)
📝 packages/client/src/components/chat/HomeProfessorMariChat.tsx (+74 -0)
📝 packages/client/src/components/chat/MariChangeReceipt.tsx (+2 -2)
📝 packages/client/src/lib/mari-editor-fields.ts (+135 -6)
📝 packages/client/src/localization/locales/en.json (+16 -0)
📝 packages/client/src/stores/ui.store.ts (+7 -0)
📝 packages/client/src/styles/mari.css (+118 -2)
📝 scripts/regressions/mari-editor-fields.regression.ts (+62 -0)

📄 Description

Linked issue

No issue: planned work, slice 5 of the Professor Mari companion feature (Prof. Mari floats next to real editors and live-edits them). Slices are PRed into the integration branch feat/mari-companion (slices 1–4: #8401, #8403, #8405, #8406, #8407).

Why this change

A held (waiting-for-approval) change from Prof. Mari was only visible on her card in the chat, away from the field it changes. The agreed design: while a change waits, each changed field shows her diff in place, with Keep / Not this one / Edit / Next at the field, so the user decides where they read and write.

What changed

  • components/characters/MariFieldReview.tsx (new): the in-field review box (struck old words, green new words, the same TextBody as her card), "Keep all N" (just "Keep" for one field), Not this one, Edit, Next; keyboard Ctrl/Cmd+Enter keep, Esc reject, Tab next. After Keep: "Edited by Prof. Mari · Undo" (+ "Saved your unsaved text too" when Keep saved the user's text first). A visible line says when Keep also applies changes outside this character.
  • CharacterEditor.tsx: 8 textareas wrapped in <MariFieldReview> (the large diff is re-indent; git diff -w shows the real change). Keep saves the user's unsaved text first; fields taken over with Edit are restored as unsaved text after Keep (per character, cleared on failed save or character switch).
  • HomeProfessorMariChat.tsx: publishes the waiting / busy / kept review from her last message (mariHeldChanges, held calls, deferred mutations) to ui.store (mariFieldReview, transient). Keep sends the existing Accept chip, Not this one sends the decline chip plus "Propose the change again without the X field.", Undo uses the existing answerAll(…, false). Actions report whether the send started, so a blocked send (no connection, busy) leaves the review in place.
  • lib/mari-editor-fields.ts: pure helpers heldCharacterFields, keptCharacterFields, characterFieldValue, withCharacterFieldValue, shared characterPatchValues; regression extended.
  • MariChangeReceipt.tsx: exports TextBody and undoLabel for reuse. mari.css: review box styles (faint static edge, 2.75rem touch buttons). en.json: mari.fieldReview.* keys.

No new approval contract: accept is whole-change, as agreed.

Scope cuts (open for follow-up):

  • Not this one declines the whole change and asks her to re-propose; dropping just one field needs a server partial-accept.
  • Bypass permissions mode does not auto-save unsaved text yet; the user's text still wins (slice 1 toast).
  • Only textarea fields; name, creator, version, tags, alternate greetings and depth prompt stay on her card.
  • Review shows only while Prof. Mari is open (her chat sends the replies).

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 exit 0; client build exit 0; ESLint clean on touched files (one pre-existing warning in HomeProfessorMariChat.tsx:387); Prettier, localization:check and the mari-editor-fields regression pass. Two Opus read-only review passes: first found 2 high (stale Edit text restored, possibly into another character; "Not this one" state leaking across characters), 3 medium (double Keep / Keep into another thread; textarea unmounting while typing; focus lost) and low issues; second pass found a blocked send hiding the review. All fixed.

Playwright on a throwaway instance (empty data, no model; the held turn is seeded through the chat API and Accept runs the real server path), 50/50 checks at 1440 / 1024 / 390 px: diff in field, Keep and Ctrl+Enter, Esc declines without closing her, Tab / Next, Edit, Undo incl. conflict, saved-unsaved message, failed save sends nothing, review waits while typing, focus return, no-connection Keep / Not this one leave the review, 390 px no horizontal scroll. Not yet run with a real model.

To verify manually:

  1. Open a character with Prof. Mari docked; ask her to change Description and Personality in Manual mode. Both fields show her diff with "Keep all 2".
  2. Keep: fields update, "Edited by Prof. Mari · Undo" shows; Undo restores.
  3. Type in Description, then ask her again; the review waits until you leave the field; Keep also saves your typed text and says so.
  4. Not this one on a field: she is asked again without that field.
  5. Edit puts her text in the field as an unsaved edit; Save keeps it.
  6. Ctrl/Cmd+Enter, Esc, Tab inside the review box.

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 at 1440, 1024 and 390 px are local (.tmp/mari-companion/slice5/); attach on request. They match the approved mockup (1440-review, 1440-kept, 1440-not-this-one).


🔄 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/8411 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `feat/mari-companion` ← **Head:** `feat/mari-in-field-review` --- ### 📝 Commits (1) - [`a6e4594`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a6e459447805bb789df15115125fa01c775acec6) feat(mari): review Prof. Mari's held character change inside the fields ### 📊 Changes **9 files changed** (+1220 additions, -413 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/characters/CharacterEditor.tsx` (+485 -403) ➕ `packages/client/src/components/characters/MariFieldReview.tsx` (+321 -0) 📝 `packages/client/src/components/chat/HomeProfessorMariChat.tsx` (+74 -0) 📝 `packages/client/src/components/chat/MariChangeReceipt.tsx` (+2 -2) 📝 `packages/client/src/lib/mari-editor-fields.ts` (+135 -6) 📝 `packages/client/src/localization/locales/en.json` (+16 -0) 📝 `packages/client/src/stores/ui.store.ts` (+7 -0) 📝 `packages/client/src/styles/mari.css` (+118 -2) 📝 `scripts/regressions/mari-editor-fields.regression.ts` (+62 -0) </details> ### 📄 Description ## Linked issue No issue: planned work, slice 5 of the Professor Mari companion feature (Prof. Mari floats next to real editors and live-edits them). Slices are PRed into the integration branch `feat/mari-companion` (slices 1–4: #8401, #8403, #8405, #8406, #8407). ## Why this change A held (waiting-for-approval) change from Prof. Mari was only visible on her card in the chat, away from the field it changes. The agreed design: while a change waits, each changed field shows her diff in place, with Keep / Not this one / Edit / Next at the field, so the user decides where they read and write. ## What changed - `components/characters/MariFieldReview.tsx` (new): the in-field review box (struck old words, green new words, the same `TextBody` as her card), "Keep all N" (just "Keep" for one field), Not this one, Edit, Next; keyboard Ctrl/Cmd+Enter keep, Esc reject, Tab next. After Keep: "Edited by Prof. Mari · Undo" (+ "Saved your unsaved text too" when Keep saved the user's text first). A visible line says when Keep also applies changes outside this character. - `CharacterEditor.tsx`: 8 textareas wrapped in `<MariFieldReview>` (the large diff is re-indent; `git diff -w` shows the real change). Keep saves the user's unsaved text first; fields taken over with Edit are restored as unsaved text after Keep (per character, cleared on failed save or character switch). - `HomeProfessorMariChat.tsx`: publishes the waiting / busy / kept review from her last message (`mariHeldChanges`, held calls, deferred mutations) to `ui.store` (`mariFieldReview`, transient). Keep sends the existing Accept chip, Not this one sends the decline chip plus "Propose the change again without the X field.", Undo uses the existing `answerAll(…, false)`. Actions report whether the send started, so a blocked send (no connection, busy) leaves the review in place. - `lib/mari-editor-fields.ts`: pure helpers `heldCharacterFields`, `keptCharacterFields`, `characterFieldValue`, `withCharacterFieldValue`, shared `characterPatchValues`; regression extended. - `MariChangeReceipt.tsx`: exports `TextBody` and `undoLabel` for reuse. `mari.css`: review box styles (faint static edge, 2.75rem touch buttons). `en.json`: `mari.fieldReview.*` keys. No new approval contract: accept is whole-change, as agreed. Scope cuts (open for follow-up): - Not this one declines the whole change and asks her to re-propose; dropping just one field needs a server partial-accept. - Bypass permissions mode does not auto-save unsaved text yet; the user's text still wins (slice 1 toast). - Only textarea fields; name, creator, version, tags, alternate greetings and depth prompt stay on her card. - Review shows only while Prof. Mari is open (her chat sends the replies). ## 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` exit 0; client build exit 0; ESLint clean on touched files (one pre-existing warning in `HomeProfessorMariChat.tsx:387`); Prettier, `localization:check` and the `mari-editor-fields` regression pass. Two Opus read-only review passes: first found 2 high (stale Edit text restored, possibly into another character; "Not this one" state leaking across characters), 3 medium (double Keep / Keep into another thread; textarea unmounting while typing; focus lost) and low issues; second pass found a blocked send hiding the review. All fixed. Playwright on a throwaway instance (empty data, no model; the held turn is seeded through the chat API and Accept runs the real server path), 50/50 checks at 1440 / 1024 / 390 px: diff in field, Keep and Ctrl+Enter, Esc declines without closing her, Tab / Next, Edit, Undo incl. conflict, saved-unsaved message, failed save sends nothing, review waits while typing, focus return, no-connection Keep / Not this one leave the review, 390 px no horizontal scroll. Not yet run with a real model. To verify manually: 1. Open a character with Prof. Mari docked; ask her to change Description and Personality in Manual mode. Both fields show her diff with "Keep all 2". 2. Keep: fields update, "Edited by Prof. Mari · Undo" shows; Undo restores. 3. Type in Description, then ask her again; the review waits until you leave the field; Keep also saves your typed text and says so. 4. Not this one on a field: she is asked again without that field. 5. Edit puts her text in the field as an unsaved edit; Save keeps it. 6. Ctrl/Cmd+Enter, Esc, Tab inside the review box. ## 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 at 1440, 1024 and 390 px are local (`.tmp/mari-companion/slice5/`); attach on request. They match the approved mockup (`1440-review`, `1440-kept`, `1440-not-this-one`). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:45:47 +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#8584
No description provided.