[PR #8570] [MERGED] feat(mari): Bypass and accept-edits save your field text first; kept line shows Undo until #8680

Closed
opened 2026-11-07 17:38:52 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: staging ← Head: feat/mari-bypass-save-undo-until


📝 Commits (7)

  • 07b2be8 feat(mari): Bypass and accept-edits save your field text first; kept line shows Undo until
  • 42689f7 fix(mari): save the editor before a Bypass send; keep Edit text and the short Undo deadline
  • 692d96b fix(mari): clear the composer before the pre-save wait; scope the saved-text note to its chat and send
  • b3db346 fix(mari): list chatId in the kept-note effect deps
  • 2601386 fix(mari): keep the pre-save mark when the chat id is set during the send
  • 0451cea Merge staging into feat/mari-bypass-save-undo-until
  • 3f8eede fix(mari): say why a pre-save-stopped send did not go out; refresh held messages

📊 Changes

9 files changed (+119 additions, -32 deletions)

View changed files

📝 packages/client/src/components/characters/CharacterEditor.tsx (+10 -9)
📝 packages/client/src/components/characters/MariFieldReview.tsx (+27 -4)
📝 packages/client/src/components/chat/HomeProfessorMariChat.tsx (+33 -4)
📝 packages/client/src/components/lorebooks/LorebookEditor.tsx (+7 -6)
📝 packages/client/src/components/personas/PersonaEditor.tsx (+10 -9)
📝 packages/client/src/lib/mari-editor-fields.ts (+13 -0)
📝 packages/client/src/localization/locales/en.json (+2 -0)
📝 packages/client/src/stores/ui.store.ts (+5 -0)
📝 scripts/regressions/mari-editor-fields.regression.ts (+12 -0)

📄 Description

Linked issue

No issue: planned work from the Professor Mari companion plan (#8418): Bypass save + Undo until.

Why this change

In Bypass permissions (and accept-edits), Prof. Mari's writes apply without a review. If you had unsaved text in an editor field, her write and your text could conflict, so your text could be lost. Keep in Manual mode already saves your text first (slice 5); these modes had no review step to do it. The kept line also gave no deadline for Undo, because her undo window (about 14 days) is longer than the "today/tomorrow" label covers.

What changed

  • In Bypass and accept-edits mode, her chat saves the open editor (character, persona, lorebook) before the send goes out. A failed save stops the send, keeps your message in the composer and shows the editor's save error.
  • The kept line says "Saved your unsaved text too" when that send saved your text, tied to the message of that run.
  • A plain save (beforeKeep(null)) leaves Edit's taken-over text alone, so Edit + Keep in Bypass mode keeps your edited text.
  • The kept line shows "Undo until " when the window is longer than a day. At phone width the date is hidden on screen (still read by screen readers), so Undo stays on the line.
  • Regression cases for appliesWithoutReview and keptAfterPresave.

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

Live run on a copy of real data with MiniMax M3 (nanogpt/minimax/minimax-m3), Playwright at 1440 and 390, before the review fixes:

Step 1440 390
Two fields, Keep all 2, kept line, Undo pass pass (sheet auto-peeks, Undo on the same line)
Unsaved Description, change Personality, Keep pass pass
"Not this one", she proposes again fail (model quirk) review pass, re-propose fail (provider 429)
Edit, then Save pass pass
Other field, "fix this" chip moves, no review (model quirk) chip moves, no review (provider 502)
Bypass: unsaved text saved first, kept line, Undo pass pass

Model quirks: she often describes a change in text without writing it, offers "Apply..." chips instead of holding a change, ignores the "Not this one" decline, and asks what to fix for "fix this".

Agent-run checks after the review fixes: client build with tsc, ESLint (0 errors), Prettier, localization:check, the mari-editor-fields regression, and seeded Playwright runs on a throwaway server (no model) at 1440 and 390: character 8/8, persona 8/8, lorebook 6/6. These cover the "Undo until" line, the Bypass pre-save, no kept line for a run that wrote nothing, nothing saved in Manual mode, and Edit + Keep in Bypass mode keeping the edited text (character and persona).

An Opus review found 1 high, 2 medium and 2 low issues. All are fixed in the second commit: the pre-save moved from the busy state into the send path, it no longer resets Edit's taken-over text, the "saved too" mark is tied to the run's message, and only the new date label is hidden at phone width.

Known limits:

  • A message queued while she is busy skips the pre-save (marked ponytail: in the send path).
  • The pre-save runs for any open editor with her review, also when the message is about something else.

To verify manually:

  1. In Bypass mode, type unsaved text in a character's Description, ask her to change the Description, and check that your text was saved first and the kept line says "Saved your unsaved text too". Then press Undo and check that your saved text comes back.
  2. In Bypass mode with two held fields, press Edit on one field, type, then Keep the other field. Check that your edited text is still in the field.
  3. Open the kept line at 390 px and check that Undo stays on the same line as "Edited by Prof. Mari".
  4. Repeat step 1 in a persona and a lorebook editor, and once in accept-edits mode.

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 were taken locally and are not attached.


🔄 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/8570 **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-bypass-save-undo-until` --- ### 📝 Commits (7) - [`07b2be8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/07b2be81fc8c0e870df93ae485b868e6e8f8c9c7) feat(mari): Bypass and accept-edits save your field text first; kept line shows Undo until - [`42689f7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/42689f7d38fca2b0485447bae9e46e02dd586c30) fix(mari): save the editor before a Bypass send; keep Edit text and the short Undo deadline - [`692d96b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/692d96bbb486bf247c352c2d89e95814e5098f1f) fix(mari): clear the composer before the pre-save wait; scope the saved-text note to its chat and send - [`b3db346`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b3db3468ad33324c1004d0186caef82eb1a34a49) fix(mari): list chatId in the kept-note effect deps - [`2601386`](https://github.com/Pasta-Devs/Marinara-Engine/commit/26013861e95e50e5dd03d3a0d08b1dbe3a98afe9) fix(mari): keep the pre-save mark when the chat id is set during the send - [`0451cea`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0451ceae70ca237759503c9644e20e04957df44d) Merge staging into feat/mari-bypass-save-undo-until - [`3f8eede`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3f8eede952388e2d31820637789e930a3e38e896) fix(mari): say why a pre-save-stopped send did not go out; refresh held messages ### 📊 Changes **9 files changed** (+119 additions, -32 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/characters/CharacterEditor.tsx` (+10 -9) 📝 `packages/client/src/components/characters/MariFieldReview.tsx` (+27 -4) 📝 `packages/client/src/components/chat/HomeProfessorMariChat.tsx` (+33 -4) 📝 `packages/client/src/components/lorebooks/LorebookEditor.tsx` (+7 -6) 📝 `packages/client/src/components/personas/PersonaEditor.tsx` (+10 -9) 📝 `packages/client/src/lib/mari-editor-fields.ts` (+13 -0) 📝 `packages/client/src/localization/locales/en.json` (+2 -0) 📝 `packages/client/src/stores/ui.store.ts` (+5 -0) 📝 `scripts/regressions/mari-editor-fields.regression.ts` (+12 -0) </details> ### 📄 Description ## Linked issue No issue: planned work from the Professor Mari companion plan (#8418): Bypass save + Undo until. ## Why this change In Bypass permissions (and accept-edits), Prof. Mari's writes apply without a review. If you had unsaved text in an editor field, her write and your text could conflict, so your text could be lost. Keep in Manual mode already saves your text first (slice 5); these modes had no review step to do it. The kept line also gave no deadline for Undo, because her undo window (about 14 days) is longer than the "today/tomorrow" label covers. ## What changed - In Bypass and accept-edits mode, her chat saves the open editor (character, persona, lorebook) before the send goes out. A failed save stops the send, keeps your message in the composer and shows the editor's save error. - The kept line says "Saved your unsaved text too" when that send saved your text, tied to the message of that run. - A plain save (`beforeKeep(null)`) leaves Edit's taken-over text alone, so Edit + Keep in Bypass mode keeps your edited text. - The kept line shows "Undo until <date>" when the window is longer than a day. At phone width the date is hidden on screen (still read by screen readers), so Undo stays on the line. - Regression cases for `appliesWithoutReview` and `keptAfterPresave`. ## 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 Live run on a copy of real data with MiniMax M3 (`nanogpt/minimax/minimax-m3`), Playwright at 1440 and 390, before the review fixes: | Step | 1440 | 390 | |---|---|---| | Two fields, Keep all 2, kept line, Undo | pass | pass (sheet auto-peeks, Undo on the same line) | | Unsaved Description, change Personality, Keep | pass | pass | | "Not this one", she proposes again | fail (model quirk) | review pass, re-propose fail (provider 429) | | Edit, then Save | pass | pass | | Other field, "fix this" | chip moves, no review (model quirk) | chip moves, no review (provider 502) | | Bypass: unsaved text saved first, kept line, Undo | pass | pass | Model quirks: she often describes a change in text without writing it, offers "Apply..." chips instead of holding a change, ignores the "Not this one" decline, and asks what to fix for "fix this". Agent-run checks after the review fixes: client build with tsc, ESLint (0 errors), Prettier, `localization:check`, the `mari-editor-fields` regression, and seeded Playwright runs on a throwaway server (no model) at 1440 and 390: character 8/8, persona 8/8, lorebook 6/6. These cover the "Undo until" line, the Bypass pre-save, no kept line for a run that wrote nothing, nothing saved in Manual mode, and Edit + Keep in Bypass mode keeping the edited text (character and persona). An Opus review found 1 high, 2 medium and 2 low issues. All are fixed in the second commit: the pre-save moved from the busy state into the send path, it no longer resets Edit's taken-over text, the "saved too" mark is tied to the run's message, and only the new date label is hidden at phone width. Known limits: - A message queued while she is busy skips the pre-save (marked `ponytail:` in the send path). - The pre-save runs for any open editor with her review, also when the message is about something else. To verify manually: 1. In Bypass mode, type unsaved text in a character's Description, ask her to change the Description, and check that your text was saved first and the kept line says "Saved your unsaved text too". Then press Undo and check that your saved text comes back. 2. In Bypass mode with two held fields, press Edit on one field, type, then Keep the other field. Check that your edited text is still in the field. 3. Open the kept line at 390 px and check that Undo stays on the same line as "Edited by Prof. Mari". 4. Repeat step 1 in a persona and a lorebook editor, and once in accept-edits mode. ## 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 were taken locally and are not attached. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 17:38:52 +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#8680
No description provided.