[PR #3161] [MERGED] [codex] Fix Professor Mari floating dismiss lifecycle #5825

Closed
opened 2026-10-22 04:19:52 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3161
Author: @SpicyMarinara
Created: 7/2/2026
Status: ✅ Merged
Merged: 7/3/2026
Merged by: @SpicyMarinara

Base: staging ← Head: codex/fix-professor-mari-floating-dismiss


📝 Commits (1)

  • bacf46a Fix Professor Mari floating dismiss lifecycle

📊 Changes

3 files changed (+90 additions, -34 deletions)

View changed files

📝 packages/client/src/components/chat/ChatArea.tsx (+3 -1)
📝 packages/client/src/components/chat/ProfessorMariFloatingAssistantHost.tsx (+26 -5)
📝 packages/server/src/services/professor-mari/workspace-agent.service.ts (+61 -28)

📄 Description

Linked issue

Closes #3159

Why this change

  • Dismissing the floating Professor Mari window could leave the Home surface in a stale active-chat layout state, hiding the normal Home content after navigation.
  • The floating assistant could also unmount while a workspace response was still streaming, risking a dropped SSE consumer and missing assistant history.
  • The workspace service only persisted assistant messages on the full success path, so aborted or disconnected runs could lose partial visible text and trace state.

What changed

  • Clear homeProfessorChatActive whenever a real chat becomes active, so returning Home cannot render a blank Professor Mari layout shell.
  • Keep the floating Professor Mari assistant mounted but hidden while any generation controller is active, then allow it to unmount once idle.
  • Reuse the Professor Mari workspace assistant-message persistence path on abort, including streamed say text, thinking text, workspace timeline, continuity, and usage metadata when available.

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

Automated validation performed by Codex:

  • pnpm --filter @marinara-engine/client lint
  • pnpm --filter @marinara-engine/server lint
  • pnpm --filter @marinara-engine/client build
  • pnpm --filter @marinara-engine/server build
  • pnpm check
  • git diff --check

Manual browser reproduction of the floating-window dismiss flow was not performed in this environment.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

No docs or release metadata changes are expected for this bug fix.

UI evidence (if applicable)

No screenshots attached; this is a lifecycle/persistence fix without visual redesign.

Summary by CodeRabbit

  • Bug Fixes
    • Improved chat state handling so opening a different chat now reliably clears previous Professor Mari chat activity.
    • Made the floating assistant smoother to dismiss and reopen, with less abrupt disappearing during transitions.
    • Improved assistant response saving so partial or canceled replies are more consistently preserved and shown to users.

🔄 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/3161 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/2/2026 **Status:** ✅ Merged **Merged:** 7/3/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/fix-professor-mari-floating-dismiss` --- ### 📝 Commits (1) - [`bacf46a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bacf46acb104abb8b337f48bceb1cd831c13006d) Fix Professor Mari floating dismiss lifecycle ### 📊 Changes **3 files changed** (+90 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/ChatArea.tsx` (+3 -1) 📝 `packages/client/src/components/chat/ProfessorMariFloatingAssistantHost.tsx` (+26 -5) 📝 `packages/server/src/services/professor-mari/workspace-agent.service.ts` (+61 -28) </details> ### 📄 Description ## Linked issue Closes #3159 ## Why this change - Dismissing the floating Professor Mari window could leave the Home surface in a stale active-chat layout state, hiding the normal Home content after navigation. - The floating assistant could also unmount while a workspace response was still streaming, risking a dropped SSE consumer and missing assistant history. - The workspace service only persisted assistant messages on the full success path, so aborted or disconnected runs could lose partial visible text and trace state. ## What changed - Clear `homeProfessorChatActive` whenever a real chat becomes active, so returning Home cannot render a blank Professor Mari layout shell. - Keep the floating Professor Mari assistant mounted but hidden while any generation controller is active, then allow it to unmount once idle. - Reuse the Professor Mari workspace assistant-message persistence path on abort, including streamed `say` text, thinking text, workspace timeline, continuity, and usage metadata when available. ## 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 Automated validation performed by Codex: - `pnpm --filter @marinara-engine/client lint` - `pnpm --filter @marinara-engine/server lint` - `pnpm --filter @marinara-engine/client build` - `pnpm --filter @marinara-engine/server build` - `pnpm check` - `git diff --check` Manual browser reproduction of the floating-window dismiss flow was not performed in this environment. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) No docs or release metadata changes are expected for this bug fix. ## UI evidence (if applicable) No screenshots attached; this is a lifecycle/persistence fix without visual redesign. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved chat state handling so opening a different chat now reliably clears previous Professor Mari chat activity. * Made the floating assistant smoother to dismiss and reopen, with less abrupt disappearing during transitions. * Improved assistant response saving so partial or canceled replies are more consistently preserved and shown to users. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:19:53 +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#5825
No description provided.