[PR #8524] [MERGED] fix(mari): her field context follows the focused editor field #8653

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

📋 Pull Request Information

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

Base: staging ← Head: fix/mari-companion-field-focus


📝 Commits (3)

  • bd72ea0 fix(mari): her field context follows the focused editor field
  • 8de789e fix(mari): field chip follows @ picks and record switches, sends current field text
  • 5dbcd19 fix(mari): cap field draft text at the route schema limits

📊 Changes

8 files changed (+135 additions, -23 deletions)

View changed files

📝 packages/client/src/components/characters/MariFieldReview.tsx (+1 -1)
📝 packages/client/src/components/chat/HomeProfessorMariChat.tsx (+86 -10)
📝 packages/client/src/components/layout/GlobalOmnibar.tsx (+1 -0)
📝 packages/client/src/components/layout/omnibar/OmnibarMariPane.tsx (+3 -0)
📝 packages/client/src/lib/mari-editor-fields.ts (+3 -2)
📝 packages/client/src/styles/globals.css (+3 -1)
📝 packages/client/src/styles/mari.css (+35 -9)
📝 scripts/regressions/mari-editor-fields.regression.ts (+3 -0)

📄 Description

Linked issue

No issue: follow-up to the Professor Mari companion (#8418), from maintainer testing.

Why this change

While Prof. Mari sat beside the Character editor, clicking another field did not change her field context: she kept talking about the field that had focus when she opened. Nothing in the editor showed which field she was looking at. After Keep, the "Edited by Prof. Mari · Undo" line under the field was tiny and hard to see.

What changed

  • HomeProfessorMariChat.tsx: in companion mode (desktop panel or phone sheet), focusing another anchored field of the open editor moves her field chip there (existing withEditorField, now through one withCapturedEditorField helper shared with the "@" pick, so the field's unsaved text goes with it and the old field's draft is dropped). Not in the modal window, not for focus inside her panel or unanchored controls; ids are compared, so a chip the user removed stays removed when they refocus the same field.
  • The anchor her chip points at gets data-mari-focus (only for the open editor's record; the focused element wins when two anchors share an id, e.g. the header and Metadata Name). Cleared when the chip is removed, she closes, the mode changes or the character changes.
  • mari.css / globals.css: the mark is a faint static 1px edge in the character type gradient (.mari-panel-gradient--characters, no new colours); it yields to the reveal pulse and does not touch the working glow.
  • MariFieldReview.tsx + mari.css: the kept line is a calm band in the same gradient, readable text, her avatar, Undo as a real button (2.75rem on touch), 0.5rem spacing.
  • GlobalOmnibar.tsx, OmnibarMariPane.tsx: pass editorCompanion to her chat.

No new copy.

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 build incl. tsc passes; ESLint clean on touched files (one pre-existing warning, serverRun); Prettier clean; mari-editor-fields, omnibar-settings-sync, mobile-safe-area-inset regressions pass. Opus read-only review: 1 medium (wrong Name anchor marked) and 3 low issues, all fixed. Playwright on a throwaway instance (no model), 37/37 at 1440 (panel) and 390 (sheet): chip and mark follow Description → Personality, click in her panel changes nothing, removing the chip clears the mark and refocus does not bring it back, modal window does not follow, Metadata Name marks the right anchor, typed text goes with the moved chip, tab switch keeps the mark, kept line before/after.

To verify manually:

  1. Open a character, open Prof. Mari beside it. Click Description, then Personality: her chip and the faint edge move.
  2. Click inside her panel: nothing moves. Remove the chip: the edge goes. Click the same field again: the chip stays removed.
  3. Type in a field without saving, click it, ask "fix this": she uses the typed text.
  4. Keep one of her changes: "Edited by Prof. Mari · Undo" is easy to read; Undo works. Check light and dark.
  5. Phone: same in the bottom sheet.

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 (.tmp/mari-companion/focus/: 1440 dark/light, 390, kept line before/after); 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/8524 **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:** `fix/mari-companion-field-focus` --- ### 📝 Commits (3) - [`bd72ea0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bd72ea0810d05609b49e9edf86760646b831e1c5) fix(mari): her field context follows the focused editor field - [`8de789e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8de789e06416c142e0565048d7998dcea52c1e4a) fix(mari): field chip follows @ picks and record switches, sends current field text - [`5dbcd19`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5dbcd19dae258d126eb08ce2ac6886e4f381a0b6) fix(mari): cap field draft text at the route schema limits ### 📊 Changes **8 files changed** (+135 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/characters/MariFieldReview.tsx` (+1 -1) 📝 `packages/client/src/components/chat/HomeProfessorMariChat.tsx` (+86 -10) 📝 `packages/client/src/components/layout/GlobalOmnibar.tsx` (+1 -0) 📝 `packages/client/src/components/layout/omnibar/OmnibarMariPane.tsx` (+3 -0) 📝 `packages/client/src/lib/mari-editor-fields.ts` (+3 -2) 📝 `packages/client/src/styles/globals.css` (+3 -1) 📝 `packages/client/src/styles/mari.css` (+35 -9) 📝 `scripts/regressions/mari-editor-fields.regression.ts` (+3 -0) </details> ### 📄 Description ## Linked issue No issue: follow-up to the Professor Mari companion (#8418), from maintainer testing. ## Why this change While Prof. Mari sat beside the Character editor, clicking another field did not change her field context: she kept talking about the field that had focus when she opened. Nothing in the editor showed which field she was looking at. After Keep, the "Edited by Prof. Mari · Undo" line under the field was tiny and hard to see. ## What changed - `HomeProfessorMariChat.tsx`: in companion mode (desktop panel or phone sheet), focusing another anchored field of the open editor moves her field chip there (existing `withEditorField`, now through one `withCapturedEditorField` helper shared with the "@" pick, so the field's unsaved text goes with it and the old field's draft is dropped). Not in the modal window, not for focus inside her panel or unanchored controls; ids are compared, so a chip the user removed stays removed when they refocus the same field. - The anchor her chip points at gets `data-mari-focus` (only for the open editor's record; the focused element wins when two anchors share an id, e.g. the header and Metadata Name). Cleared when the chip is removed, she closes, the mode changes or the character changes. - `mari.css` / `globals.css`: the mark is a faint static 1px edge in the character type gradient (`.mari-panel-gradient--characters`, no new colours); it yields to the reveal pulse and does not touch the working glow. - `MariFieldReview.tsx` + `mari.css`: the kept line is a calm band in the same gradient, readable text, her avatar, Undo as a real button (2.75rem on touch), 0.5rem spacing. - `GlobalOmnibar.tsx`, `OmnibarMariPane.tsx`: pass `editorCompanion` to her chat. No new copy. ## 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 build incl. `tsc` passes; ESLint clean on touched files (one pre-existing warning, `serverRun`); Prettier clean; `mari-editor-fields`, `omnibar-settings-sync`, `mobile-safe-area-inset` regressions pass. Opus read-only review: 1 medium (wrong Name anchor marked) and 3 low issues, all fixed. Playwright on a throwaway instance (no model), 37/37 at 1440 (panel) and 390 (sheet): chip and mark follow Description → Personality, click in her panel changes nothing, removing the chip clears the mark and refocus does not bring it back, modal window does not follow, Metadata Name marks the right anchor, typed text goes with the moved chip, tab switch keeps the mark, kept line before/after. To verify manually: 1. Open a character, open Prof. Mari beside it. Click Description, then Personality: her chip and the faint edge move. 2. Click inside her panel: nothing moves. Remove the chip: the edge goes. Click the same field again: the chip stays removed. 3. Type in a field without saving, click it, ask "fix this": she uses the typed text. 4. Keep one of her changes: "Edited by Prof. Mari · Undo" is easy to read; Undo works. Check light and dark. 5. Phone: same in the bottom sheet. ## 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 (`.tmp/mari-companion/focus/`: 1440 dark/light, 390, kept line before/after); 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:15 +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#8653
No description provided.