[PR #932] [MERGED] Add: Selectable chat summary ranges and editable prompt templates (Issue #931) #4844

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/932
Author: @Promansis
Created: 5/17/2026
Status: ✅ Merged
Merged: 5/17/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feat/chat-summary-source-range


📝 Commits (7)

  • bc9f5ad feat/chat-summary-source-range
  • 30ae778 Add: settings button and summary source persists
  • 840f196 Add: collapse hidden message function
  • 067ebab Wired in: hide summary, collapse hidden messages and icon change.
  • d46e656 Fix: Messages don't have to be loaded to be summarised. Hidden messages no longer summarised.
  • 85c634c Add: Summary prompts and UI fixes
  • d135579 Merge branch 'staging' into feat/chat-summary-source-range

📊 Changes

11 files changed (+1314 additions, -117 deletions)

View changed files

📝 packages/client/src/components/chat/ChatArea.tsx (+1 -7)
📝 packages/client/src/components/chat/ChatConversationSurface.tsx (+3 -0)
📝 packages/client/src/components/chat/ChatMessage.tsx (+112 -23)
📝 packages/client/src/components/chat/ChatRoleplaySurface.tsx (+34 -8)
📝 packages/client/src/components/chat/ConversationMessage.tsx (+87 -3)
📝 packages/client/src/components/chat/ConversationView.tsx (+10 -0)
📝 packages/client/src/components/chat/SummaryPopover.tsx (+852 -62)
📝 packages/client/src/hooks/use-chats.ts (+73 -2)
📝 packages/client/src/stores/ui.store.ts (+51 -1)
📝 packages/server/src/routes/chats.routes.ts (+78 -11)
📝 packages/shared/src/types/chat.ts (+13 -0)

📄 Description

Pull Request Body

Linked issue

Closes #931

Why this change

  • Gives users more control over what content is included in manual chat summaries.
  • Supports chat-specific summary styles through saved prompt templates.
  • Helps keep long chats cleaner by allowing summarized messages to be hidden or collapsed.
  • Prevents hidden-from-AI messages from being included in generated summaries.

What changed

  • Added summary source controls for either the last N messages or an inclusive message index range.
  • Added chat-scoped summary prompt templates with create, duplicate, edit, select, and delete flows.
  • Persisted summary popover source/display settings in the UI store.
  • Updated manual summary generation to accept range anchors and prompt template IDs.
  • Updated the server summary route to validate selected ranges, cap ranges at 200 messages, exclude hidden-from-AI messages, and return summarized message IDs.
  • Added bulk hidden-from-AI mutation support so summarized messages can be hidden after generation.
  • Added collapse-hidden-message behavior across chat surfaces.
  • Improved summary popover readability for sectioned and bulleted summaries.

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

  • Generated a summary using the default “last messages” source and confirm the summary appends/updates.
  • Changed the “last messages” count, close/reopen the popover, and confirm the setting persists.
  • Switched to range mode, choose a valid message range, generate a summary, and confirm only that range is summarized.
  • Try a range larger than 200 messages and confirm generation is blocked with clear UI feedback.
  • Hide one or more messages from AI, generate a summary over a range containing them, and confirm hidden messages are not included.
  • Enable “Hide summarised messages”, generate a summary, and confirm the summarized messages become hidden from AI.
  • Enable “Collapse hidden messages” and confirm hidden messages collapse in conversation/roleplay/game chat surfaces.
  • Create a custom summary prompt template, select it, generate a summary, and confirm the output follows the custom style.
  • Duplicate, edit, and delete a summary prompt template, confirming the selected template state remains sensible.
  • Edit the generated summary manually, save it, close/reopen the popover, and confirm the saved text persists.
  • Verify the summary popover layout in light mode, dark mode, and a narrow/mobile viewport.
  • Run pnpm check locally and confirm it passes before marking the checkbox.

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)

UI evidence (if applicable)


🔄 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/932 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 5/17/2026 **Status:** ✅ Merged **Merged:** 5/17/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/chat-summary-source-range` --- ### 📝 Commits (7) - [`bc9f5ad`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bc9f5ad6c82ec0bc3e56bc2e6afbd6c0468405f4) feat/chat-summary-source-range - [`30ae778`](https://github.com/Pasta-Devs/Marinara-Engine/commit/30ae778da28d861062216b279ba478b8a4273739) Add: settings button and summary source persists - [`840f196`](https://github.com/Pasta-Devs/Marinara-Engine/commit/840f196d5170ed8307efc6db23457b2281d89f85) Add: collapse hidden message function - [`067ebab`](https://github.com/Pasta-Devs/Marinara-Engine/commit/067ebabfeb1b5d2d4bb91d3e24f31750e4a8e39e) Wired in: hide summary, collapse hidden messages and icon change. - [`d46e656`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d46e6560afa16b6f641efba95043ee84881a5c64) Fix: Messages don't have to be loaded to be summarised. Hidden messages no longer summarised. - [`85c634c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/85c634cc25ad9f224aa474aa41580aeefeda855f) Add: Summary prompts and UI fixes - [`d135579`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d13557955c51749b9f9475140c0439511406d526) Merge branch 'staging' into feat/chat-summary-source-range ### 📊 Changes **11 files changed** (+1314 additions, -117 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/ChatArea.tsx` (+1 -7) 📝 `packages/client/src/components/chat/ChatConversationSurface.tsx` (+3 -0) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+112 -23) 📝 `packages/client/src/components/chat/ChatRoleplaySurface.tsx` (+34 -8) 📝 `packages/client/src/components/chat/ConversationMessage.tsx` (+87 -3) 📝 `packages/client/src/components/chat/ConversationView.tsx` (+10 -0) 📝 `packages/client/src/components/chat/SummaryPopover.tsx` (+852 -62) 📝 `packages/client/src/hooks/use-chats.ts` (+73 -2) 📝 `packages/client/src/stores/ui.store.ts` (+51 -1) 📝 `packages/server/src/routes/chats.routes.ts` (+78 -11) 📝 `packages/shared/src/types/chat.ts` (+13 -0) </details> ### 📄 Description Pull Request Body <!-- Target branch: `staging`. The default base in this UI is `main` (release branch). --> <!-- Change the base to `staging` before submitting unless this is a maintainer-approved mainline change. --> <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #931 ## Why this change - Gives users more control over what content is included in manual chat summaries. - Supports chat-specific summary styles through saved prompt templates. - Helps keep long chats cleaner by allowing summarized messages to be hidden or collapsed. - Prevents hidden-from-AI messages from being included in generated summaries. ## What changed - Added summary source controls for either the last N messages or an inclusive message index range. - Added chat-scoped summary prompt templates with create, duplicate, edit, select, and delete flows. - Persisted summary popover source/display settings in the UI store. - Updated manual summary generation to accept range anchors and prompt template IDs. - Updated the server summary route to validate selected ranges, cap ranges at 200 messages, exclude hidden-from-AI messages, and return summarized message IDs. - Added bulk hidden-from-AI mutation support so summarized messages can be hidden after generation. - Added collapse-hidden-message behavior across chat surfaces. - Improved summary popover readability for sectioned and bulleted summaries. ## Validation <!-- Required: include commands run and/or manual checks performed --> - [x] `pnpm check` passes locally - [x] 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 <!-- Describe exactly what you tested in a real browser/app, step by step. --> <!-- ⚠️ If an AI agent filled out or ticked these boxes for you, treat them --> <!-- as a TO-DO LIST, not as proof the work is done. Verify each item yourself --> <!-- before submitting. If you haven't verified it, untick the box. --> - Generated a summary using the default “last messages” source and confirm the summary appends/updates. - Changed the “last messages” count, close/reopen the popover, and confirm the setting persists. - Switched to range mode, choose a valid message range, generate a summary, and confirm only that range is summarized. - Try a range larger than 200 messages and confirm generation is blocked with clear UI feedback. - Hide one or more messages from AI, generate a summary over a range containing them, and confirm hidden messages are not included. - Enable “Hide summarised messages”, generate a summary, and confirm the summarized messages become hidden from AI. - Enable “Collapse hidden messages” and confirm hidden messages collapse in conversation/roleplay/game chat surfaces. - Create a custom summary prompt template, select it, generate a summary, and confirm the output follows the custom style. - Duplicate, edit, and delete a summary prompt template, confirming the selected template state remains sensible. - Edit the generated summary manually, save it, close/reopen the popover, and confirm the saved text persists. - Verify the summary popover layout in light mode, dark mode, and a narrow/mobile viewport. - Run `pnpm check` locally and confirm it passes before marking the checkbox. ## 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) ## UI evidence (if applicable) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:11:07 +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#4844
No description provided.