mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8406] [MERGED] feat(mari): send the focused field's unsaved text and selection to Prof. Mari #8581
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#8581
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8406
Author: @Gunterlie
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/28/2026
Merged by: @Gunterlie
Base:
feat/mari-companion← Head:feat/mari-field-draft📝 Commits (1)
5aa25d8feat(mari): send the focused field's unsaved text and selection to Prof. Mari📊 Changes
12 files changed (+88 additions, -3 deletions)
View changed files
📝
packages/client/src/components/layout/GlobalOmnibar.tsx(+5 -0)📝
packages/client/src/components/layout/GlobalOmnibarHost.tsx(+17 -0)📝
packages/client/src/lib/mari-editor-fields.ts(+18 -0)📝
packages/client/src/lib/professor-mari-command-center-context.ts(+9 -0)📝
packages/client/src/lib/professor-mari-presentation.ts(+1 -0)📝
packages/client/src/stores/ui.store.ts(+6 -1)📝
packages/server/src/routes/professor-mari-workspace.routes.ts(+1 -0)📝
packages/server/src/services/professor-mari/workspace-agent.service.ts(+3 -2)📝
packages/shared/src/types/professor-mari-workspace.ts(+2 -0)📝
scripts/regressions/command-center.regression.ts(+2 -0)📝
scripts/regressions/mari-editor-fields.regression.ts(+8 -0)📝
scripts/regressions/professor-mari/documentation.regression.ts(+16 -0)📄 Description
Linked issue
No issue: planned work, slice 3 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(slice 1: #8401, slice 2: #8403, fixes: #8405).Why this change
Prof. Mari only saw the saved character. If the user had unsaved text in a field, or selected a sentence and pressed Cmd+J ("Ask Prof. Mari about this"), she worked on stale text, so "make this warmer" could rewrite the old version. The companion and in-field review (slices 4–5) need her to work on what the user actually sees.
What changed
ProfessorMariAskContext.fieldDraft?: { value; selection? }.GlobalOmnibarHost.tsx): when Cmd+K opens the omnibar or Cmd+J opens Mari while focus is in a text input/textarea inside[data-mari-field], the field's current text and selection go into a transientui.storevaluemariFieldDraft(cleared when the omnibar closes). Pure helpermariFieldDraft()inlib/mari-editor-fields.ts; list fields (tags,alternate_greetings) are skipped because the focused input is one tag or greeting, not the field.GlobalOmnibar.tsx,professor-mari-command-center-context.ts): the handoff carriesfieldDraftonly when its field id matches the focused field; capped at 20 000 / 4 000 chars. Sent once per capture (cleared when Mari's pane takes it). Removing the field chip in Mari's composer also removesfieldDraft(professor-mari-presentation.ts).fieldDraft(same caps).buildHandoffContextPromptputs it in<ask_mari_context>and tells the model it is the user's current, possibly unsaved text, to treat as untrusted user text.Decisions to confirm in review:
fieldDraftis stored with the user message in Mari's chat history (up to 20 000 chars). No chip shows it beyond the field chip.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Agent-run (not manual): client
tsc -band servertsc --noEmitexit 0; ESLint and Prettier clean on touched client files; regressionsmari-editor-fields,command-centerandprofessor-mari/documentationpass. An Opus read-only review found 1 high (chip removal kept the text) and 3 medium issues (list fields, resend in one session, aside escalation); the first three are fixed, the fourth is the decision above.Live run on a throwaway instance (copied data, MiniMax M3 via Bifrost), request bodies intercepted:
fieldDraft.valuewith the unsaved marker andselection; Mari quoted it back (she quoted the whole field, not only the selection).fieldDraft.fieldDraft./api/professor-mari/quick/prompt): no field text.fieldDraft; the Description control still does (requests aborted before the model).To verify manually:
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)UI evidence (if applicable)
No new UI. Screenshots of the live run are local (
.tmp/mari-companion/live3/); attach on request.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.