mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8598] [MERGED] feat(chats): export a selected range of messages #8696
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#8696
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8598
Author: @SpicyMarinara
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/chat-range-export-8547📝 Commits (8)
db20500feat(chats): export a selected range of messages (#8547)d0a518cfix(chats): keep Export selected to range selectionsd0b8b0bfix(chats): harden the range export preview after reviewfd8bb4ctest(chats): tighten the range assertions; keep a newer selection0c338adfix(chats): resolve {{input}} inside a range exportb42eb75fix(chats): read a snapshot name from string extras; test echo alone8030b44test(chats): keep the whole-chat {{input}} result pinned6aaffdefix(chats): a changed selection ends the export it was submitted for📊 Changes
12 files changed (+566 additions, -46 deletions)
View changed files
📝
e2e/chat-insights.e2e.ts(+113 -0)📝
packages/client/src/components/chat/ChatArea.tsx(+118 -5)📝
packages/client/src/components/chat/ChatBranchesPanel.tsx(+21 -1)📝
packages/client/src/components/chat/ChatCommonOverlays.tsx(+38 -13)📝
packages/client/src/components/chat/ChatConversationSurface.tsx(+7 -1)📝
packages/client/src/components/chat/ChatRoleplaySurface.tsx(+7 -1)📝
packages/client/src/components/chat/ChatSettingsDrawer.tsx(+6 -1)📝
packages/client/src/hooks/use-chats.ts(+14 -2)📝
packages/client/src/lib/chat-floating-ui-events.ts(+7 -0)📝
packages/client/src/localization/locales/en.json(+8 -0)📝
packages/server/src/routes/chats.routes.ts(+72 -22)➕
scripts/regressions/chat-range-export.regression.ts(+155 -0)📄 Description
Linked issue
Closes #8547
Why this change
What changed
<chat name> excerpt.<ext>.{{input}}in an exported message resolves within the range, so an excerpt never fills in a user message it leaves out. A whole-chat export is unchanged.GET /api/chats/:id/exportacceptsstartMessageIdandendMessageId. One without the other answers 400; a message that is not in the chat answers 404. Passing neither exports the whole chat as before.Validation
pnpm checkpasses locallyCONTRIBUTING.mdValidation run locally
pnpm check— passed (includes localization, Prettier, lint, type checks and the production build).pnpm localization:check— passed.node scripts/run-regressions.mjs --filter chat-range-export— passed (new).node scripts/run-regressions.mjs --filter chat-export-swipes-batch— passed.node scripts/run-regressions.mjs --filter bulk-export-zips— passed.node scripts/run-regressions.mjs --filter chat-story-export— passed.node scripts/run-regressions.mjs --filter native-export-memory— passed on its own. It also failed once when run beside all other export regressions at once, where it measures a 128 MB heap under parallel load; it passes when run alone and in the per-file lane.pnpm regression:ui e2e/chat-insights.e2e.ts --project=desktop-chromium --project=mobile-chromium --project=mobile-webkit --workers=1— 9 passed. The new range-export test passes on all three projects. The existing "chat search, stats and story exports" test failed once on mobile Chromium in a full three-project run, then passed alone and in two further mobile Chromium runs of the whole file.pnpm regression:ui e2e/core-flows.e2e.ts --project=desktop-chromium --project=mobile-chromium --project=mobile-webkit --workers=1 --grep "message deletion uses unified chroma"— 3 passed (the delete selection bar is unchanged).AssertionError: text range leaked "msg 0", because the route ignores the range parameters and exports the whole chat), and passes with it.Local CodeRabbit review
Two passes were fixed and the findings addressed in commits
fix(chats): harden the range export preview after reviewandtest(chats): tighten the range assertions; keep a newer selection.personaSnapshot.namewould throw while the preview was built; an export finishing after the user switched chats (or started a newer selection) cleared that newer selection; the regression's single-message case only checked the message was present, and the alternate-swipe check only rejected a line that was exactlymsg 3. Both regression gaps are now covered by one check that rejects any message text left outside the exported rows.parseMessageExtraRecordandgetPersonaSnapshotNamehelpers, so a message whoseextrais stored as a JSON string still shows the persona that wrote it. The {{input}} case now exports the echoing message on its own too, so the check fails if the macro reaches a user message outside the range. The new test's cleanup reports a disposal failure only when the test itself passed; throwing from afinallyis dropped there.{{input}}resolved to the chat's latest user message even when that message was outside the range, so the excerpt carried text it was meant to leave out (proven with a probe:echo: OUTSIDE latest user secret 2).lastInputnow comes from the exported messages. The regression covers the case and fails under the old behaviour.lint/correctness/noUnsafeFinally(a Biome rule) for the test cleanup'sthrow cleanupFailureinsidefinally. This repository validates with ESLint and Prettier, has no Biome configuration, andpnpm checkpasses on the file. The block is copied verbatim from thefinallycleanup of the test that already existed in this file (staging,e2e/chat-insights.e2e.ts:226), so it is the file's established teardown pattern rather than something this PR introduces.Manual verification notes
Screenshots of the open dialog on phone width were captured locally but not uploaded; please attach before/after evidence if helpful.
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)UI evidence (if applicable)
chat.rangeExport.*in the English catalog only; other locales fall back to English.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.