[PR #8405] [MERGED] fix(mari): header focus and Open-at-field on held character cards #8580

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

📋 Pull Request Information

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

Base: feat/mari-companion ← Head: fix/mari-field-anchors-live


📝 Commits (1)

  • 65bca12 fix(mari): header focus and Open-at-field on held character cards

📊 Changes

4 files changed (+28 additions, -3 deletions)

View changed files

📝 packages/client/src/components/characters/CharacterEditor.tsx (+1 -0)
📝 packages/client/src/components/chat/MariApprovalCards.tsx (+22 -0)
📝 packages/client/src/hooks/use-mari-editor-fields.ts (+4 -2)
📝 packages/client/src/lib/mari-editor-fields.ts (+1 -1)

📄 Description

Linked issue

No issue: planned work, follow-up to slice 2 (#8403) of the Professor Mari companion feature. PRed into the integration branch feat/mari-companion.

Why this change

A live test of slice 2 with a real model (MiniMax M3 via Bifrost) found two gaps:

  1. The Character editor header (Name and Title/comment inputs) sits outside the scroll root that listened for focus. Focusing a header input after a body field left the old field in place, so the omnibar still offered "Improve Description with Prof. Mari" while the user typed the title.
  2. When Prof. Mari holds a one-field character change behind Accept (Manual mode), the "Rewrite 1 field of …" card is the held-change receipt, not MariEditEasyViewer, so it had no "Open at this field" link.

What changed

  • use-mari-editor-fields.ts: the focus listener sits on the editor shell (.mari-editor-shell), so header inputs report or clear the field too. Reveal and glow still search only the scroll root.
  • CharacterEditor.tsx: the header Name input carries data-mari-field="name".
  • MariApprovalCards.tsx (MariHeldChangeCard): for one held character.update (server action aliases included), each anchored field box gets the same "Open at this field" link as the change card. Reuses openCharacterAtField, characterPatchFieldId and the existing strings.
  • lib/mari-editor-fields.ts: exports appDataAction.

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, ESLint and Prettier clean on the touched files, mari-editor-fields regression passed. Live Playwright run on a throwaway instance (copied data, MiniMax M3 via Bifrost, 1 model run):

  • 1440 px: Description → header Title → omnibar shows no field suggestion; Description → header Name → "Improve Name with Prof. Mari". 390 px: Description → header Title → no suggestion.
  • Manual mode, one-field Scenario change: the held card shows "Open at this field" (aria-label "Open Scenario in the editor"); clicking it closed the omnibar, scrolled to Scenario and pulsed it (~1.2 s). "Don't apply" left the character unchanged. No console errors.

Not covered by the live run: clicking the link from another page (editor not open). The same openCharacterAtField path is used by the change-card link from #8403.

Also seen in the live run, no change here: the working glow on character.update lasts only ~30–50 ms because the step is fast; it becomes useful with streaming (slice 8).

To verify manually:

  1. Focus Description, then click the header Title/comment input, open the omnibar: no "Improve … with Prof. Mari" suggestion. Click the header Name input: it names Name.
  2. In Manual mode, ask Prof. Mari to change one field of the open character. On the "Rewrite 1 field of …" card, click "Open at this field": the omnibar closes and the editor scrolls to that field and pulses it.
  3. Repeat 2 from the character list (editor closed) and with unsaved edits in another character (one leave prompt).

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 and 390 px were taken locally (.tmp/mari-companion/live2/r3-*); 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/8405 **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:** `fix/mari-field-anchors-live` --- ### 📝 Commits (1) - [`65bca12`](https://github.com/Pasta-Devs/Marinara-Engine/commit/65bca1276aead709b9458c84d99ca90f3dee3815) fix(mari): header focus and Open-at-field on held character cards ### 📊 Changes **4 files changed** (+28 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/characters/CharacterEditor.tsx` (+1 -0) 📝 `packages/client/src/components/chat/MariApprovalCards.tsx` (+22 -0) 📝 `packages/client/src/hooks/use-mari-editor-fields.ts` (+4 -2) 📝 `packages/client/src/lib/mari-editor-fields.ts` (+1 -1) </details> ### 📄 Description ## Linked issue No issue: planned work, follow-up to slice 2 (#8403) of the Professor Mari companion feature. PRed into the integration branch `feat/mari-companion`. ## Why this change A live test of slice 2 with a real model (MiniMax M3 via Bifrost) found two gaps: 1. The Character editor header (Name and Title/comment inputs) sits outside the scroll root that listened for focus. Focusing a header input after a body field left the old field in place, so the omnibar still offered "Improve Description with Prof. Mari" while the user typed the title. 2. When Prof. Mari holds a one-field character change behind Accept (Manual mode), the "Rewrite 1 field of …" card is the held-change receipt, not `MariEditEasyViewer`, so it had no "Open at this field" link. ## What changed - `use-mari-editor-fields.ts`: the focus listener sits on the editor shell (`.mari-editor-shell`), so header inputs report or clear the field too. Reveal and glow still search only the scroll root. - `CharacterEditor.tsx`: the header Name input carries `data-mari-field="name"`. - `MariApprovalCards.tsx` (`MariHeldChangeCard`): for one held `character.update` (server action aliases included), each anchored field box gets the same "Open at this field" link as the change card. Reuses `openCharacterAtField`, `characterPatchFieldId` and the existing strings. - `lib/mari-editor-fields.ts`: exports `appDataAction`. ## 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, ESLint and Prettier clean on the touched files, `mari-editor-fields` regression passed. Live Playwright run on a throwaway instance (copied data, MiniMax M3 via Bifrost, 1 model run): - 1440 px: Description → header Title → omnibar shows no field suggestion; Description → header Name → "Improve Name with Prof. Mari". 390 px: Description → header Title → no suggestion. - Manual mode, one-field Scenario change: the held card shows "Open at this field" (aria-label "Open Scenario in the editor"); clicking it closed the omnibar, scrolled to Scenario and pulsed it (~1.2 s). "Don't apply" left the character unchanged. No console errors. Not covered by the live run: clicking the link from another page (editor not open). The same `openCharacterAtField` path is used by the change-card link from #8403. Also seen in the live run, no change here: the working glow on `character.update` lasts only ~30–50 ms because the step is fast; it becomes useful with streaming (slice 8). To verify manually: 1. Focus Description, then click the header Title/comment input, open the omnibar: no "Improve … with Prof. Mari" suggestion. Click the header Name input: it names Name. 2. In Manual mode, ask Prof. Mari to change one field of the open character. On the "Rewrite 1 field of …" card, click "Open at this field": the omnibar closes and the editor scrolls to that field and pulses it. 3. Repeat 2 from the character list (editor closed) and with unsaved edits in another character (one leave prompt). ## 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 and 390 px were taken locally (`.tmp/mari-companion/live2/r3-*`); 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:45:44 +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#8580
No description provided.