[PR #8407] [MERGED] feat(mari): Prof. Mari floats as a companion panel next to the Character editor #8582

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

📋 Pull Request Information

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

Base: feat/mari-companion ← Head: feat/mari-companion-panel


📝 Commits (2)

  • f55525a feat(mari): Prof. Mari floats as a companion panel next to the Character editor
  • a21f5c4 Merge feat/mari-companion (slice 3) into the companion panel

📊 Changes

13 files changed (+481 additions, -47 deletions)

View changed files

📝 packages/client/src/components/characters/CharacterEditor.tsx (+5 -2)
📝 packages/client/src/components/chat/HomeProfessorMariChat.tsx (+19 -0)
📝 packages/client/src/components/chat/MariEditEasyViewer.tsx (+17 -1)
📝 packages/client/src/components/chat/mari/mari-chat-helpers.tsx (+26 -0)
📝 packages/client/src/components/layout/GlobalOmnibar.tsx (+104 -22)
📝 packages/client/src/components/layout/GlobalOmnibarHost.tsx (+1 -15)
📝 packages/client/src/components/layout/omnibar/OmnibarMariPane.tsx (+5 -1)
➕ packages/client/src/components/layout/omnibar/use-mari-companion.tsx (+174 -0)
📝 packages/client/src/hooks/use-mari-editor-fields.ts (+34 -2)
📝 packages/client/src/lib/professor-mari-command-center-context.ts (+1 -1)
📝 packages/client/src/localization/locales/en.json (+3 -0)
📝 packages/client/src/stores/ui.store.ts (+33 -3)
📝 packages/client/src/styles/mari.css (+59 -0)

📄 Description

Linked issue

No issue: planned work, slice 4 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–3: #8401, #8403, #8405, #8406). This branch is based on feat/mari-companion without slice 3 (#8406 is still open); both touch GlobalOmnibar.tsx lightly.

Why this change

Prof. Mari opened as a modal window over the editor, so the user could not see or type in the field she was talking about. The design agreed with the maintainer: on desktop she morphs into a solid floating panel at a fixed place on the left, over the blank space beside the centered editor content. It is not a sidebar: the editor header stays full width and only the field column moves right, as little as needed, so the field and its buttons stay on screen.

What changed

  • omnibar/use-mari-companion.tsx (new): decides companion vs. window, places the panel from the editor shell (12px below the header bar, 12px from the left and bottom), shifts the field column by max(0, panelRight + 12 − columnLeft) via inline margin-inline-start (plus max-width when it would overflow), and owns the resize handle. Observes only the shell and the scroll root; the drag previews locally and persists on release. If the shell cannot fit a 24 rem panel plus a 28 rem column, she stays the normal window and the toggle hides.
  • GlobalOmnibar.tsx: in companion mode the same element (no remount) has no backdrop, blur, focus trap or outside close; role="complementary" with a localized label; Esc closes only from inside her panel; Cmd+J keeps the companion and focuses her composer; dock toggle in her header (aria-pressed); 200 ms opacity/scale morph, none with reduced motion. Focus is restored on close only if it was inside her panel or on body; when the viewport drops below 1024 px focus moves into the now-modal window.
  • ui.store.ts: persisted mariCompanionDocked (default on) and mariCompanionWidthRem (24–32 rem); transient mariCompanionRoot; revealMariField(..., { scroll: false }).
  • use-mari-editor-fields.ts + CharacterEditor.tsx: an editor opts in with one line (useMariCompanion…); readiness is !isLoading && !!formData, so the panel and the focus root follow a character switch.
  • Composer context follows the open editor (HomeProfessorMariChat.tsx, mari-chat-helpers.tsx retargetEditorContext, OmnibarMariPane.tsx): when the character changes in companion mode, the editor chip is replaced, and the old field / command-center result is dropped. Unrelated context (a chat) and her conversation stay.
  • MariEditEasyViewer.tsx: hovering a change-card row with an anchored field of the open character pulses it once (companion mode only, no scroll).
  • mari.css: panel and resize-handle styles. 3 English strings.

Phone and tablet (< 1024 px) are unchanged; the bottom sheet is slice 6. Only the Character editor opts in; slice 7 adds others.

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 clean on touched files (one pre-existing warning in HomeProfessorMariChat.tsx:385, not from this change); Prettier and localization:check pass; client build passes. An Opus read-only review found 1 high (panel broke on switching to an uncached character), 3 medium (Esc on the page turned her into the modal window; narrow shell overflow; layout work on every resize) and 5 low issues; all fixed. Two more bugs found by the live run and fixed: the resize handle sat on the left edge, and the composer kept the previous character's context after a switch.

Playwright on a throwaway instance (empty data, no model calls), 38/38 checks at 1440 / 1024 / 390 px: role and placement, header does not move, column right of the panel and on screen at max width, tabs visible at min width, typing in Description while she is open, editor click and page Esc do not close her, Esc in her panel does, toggle to window and back (survives reload), normal window with no editor, 390 px unchanged, switch to an uncached character, narrow shell falls back to the window, drag persists on release only, Cmd+J keeps the companion, intercepted send after a switch carries the new character and no old field.

To verify manually:

  1. Open a character at ≥ 1024 px and open Prof. Mari: she sits as a solid panel at the left below the editor header; the header does not move; the fields shift right only as needed.
  2. Type in Description while she is open; click in the editor; press Esc outside her panel: she stays. Press Esc inside her panel: she closes.
  3. Drag her right edge wider; the column narrows but stays on screen; reload: the width is kept.
  4. Use the toggle in her header: she becomes the centered window; reload: the choice is kept.
  5. Switch to another character while she is open: the context chip changes to the new character, no field chip of the old one.
  6. Open the chat sidebar at 1024 px: she falls back to the window.
  7. At 390 px nothing changes.

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/slice4/); attach on request. They match the mockup the maintainer approved (.tmp/mari-companion/mockup/shots/1440-companion.png).


🔄 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/8407 **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-companion-panel` --- ### 📝 Commits (2) - [`f55525a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f55525a75672f7431a7e7f2cc0f796a24cd86f85) feat(mari): Prof. Mari floats as a companion panel next to the Character editor - [`a21f5c4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a21f5c47ebcbf55475ad60eb292856989b50baa0) Merge feat/mari-companion (slice 3) into the companion panel ### 📊 Changes **13 files changed** (+481 additions, -47 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/characters/CharacterEditor.tsx` (+5 -2) 📝 `packages/client/src/components/chat/HomeProfessorMariChat.tsx` (+19 -0) 📝 `packages/client/src/components/chat/MariEditEasyViewer.tsx` (+17 -1) 📝 `packages/client/src/components/chat/mari/mari-chat-helpers.tsx` (+26 -0) 📝 `packages/client/src/components/layout/GlobalOmnibar.tsx` (+104 -22) 📝 `packages/client/src/components/layout/GlobalOmnibarHost.tsx` (+1 -15) 📝 `packages/client/src/components/layout/omnibar/OmnibarMariPane.tsx` (+5 -1) ➕ `packages/client/src/components/layout/omnibar/use-mari-companion.tsx` (+174 -0) 📝 `packages/client/src/hooks/use-mari-editor-fields.ts` (+34 -2) 📝 `packages/client/src/lib/professor-mari-command-center-context.ts` (+1 -1) 📝 `packages/client/src/localization/locales/en.json` (+3 -0) 📝 `packages/client/src/stores/ui.store.ts` (+33 -3) 📝 `packages/client/src/styles/mari.css` (+59 -0) </details> ### 📄 Description ## Linked issue No issue: planned work, slice 4 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–3: #8401, #8403, #8405, #8406). This branch is based on `feat/mari-companion` without slice 3 (#8406 is still open); both touch `GlobalOmnibar.tsx` lightly. ## Why this change Prof. Mari opened as a modal window over the editor, so the user could not see or type in the field she was talking about. The design agreed with the maintainer: on desktop she morphs into a solid floating panel at a fixed place on the left, over the blank space beside the centered editor content. It is not a sidebar: the editor header stays full width and only the field column moves right, as little as needed, so the field and its buttons stay on screen. ## What changed - `omnibar/use-mari-companion.tsx` (new): decides companion vs. window, places the panel from the editor shell (12px below the header bar, 12px from the left and bottom), shifts the field column by `max(0, panelRight + 12 − columnLeft)` via inline `margin-inline-start` (plus `max-width` when it would overflow), and owns the resize handle. Observes only the shell and the scroll root; the drag previews locally and persists on release. If the shell cannot fit a 24 rem panel plus a 28 rem column, she stays the normal window and the toggle hides. - `GlobalOmnibar.tsx`: in companion mode the same element (no remount) has no backdrop, blur, focus trap or outside close; `role="complementary"` with a localized label; Esc closes only from inside her panel; Cmd+J keeps the companion and focuses her composer; dock toggle in her header (`aria-pressed`); 200 ms opacity/scale morph, none with reduced motion. Focus is restored on close only if it was inside her panel or on body; when the viewport drops below 1024 px focus moves into the now-modal window. - `ui.store.ts`: persisted `mariCompanionDocked` (default on) and `mariCompanionWidthRem` (24–32 rem); transient `mariCompanionRoot`; `revealMariField(..., { scroll: false })`. - `use-mari-editor-fields.ts` + `CharacterEditor.tsx`: an editor opts in with one line (`useMariCompanion…`); readiness is `!isLoading && !!formData`, so the panel and the focus root follow a character switch. - Composer context follows the open editor (`HomeProfessorMariChat.tsx`, `mari-chat-helpers.tsx` `retargetEditorContext`, `OmnibarMariPane.tsx`): when the character changes in companion mode, the editor chip is replaced, and the old field / command-center result is dropped. Unrelated context (a chat) and her conversation stay. - `MariEditEasyViewer.tsx`: hovering a change-card row with an anchored field of the open character pulses it once (companion mode only, no scroll). - `mari.css`: panel and resize-handle styles. 3 English strings. Phone and tablet (< 1024 px) are unchanged; the bottom sheet is slice 6. Only the Character editor opts in; slice 7 adds others. ## 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 clean on touched files (one pre-existing warning in `HomeProfessorMariChat.tsx:385`, not from this change); Prettier and `localization:check` pass; client build passes. An Opus read-only review found 1 high (panel broke on switching to an uncached character), 3 medium (Esc on the page turned her into the modal window; narrow shell overflow; layout work on every resize) and 5 low issues; all fixed. Two more bugs found by the live run and fixed: the resize handle sat on the left edge, and the composer kept the previous character's context after a switch. Playwright on a throwaway instance (empty data, no model calls), 38/38 checks at 1440 / 1024 / 390 px: role and placement, header does not move, column right of the panel and on screen at max width, tabs visible at min width, typing in Description while she is open, editor click and page Esc do not close her, Esc in her panel does, toggle to window and back (survives reload), normal window with no editor, 390 px unchanged, switch to an uncached character, narrow shell falls back to the window, drag persists on release only, Cmd+J keeps the companion, intercepted send after a switch carries the new character and no old field. To verify manually: 1. Open a character at ≥ 1024 px and open Prof. Mari: she sits as a solid panel at the left below the editor header; the header does not move; the fields shift right only as needed. 2. Type in Description while she is open; click in the editor; press Esc outside her panel: she stays. Press Esc inside her panel: she closes. 3. Drag her right edge wider; the column narrows but stays on screen; reload: the width is kept. 4. Use the toggle in her header: she becomes the centered window; reload: the choice is kept. 5. Switch to another character while she is open: the context chip changes to the new character, no field chip of the old one. 6. Open the chat sidebar at 1024 px: she falls back to the window. 7. At 390 px nothing changes. ## 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/slice4/`); attach on request. They match the mockup the maintainer approved (`.tmp/mari-companion/mockup/shots/1440-companion.png`). --- <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:46 +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#8582
No description provided.