[PR #8672] [MERGED] fix(mari): quick replies that name a chat she can't open no longer close her window #8738

Closed
opened 2026-11-07 17:39:21 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: staging ← Head: fix/mari-quick-reply-8651


📝 Commits (6)

  • 131b708 fix(mari): a quick reply that names a chat the app can't open asks her instead (#8651)
  • fbdf930 fix(mari): a chip opens a chat only once the chat list confirms it
  • 7b8b038 Merge branch 'staging' into fix/mari-quick-reply-8651
  • 7bc41eb test(mari): the quick-reply e2e deletes only the threads it created
  • 758ce03 Merge remote-tracking branch 'origin/fix/mari-quick-reply-8651' into fix/mari-quick-reply-8651
  • 5d562d5 refactor(mari): name the quick-reply chat check withOpenableChatAction

📊 Changes

2 files changed (+218 additions, -1 deletions)

View changed files

➕ e2e/mari-quick-reply.e2e.ts (+204 -0)
📝 packages/client/src/components/chat/HomeProfessorMariChat.tsx (+14 -1)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #8651

Why this change

  • In #8651, clicking one of Prof. Mari's quick reply cards closed her window and dropped the user on Home, with nothing sent. After reopening her, the cards didn't work at all.
  • Cause: a card runs its action when it has one, and executeStateNavigation closes her window and opens the named chat. The model can attach {kind: "chat" | "peek-prompt", chatId} to an ordinary reply card and name a chat the app doesn't list: her own hidden thread, or an id she made up. The chat view can't open it, resets the active chat and shows Home. The cards are saved on her answer (extra.mariSuggestions), so after reopening the same cards closed the window again.
  • /api/chats hides exactly the chats that GET /chats/:id refuses (shouldHideProfessorMariChat), so "not in the chat list" means "can't be opened".

What changed

  • HomeProfessorMariChat.tsx, where every visible card set is built (storeChipsForChat, live and saved cards): once the chat list has loaded, a chat or peek-prompt action whose chat isn't in it is dropped from the card. The card then works like a normal reply: it sends its prompt, her window stays open, and its icon and tooltip say it asks Mari instead of "Opens now".
  • Cards that point at real chats still open them. Until the chat list confirms the chat (still loading, or failed to load), the card asks Mari too, so the old path can never run. Local CodeRabbit asked for this; it first kept actions while the list was loading.
  • New e2e e2e/mari-quick-reply.e2e.ts:
    • Test 1 opens Mari from Home's "Ask Professor Mari" with a scripted model whose cards name her own thread and a made-up chat id. Clicking one keeps the window open, sends the prompt and shows her reply. It then closes her window, reloads the page, reopens her from Home's Professor tab and checks that a saved card still sends.
    • Test 2 checks that a card pointing at a real chat still opens it.
  • On the old code, test 1 fails on desktop-chromium, mobile-chromium and mobile-webkit: the window closes (omnibar count 0 instead of 1).

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

What the agent ran locally:

  • After rebasing on staging, node ./scripts/pnpm-runner.mjs check passes.
  • e2e/mari-quick-reply.e2e.ts passes 6/6 on desktop-chromium, mobile-chromium and mobile-webkit. With the client change reverse-applied, the cannot-open test fails on all three.
  • Local CodeRabbit raised two issues, both fixed. (1) Before the chat list loaded, a saved card kept its action; it now asks Mari until the list confirms the chat. (2) The e2e cleanup deleted every Professor Mari thread on the test server; it now snapshots her threads first and removes only the ones the test created. The third pass reported 0 findings.
  • An independent review agent made the reopen step reload the page, so the test really uses the saved cards. It isolated the saved-card path with a seeded answer (fails before, passes after). It also checked that Enter, Space, a touch tap, Escape, the Close button and a backdrop click behave as before.
  • Neighbour Mari specs (mari-composer-stack, mari-arrival-append) show the same failures with and without this change when run together locally. "A change card ends above the composer" passes when run alone, so they depend on test order and aren't caused by this PR.

For a human to verify:

  • Manually verify in a desktop browser that when Prof. Mari answers with quick reply cards, clicking one keeps her window open, sends the option as your message, and she answers.
  • Manually verify that after closing her window and reopening it from Home's Professor tab, the saved quick replies under her last answer still send.
  • Manually verify that a card that really opens something (an existing chat, a character editor, a panel) still opens it and closes her window.
  • Manually verify the same flow at phone width (full-screen Mari) and at tablet width.
  • If possible, confirm with the reporter that the broken cards' saved extra.mariSuggestions carry a chat or peek-prompt action. Their data wasn't seen; this is the only path found that produces every reported symptom. Resource or start-chat actions with made-up ids aren't covered: they open an empty editor or the start-chat dialog, not Home.

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)

No docs change: no setting or string changed.

🤖 Generated with Claude Code


🔄 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/8672 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/mari-quick-reply-8651` --- ### 📝 Commits (6) - [`131b708`](https://github.com/Pasta-Devs/Marinara-Engine/commit/131b708839910e8520fabd0d59470c560dcac3bd) fix(mari): a quick reply that names a chat the app can't open asks her instead (#8651) - [`fbdf930`](https://github.com/Pasta-Devs/Marinara-Engine/commit/fbdf93006688edf8b36164abd7601d1dc18c6382) fix(mari): a chip opens a chat only once the chat list confirms it - [`7b8b038`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7b8b038a08172925bbb9c2ed0268866f8191c050) Merge branch 'staging' into fix/mari-quick-reply-8651 - [`7bc41eb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7bc41ebf7f92f054ecd4509d1696bc6172f16dde) test(mari): the quick-reply e2e deletes only the threads it created - [`758ce03`](https://github.com/Pasta-Devs/Marinara-Engine/commit/758ce03590b5a995cf785ea7e82c2bec559134d2) Merge remote-tracking branch 'origin/fix/mari-quick-reply-8651' into fix/mari-quick-reply-8651 - [`5d562d5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5d562d5f40957a0b63da3e4e6c1fff098924aa50) refactor(mari): name the quick-reply chat check withOpenableChatAction ### 📊 Changes **2 files changed** (+218 additions, -1 deletions) <details> <summary>View changed files</summary> ➕ `e2e/mari-quick-reply.e2e.ts` (+204 -0) 📝 `packages/client/src/components/chat/HomeProfessorMariChat.tsx` (+14 -1) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #8651 ## Why this change - In #8651, clicking one of Prof. Mari's quick reply cards closed her window and dropped the user on Home, with nothing sent. After reopening her, the cards didn't work at all. - Cause: a card runs its `action` when it has one, and `executeStateNavigation` closes her window and opens the named chat. The model can attach `{kind: "chat" | "peek-prompt", chatId}` to an ordinary reply card and name a chat the app doesn't list: her own hidden thread, or an id she made up. The chat view can't open it, resets the active chat and shows Home. The cards are saved on her answer (`extra.mariSuggestions`), so after reopening the same cards closed the window again. - `/api/chats` hides exactly the chats that `GET /chats/:id` refuses (`shouldHideProfessorMariChat`), so "not in the chat list" means "can't be opened". ## What changed - `HomeProfessorMariChat.tsx`, where every visible card set is built (`storeChipsForChat`, live and saved cards): once the chat list has loaded, a `chat` or `peek-prompt` action whose chat isn't in it is dropped from the card. The card then works like a normal reply: it sends its prompt, her window stays open, and its icon and tooltip say it asks Mari instead of "Opens now". - Cards that point at real chats still open them. Until the chat list confirms the chat (still loading, or failed to load), the card asks Mari too, so the old path can never run. Local CodeRabbit asked for this; it first kept actions while the list was loading. - New e2e `e2e/mari-quick-reply.e2e.ts`: - Test 1 opens Mari from Home's "Ask Professor Mari" with a scripted model whose cards name her own thread and a made-up chat id. Clicking one keeps the window open, sends the prompt and shows her reply. It then closes her window, reloads the page, reopens her from Home's Professor tab and checks that a saved card still sends. - Test 2 checks that a card pointing at a real chat still opens it. - On the old code, test 1 fails on desktop-chromium, mobile-chromium and mobile-webkit: the window closes (omnibar count 0 instead of 1). ## 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 What the agent ran locally: - After rebasing on staging, `node ./scripts/pnpm-runner.mjs check` passes. - `e2e/mari-quick-reply.e2e.ts` passes 6/6 on desktop-chromium, mobile-chromium and mobile-webkit. With the client change reverse-applied, the cannot-open test fails on all three. - Local CodeRabbit raised two issues, both fixed. (1) Before the chat list loaded, a saved card kept its action; it now asks Mari until the list confirms the chat. (2) The e2e cleanup deleted every Professor Mari thread on the test server; it now snapshots her threads first and removes only the ones the test created. The third pass reported 0 findings. - An independent review agent made the reopen step reload the page, so the test really uses the saved cards. It isolated the saved-card path with a seeded answer (fails before, passes after). It also checked that Enter, Space, a touch tap, Escape, the Close button and a backdrop click behave as before. - Neighbour Mari specs (mari-composer-stack, mari-arrival-append) show the same failures with and without this change when run together locally. "A change card ends above the composer" passes when run alone, so they depend on test order and aren't caused by this PR. For a human to verify: - Manually verify in a desktop browser that when Prof. Mari answers with quick reply cards, clicking one keeps her window open, sends the option as your message, and she answers. - Manually verify that after closing her window and reopening it from Home's Professor tab, the saved quick replies under her last answer still send. - Manually verify that a card that really opens something (an existing chat, a character editor, a panel) still opens it and closes her window. - Manually verify the same flow at phone width (full-screen Mari) and at tablet width. - If possible, confirm with the reporter that the broken cards' saved `extra.mariSuggestions` carry a `chat` or `peek-prompt` action. Their data wasn't seen; this is the only path found that produces every reported symptom. Resource or start-chat actions with made-up ids aren't covered: they open an empty editor or the start-chat dialog, not Home. ## 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) No docs change: no setting or string changed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 17:39:21 +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#8738
No description provided.