[PR #6775] [MERGED] feat: add chat search, story exports and activity insights #7324

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6775
Author: @SirAdoni
Created: 9/27/2026
Status: ✅ Merged
Merged: 9/28/2026
Merged by: @SpicyMarinara

Base: staging ← Head: contrib/6698-chat-tools


📝 Commits (10+)

  • a2807e4 feat: add chat search exports and activity insights
  • 31a884a fix: verify chat tools navigation and search shortcut
  • 7b5d1c7 Merge staging and verify chat tools integration
  • a9b41b2 Merge staging inventory update into chat tools
  • e6d764b Merge commit '3355c32277' into contrib/6698-chat-tools
  • 274bcd5 fix: refresh chat insights reliably after edits and cleared searches
  • ea62c74 fix: preserve narrator identity in game story exports
  • 9aa2719 fix: keep story avatars compact and reject repeated timezone values
  • 98206c8 Merge latest staging into reviewed chat insights
  • ae09851 test: allow slower native server restarts

📊 Changes

30 files changed (+3974 additions, -28 deletions)

View changed files

📝 CHANGELOG.md (+6 -0)
➕ e2e/chat-insights.e2e.ts (+234 -0)
📝 packages/client/src/components/chat/ChatArea.tsx (+14 -0)
📝 packages/client/src/components/chat/ChatBranchSelector.tsx (+48 -1)
📝 packages/client/src/components/layout/AppShell.tsx (+35 -0)
📝 packages/client/src/components/layout/ChatSidebar.tsx (+21 -0)
📝 packages/client/src/components/layout/ModalRenderer.tsx (+20 -0)
➕ packages/client/src/components/modals/ActivityOverviewModal.tsx (+252 -0)
➕ packages/client/src/components/modals/ChatStatsModal.tsx (+244 -0)
➕ packages/client/src/components/modals/GlobalSearchModal.tsx (+321 -0)
➕ packages/client/src/hooks/use-chat-insights.ts (+79 -0)
📝 packages/client/src/hooks/use-chats.ts (+12 -3)
➕ packages/client/src/lib/chat-insights-display.ts (+153 -0)
➕ packages/client/src/lib/chat-insights.ts (+34 -0)
📝 packages/client/src/localization/locales/en.json (+102 -0)
➕ packages/server/src/routes/chat-insights.routes.ts (+73 -0)
📝 packages/server/src/routes/chats.routes.ts (+90 -22)
📝 packages/server/src/routes/index.ts (+2 -0)
➕ packages/server/src/services/chat-insights/chat-insights.service.ts (+508 -0)
➕ packages/server/src/services/chat-insights/transcript-avatars.ts (+38 -0)

...and 10 more files

📄 Description

Linked issue

Closes #6802. Partial implementation of #6698; the umbrella issue remains open.

Why this change

Chats need searchable history, readable story exports and useful activity summaries without exposing hidden messages or private notes.

What changed

  • Add chat search, Markdown/HTML story exports and activity statistics using the existing chat storage and panels.
  • Repair stale activity/search results, narrator attribution and repeated timezone query validation. Embed each safe raster avatar once per HTML export.

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

pnpm check; 23 focused chat regressions; six desktop/mobile Chromium/WebKit browser cases; seven shell smoke cases passed.

Local CodeRabbit completed; valid findings were fixed and documented. The latest hosted findings were fixed in 9aa27191b. Follow-up review and current-head GitHub checks remain merge gates.

Manual verification

Manually verify search, activity timezone changes, and downloaded story exports with a representative long chat.

Automated browser evidence does not claim physical-device or manual container verification. Human checklist states are preserved.

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)

Added an Unreleased changelog entry. No release metadata or user-facing docs changed.

UI evidence

Browser evidence (download the HTML to view the embedded screenshots). Captions distinguish before/after captures from current feature screenshots.

Summary by CodeRabbit

  • New Features
    • Search across chats by phrase, with filters for mode, role, character, and date. Jump to matching messages where supported.
    • View chat statistics and an activity overview with message, play-time, streak, and activity details.
    • Export chats as Markdown or standalone HTML, alongside existing formats. HTML stories can include embedded avatars.
    • Open global search with Ctrl+Shift+F or Cmd+Shift+F, or from the chat list.
  • Bug Fixes
    • Transcript exports and search results omit private or internal content; HTML-like transcript text is safely escaped.
    • Printed transcripts include reasoning once even when the Thinking section is collapsed.
    • Game-mode message jumps display a notice directing you to the game log.
    • Chat insights requests reject ambiguous timezone parameters.

Maintainer verification

Published f4255e335 completes the print review follow-up. Included reasoning is rendered once, reused in a screen disclosure and a print-only block, and shown exactly once per medium using ordinary display rules. This avoids depending on the newer details-content pseudo-element while retaining offline, script-free exports. The small HTML duplication and removal condition are documented in the code. Screen captures are unchanged; the evidence gist includes print before/after images.

The original print defect failed on desktop Chromium, mobile Chromium and mobile WebKit. The final behavioral proof passes all three projects, including collapsed/expanded screen behavior, one visible reasoning copy in print, return to screen, offline avatars and no scripts. Exact branch validation passed pnpm check, the chat-story-export regression and smoke7/7. The final local CodeRabbit review of this compatibility follow-up completed with zero findings; prior valid findings were fixed and review decisions remain recorded.

The branch also retains reviewed search/activity/export fixes, compact embedded avatars and the native restart fixture correction. The slow replacement-startup failure has an injected-delay red/green proof; process ownership, old-process exit and lease assertions remain intact. The combined integration build passed before the final print-only compatibility delta, whose identical renderer is validated on this branch. Current-head hosted CodeRabbit and CI remain merge gates. Human validation checkboxes are unchanged.

Local build and container verification

Tested commit: f4255e3351. Full local pnpm check passed. The full Docker image built successfully and ran with synthetic data; HTTP readiness and embedded build commit were verified. These results do not claim completion of the remaining manual and UI edge-case checklist.

Interactive browser walkthroughs of the feature were completed against the running production container using synthetic fixtures, supported by focused automated browser checks. This was agent-operated browser interaction, not physical-device testing. The broader theme, empty-state and error-path checklist remains separate.

Remaining interactive verification

Native Windows save-picker behavior and interactive activity-timezone changes remain unverified. The automated download-fallback export test does not verify the native save dialog. Overall manual verification remains unchecked.


🔄 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/6775 **Author:** [@SirAdoni](https://github.com/SirAdoni) **Created:** 9/27/2026 **Status:** ✅ Merged **Merged:** 9/28/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `contrib/6698-chat-tools` --- ### 📝 Commits (10+) - [`a2807e4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a2807e49e3b7589bd69dce6384e7de7533b83b1d) feat: add chat search exports and activity insights - [`31a884a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/31a884a45bb2207a9587c4d98d3832d000c9ab39) fix: verify chat tools navigation and search shortcut - [`7b5d1c7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7b5d1c7df2e644a5ff1ef732e08c67e01273bff8) Merge staging and verify chat tools integration - [`a9b41b2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a9b41b278d691f6d234a465e254b1a7b94d582d8) Merge staging inventory update into chat tools - [`e6d764b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e6d764b40c749fa0d76131ec31fa8d72863261c9) Merge commit '3355c32277f71d2d4aa2e4f84d4901c098047dec' into contrib/6698-chat-tools - [`274bcd5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/274bcd5c100e24435189f762009e84e3a159667b) fix: refresh chat insights reliably after edits and cleared searches - [`ea62c74`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ea62c74fb97d5b0d2c628a6b5a0dcbc8c0969ddb) fix: preserve narrator identity in game story exports - [`9aa2719`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9aa27191b891c3efdf9c5225b85a71a7a2abb8b7) fix: keep story avatars compact and reject repeated timezone values - [`98206c8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/98206c801990bdd1c2cf7beb3e7bd3125670478d) Merge latest staging into reviewed chat insights - [`ae09851`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ae098514ffc7e32dcaff85de5d12408fcefd2919) test: allow slower native server restarts ### 📊 Changes **30 files changed** (+3974 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+6 -0) ➕ `e2e/chat-insights.e2e.ts` (+234 -0) 📝 `packages/client/src/components/chat/ChatArea.tsx` (+14 -0) 📝 `packages/client/src/components/chat/ChatBranchSelector.tsx` (+48 -1) 📝 `packages/client/src/components/layout/AppShell.tsx` (+35 -0) 📝 `packages/client/src/components/layout/ChatSidebar.tsx` (+21 -0) 📝 `packages/client/src/components/layout/ModalRenderer.tsx` (+20 -0) ➕ `packages/client/src/components/modals/ActivityOverviewModal.tsx` (+252 -0) ➕ `packages/client/src/components/modals/ChatStatsModal.tsx` (+244 -0) ➕ `packages/client/src/components/modals/GlobalSearchModal.tsx` (+321 -0) ➕ `packages/client/src/hooks/use-chat-insights.ts` (+79 -0) 📝 `packages/client/src/hooks/use-chats.ts` (+12 -3) ➕ `packages/client/src/lib/chat-insights-display.ts` (+153 -0) ➕ `packages/client/src/lib/chat-insights.ts` (+34 -0) 📝 `packages/client/src/localization/locales/en.json` (+102 -0) ➕ `packages/server/src/routes/chat-insights.routes.ts` (+73 -0) 📝 `packages/server/src/routes/chats.routes.ts` (+90 -22) 📝 `packages/server/src/routes/index.ts` (+2 -0) ➕ `packages/server/src/services/chat-insights/chat-insights.service.ts` (+508 -0) ➕ `packages/server/src/services/chat-insights/transcript-avatars.ts` (+38 -0) _...and 10 more files_ </details> ### 📄 Description ## Linked issue Closes #6802. Partial implementation of #6698; the umbrella issue remains open. ## Why this change Chats need searchable history, readable story exports and useful activity summaries without exposing hidden messages or private notes. ## What changed - Add chat search, Markdown/HTML story exports and activity statistics using the existing chat storage and panels. - Repair stale activity/search results, narrator attribution and repeated timezone query validation. Embed each safe raster avatar once per HTML export. ## Validation - [x] `pnpm check` passes locally - [x] Container (Docker / Podman) built and ran without issue - [x] 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) - [x] Read and followed `CONTRIBUTING.md` pnpm check; 23 focused chat regressions; six desktop/mobile Chromium/WebKit browser cases; seven shell smoke cases passed. Local CodeRabbit completed; valid findings were fixed and documented. The latest hosted findings were fixed in 9aa27191b. Follow-up review and current-head GitHub checks remain merge gates. ### Manual verification Manually verify search, activity timezone changes, and downloaded story exports with a representative long chat. Automated browser evidence does not claim physical-device or manual container verification. Human checklist states are preserved. ## 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) Added an Unreleased changelog entry. No release metadata or user-facing docs changed. ## UI evidence [Browser evidence](https://gist.github.com/SpicyMarinara/44650cec76ed92d1ef25c8a3bd762a3b) (download the HTML to view the embedded screenshots). Captions distinguish before/after captures from current feature screenshots. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Search across chats by phrase, with filters for mode, role, character, and date. Jump to matching messages where supported. * View chat statistics and an activity overview with message, play-time, streak, and activity details. * Export chats as Markdown or standalone HTML, alongside existing formats. HTML stories can include embedded avatars. * Open global search with Ctrl+Shift+F or Cmd+Shift+F, or from the chat list. * **Bug Fixes** * Transcript exports and search results omit private or internal content; HTML-like transcript text is safely escaped. * Printed transcripts include reasoning once even when the Thinking section is collapsed. * Game-mode message jumps display a notice directing you to the game log. * Chat insights requests reject ambiguous timezone parameters. <!-- end of auto-generated comment: release notes by coderabbit.ai --> <!-- maintainer-final-review --> ### Maintainer verification Published f4255e335 completes the print review follow-up. Included reasoning is rendered once, reused in a screen disclosure and a print-only block, and shown exactly once per medium using ordinary display rules. This avoids depending on the newer details-content pseudo-element while retaining offline, script-free exports. The small HTML duplication and removal condition are documented in the code. Screen captures are unchanged; the evidence gist includes print before/after images. The original print defect failed on desktop Chromium, mobile Chromium and mobile WebKit. The final behavioral proof passes all three projects, including collapsed/expanded screen behavior, one visible reasoning copy in print, return to screen, offline avatars and no scripts. Exact branch validation passed pnpm check, the chat-story-export regression and smoke7/7. The final local CodeRabbit review of this compatibility follow-up completed with zero findings; prior valid findings were fixed and review decisions remain recorded. The branch also retains reviewed search/activity/export fixes, compact embedded avatars and the native restart fixture correction. The slow replacement-startup failure has an injected-delay red/green proof; process ownership, old-process exit and lease assertions remain intact. The combined integration build passed before the final print-only compatibility delta, whose identical renderer is validated on this branch. Current-head hosted CodeRabbit and CI remain merge gates. Human validation checkboxes are unchanged. <!-- /maintainer-final-review --> <!-- local-validation-20260928 --> ### Local build and container verification Tested commit: f4255e3351c2791e12cde0514ff771eb009b774b. Full local pnpm check passed. The full Docker image built successfully and ran with synthetic data; HTTP readiness and embedded build commit were verified. These results do not claim completion of the remaining manual and UI edge-case checklist. <!-- /local-validation-20260928 --> <!-- interactive-validation-20260928 --> Interactive browser walkthroughs of the feature were completed against the running production container using synthetic fixtures, supported by focused automated browser checks. This was agent-operated browser interaction, not physical-device testing. The broader theme, empty-state and error-path checklist remains separate. <!-- /interactive-validation-20260928 --> ### Remaining interactive verification Native Windows save-picker behavior and interactive activity-timezone changes remain unverified. The automated download-fallback export test does not verify the native save dialog. Overall manual verification remains unchecked. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:18:39 +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#7324
No description provided.