[PR #4546] [MERGED] feat(mari-chat): add message action buttons (delete, edit, regenerate, attachment removal) #6416

Closed
opened 2026-10-23 04:10:13 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4546
Author: @ylli-selmani
Created: 8/4/2026
Status: ✅ Merged
Merged: 8/4/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feat/mari-chat-message-actions


📝 Commits (9)

  • 68833d2 feat(mari-chat): add message action buttons (delete, edit, regenerate, attachment removal)
  • cfa230b feat(mari-chat): localize message action titles and confirmation dialogs
  • ab2ff09 Merge branch 'staging' of https://github.com/Pasta-Devs/Marinara-Engine into feat/mari-chat-message-actions
  • 23013c9 Merge branch 'staging' into feat/mari-chat-message-actions
  • 40a9f1d Merge branch 'staging' into feat/mari-chat-message-actions
  • 60488e3 fix(mari-chat): address message action review
  • 26af51b fix(mari-chat): tighten message action behavior
  • cec950e fix(mari-chat): make regeneration atomic
  • a0e537e fix(mari-chat): guard message mutations while busy

📊 Changes

4 files changed (+409 additions, -59 deletions)

View changed files

📝 packages/client/src/components/chat/HomeProfessorMariChat.tsx (+369 -48)
📝 packages/client/src/localization/locales/en.json (+11 -0)
📝 packages/server/src/routes/professor-mari-workspace.routes.ts (+2 -0)
📝 packages/server/src/services/professor-mari/workspace-agent.service.ts (+27 -11)

📄 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 #4556

Why this change

  • The Professor Mari home-screen chat surface was missing basic message management features (delete, edit, regenerate, attachment removal) that already exist in regular RP/Conversation chats, and pretty much all Chat Bots (e.g Gemini)
  • Users could 'brick' a chat for a model with no vision capabilities by attaching an image for a multimodal model, then switching back to a text-only connection with no way to remove the attachment

What changed

  • Added delete, edit, and regenerate action buttons (hover/focus-revealed on pointer devices and visible on touch) to both user and assistant messages in HomeProfessorMariChat.tsx
  • Added inline MacroTextarea editor for editing user messages (with expand-to-fullscreen button). Hooked into existing functionality, just hid the 'macro' and 'markdown' buttons.
  • Added attachment removal (✕ button) to ProfessorMariAttachedFiles for saved messages
  • All delete/regenerate/remove actions gate on showConfirmDialog
  • Action buttons now also appear on workspaceTrace assistant messages (previously unreachable due to early return)
  • Updated the new action icons to use the theme accent on hover and keyboard focus
  • Added localized action and failure-feedback keys to en.json
  • Applied CodeRabbit’s correctness and accessibility review findings

What should still be added

  • Keeping previous regenerated messages, akin to swipes in main chats, or regular chat bots. Currently, regenerating is destructive, which is why there's a confirmation prompt.
  • More localization

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

Tested pretty much entire behaviour of the PR multiple times, evidenced in attached mp4s and png.

  • Environment: Windows 11, launched via start.bat. Tested in Firefox on desktop and Samsung Browser on Samsung Galaxy (mobile viewport).
  • Hover-Revealed Buttons: Hovered over a user/assistant message → edit, delete and regenerate buttons appeared. Deleted a message → confirmation dialog appeared → message disappeared → confirmed gone from messages.json after reload.
  • Confirmation Prompts appeared on all destructive buttons -> Delete, and Regenerate.
  • Clicked edit → inline MacroTextarea appeared with Save/Cancel buttons and expand-to-fullscreen button in the corner. Saved an edit → message updated in chat and persisted after reload/recall.
  • Message Edits and Deletions affect DB and Context sent to LLM on following calls, NOT just Client-side UI
    • Regenerated Messages also affected by edits and deleted messages.
  • Removal of attached images, and tested with LLM with no Vision (Glm 5.2) -> would otherwise throw an immediate error.
  • Light + dark mode: Buttons visible and correctly styled in both themes.
  • Mobile viewport: Action buttons did not overflow or overlap on Samsung Browser.
  • Empty state: Attempting to delete the first and only message in a chat — no effect.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened
  • Version/release files updated (only if this PR includes a version bump)

UI evidence

https://github.com/user-attachments/assets/665e12e6-a1b3-43a4-9e95-452bf2839f28

https://github.com/user-attachments/assets/ccac1ffa-c322-4d1d-b125-2c396b385105

https://github.com/user-attachments/assets/93c35776-1f63-40e2-aa62-96785d7c6ffc

https://github.com/user-attachments/assets/c5a568c5-1c78-45cc-aa75-d4884d1b1e9d

https://github.com/user-attachments/assets/4b7e08cc-3131-40f7-8137-9aee2ee6ba01

https://github.com/user-attachments/assets/3feaf1e7-9b5b-46f9-ba2d-cc14dcd14957

https://github.com/user-attachments/assets/eb8317e3-7cfa-4349-9e7e-91f58bcc972e

mobile behaviour

Summary by CodeRabbit

  • New Features
    • Added controls to edit and delete user messages.
    • Added options to regenerate or delete assistant responses.
    • Added the ability to remove individual attachments.
    • Enabled inline editing across supported chat transcripts.
    • Added confirmation prompts for irreversible actions.
    • Regeneration can reuse the original user message and attachments.
  • Bug Fixes
    • Improved recovery after message changes, including automatic transcript reloads.
    • Prevented duplicate actions while attachment removal or regeneration is in progress.

🔄 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/4546 **Author:** [@ylli-selmani](https://github.com/ylli-selmani) **Created:** 8/4/2026 **Status:** ✅ Merged **Merged:** 8/4/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/mari-chat-message-actions` --- ### 📝 Commits (9) - [`68833d2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/68833d22d09379208c63bac1cad38baccfbac520) feat(mari-chat): add message action buttons (delete, edit, regenerate, attachment removal) - [`cfa230b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cfa230bb43ad68d5fa73b0d99f002f16cdc05064) feat(mari-chat): localize message action titles and confirmation dialogs - [`ab2ff09`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ab2ff0935d53fa4ff410233d76f7770271d0219d) Merge branch 'staging' of https://github.com/Pasta-Devs/Marinara-Engine into feat/mari-chat-message-actions - [`23013c9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/23013c9545e188efa7fd61ae9b3abee0f5a76efc) Merge branch 'staging' into feat/mari-chat-message-actions - [`40a9f1d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/40a9f1dbfa219585d1a45bb5a410a19a3eaa13b5) Merge branch 'staging' into feat/mari-chat-message-actions - [`60488e3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/60488e3f2259750e86df856b23bf040ef0cc4cbe) fix(mari-chat): address message action review - [`26af51b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/26af51b5dd7fff14890006e0d94bea09db0b5841) fix(mari-chat): tighten message action behavior - [`cec950e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cec950eb807d1283119abb5bd0b640e009000b82) fix(mari-chat): make regeneration atomic - [`a0e537e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a0e537ea24b169e969dc23e876431dfcb09b9621) fix(mari-chat): guard message mutations while busy ### 📊 Changes **4 files changed** (+409 additions, -59 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/HomeProfessorMariChat.tsx` (+369 -48) 📝 `packages/client/src/localization/locales/en.json` (+11 -0) 📝 `packages/server/src/routes/professor-mari-workspace.routes.ts` (+2 -0) 📝 `packages/server/src/services/professor-mari/workspace-agent.service.ts` (+27 -11) </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 #4556 ## Why this change - The Professor Mari home-screen chat surface was missing basic message management features (delete, edit, regenerate, attachment removal) that already exist in regular RP/Conversation chats, and pretty much all Chat Bots (e.g Gemini) - Users could 'brick' a chat for a model with no vision capabilities by attaching an image for a multimodal model, then switching back to a text-only connection with no way to remove the attachment ## What changed - Added delete, edit, and regenerate action buttons (hover/focus-revealed on pointer devices and visible on touch) to both user and assistant messages in `HomeProfessorMariChat.tsx` - Added inline `MacroTextarea` editor for editing user messages (with expand-to-fullscreen button). Hooked into existing functionality, just hid the 'macro' and 'markdown' buttons. - Added attachment removal (✕ button) to `ProfessorMariAttachedFiles` for saved messages - All delete/regenerate/remove actions gate on `showConfirmDialog` - Action buttons now also appear on `workspaceTrace` assistant messages (previously unreachable due to early return) - Updated the new action icons to use the theme accent on hover and keyboard focus - Added localized action and failure-feedback keys to `en.json` - Applied CodeRabbit’s correctness and accessibility review findings ### What should still be added - Keeping previous regenerated messages, akin to swipes in main chats, or regular chat bots. Currently, regenerating is destructive, which is why there's a confirmation prompt. - More localization ## Validation - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes Tested pretty much entire behaviour of the PR multiple times, evidenced in attached mp4s and png. * **Environment:** Windows 11, launched via `start.bat`. Tested in Firefox on desktop and Samsung Browser on Samsung Galaxy (mobile viewport). * **Hover-Revealed Buttons:** Hovered over a user/assistant message → edit, delete and regenerate buttons appeared. Deleted a message → confirmation dialog appeared → message disappeared → confirmed gone from `messages.json` after reload. * Confirmation Prompts appeared on all destructive buttons -> Delete, and Regenerate. * Clicked edit → inline `MacroTextarea` appeared with Save/Cancel buttons and expand-to-fullscreen button in the corner. Saved an edit → message updated in chat and persisted after reload/recall. * Message Edits and Deletions affect DB and Context sent to LLM on following calls, NOT just Client-side UI * Regenerated Messages also affected by edits and deleted messages. * Removal of attached images, and tested with LLM with no Vision (Glm 5.2) -> would otherwise throw an immediate error. * **Light + dark mode:** Buttons visible and correctly styled in both themes. * **Mobile viewport:** Action buttons did not overflow or overlap on Samsung Browser. * **Empty state:** Attempting to delete the first and only message in a chat — no effect. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence https://github.com/user-attachments/assets/665e12e6-a1b3-43a4-9e95-452bf2839f28 https://github.com/user-attachments/assets/ccac1ffa-c322-4d1d-b125-2c396b385105 https://github.com/user-attachments/assets/93c35776-1f63-40e2-aa62-96785d7c6ffc https://github.com/user-attachments/assets/c5a568c5-1c78-45cc-aa75-d4884d1b1e9d https://github.com/user-attachments/assets/4b7e08cc-3131-40f7-8137-9aee2ee6ba01 https://github.com/user-attachments/assets/3feaf1e7-9b5b-46f9-ba2d-cc14dcd14957 https://github.com/user-attachments/assets/eb8317e3-7cfa-4349-9e7e-91f58bcc972e <img width="1659" height="1638" alt="mobile behaviour" src="https://github.com/user-attachments/assets/97f6e12d-39d6-4925-82ac-dfba4f9074c5" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added controls to edit and delete user messages. * Added options to regenerate or delete assistant responses. * Added the ability to remove individual attachments. * Enabled inline editing across supported chat transcripts. * Added confirmation prompts for irreversible actions. * Regeneration can reuse the original user message and attachments. * **Bug Fixes** * Improved recovery after message changes, including automatic transcript reloads. * Prevented duplicate actions while attachment removal or regeneration is in progress. <!-- 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-23 04:10:13 +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#6416
No description provided.