[PR #2341] [MERGED] Fix chat export compatibility #5541

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

📋 Pull Request Information

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

Base: refactor ← Head: fix/issue-2308-chat-export-compat


📝 Commits (1)

  • 5be98ba Fix chat export compatibility

📊 Changes

6 files changed (+516 additions, -13 deletions)

View changed files

📝 src-tauri/src/commands/storage/imports/marinara.rs (+10 -0)
➕ src-tauri/src/commands/storage/imports/marinara_chat_bulk.rs (+166 -0)
📝 src-tauri/src/commands/storage/imports/marinara_tests.rs (+193 -0)
📝 src/app/shell/ChatSidebar.tsx (+1 -1)
📝 src/features/catalog/chats/hooks/use-chats.ts (+1 -1)
📝 src/features/catalog/chats/lib/chat-transcript-export.ts (+145 -11)

📄 Description

Linked issue

Closes #2308

Why this change

  • Refactor kept JSONL/text chat export affordances, but JSONL emitted raw Marinara message objects instead of the legacy/ST-compatible transcript rows.
  • Sidebar Native JSON bulk chat export produced format: "marinara-chat-bulk" files with no matching recovery import route.

What changed

  • Restored single-chat JSONL export to emit a header row plus ST-compatible message rows with name, is_user, is_system, mes, and send_date.
  • Restored text transcript context with chat metadata, speaker/display labels, and timestamps.
  • Added a manifest to bulk JSONL/text ZIP exports so branch/group/roster metadata travels with the transcript files.
  • Added native marinara-chat-bulk JSON recovery through Marinara file import, creating fresh chat/message IDs while preserving chat mode, roster, group, persona, connection, prompt preset, metadata, message content, and timestamps.
  • Added Rust coverage for native chat-bulk importability and a negative-control JSON shape that must not match the chat-bulk importer.

Refactor impact

Primary owner:

  • Catalog chat export helpers and Rust storage/imports.

Impact areas reviewed:

  • Chat/catalog export hook.
  • Sidebar bulk export consumer.
  • Settings Marinara file import route.
  • Native import rollback behavior.

Boundary notes:

  • React feature code still calls existing catalog export helpers.
  • Import recovery stays inside the existing Rust Marinara file import path rather than adding a broad feature-side router or new raw invoke surface.
  • No engine imports, remote-runtime allowlist changes, or command registration changes were needed.

Pressure points touched:

  • src/features/catalog/chats/lib/chat-transcript-export.ts
  • src-tauri/src/commands/storage/imports/marinara.rs

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • pnpm typecheck
  • cargo fmt --manifest-path src-tauri/Cargo.toml
  • cargo test --manifest-path src-tauri/Cargo.toml marinara_file_import_
  • Scratch Vitest export-shape proof passed locally and was removed before commit.
  • cargo check --manifest-path src-tauri/Cargo.toml
  • git diff --check

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • Compatibility fix for existing chat export/import affordances.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

  • No screenshots. Export/import data-shape change verified by focused command proof.

🔄 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/2341 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 6/5/2026 **Status:** ✅ Merged **Merged:** 6/5/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `refactor` ← **Head:** `fix/issue-2308-chat-export-compat` --- ### 📝 Commits (1) - [`5be98ba`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5be98ba65995c5302117b13d02fe9e69d94a4384) Fix chat export compatibility ### 📊 Changes **6 files changed** (+516 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/imports/marinara.rs` (+10 -0) ➕ `src-tauri/src/commands/storage/imports/marinara_chat_bulk.rs` (+166 -0) 📝 `src-tauri/src/commands/storage/imports/marinara_tests.rs` (+193 -0) 📝 `src/app/shell/ChatSidebar.tsx` (+1 -1) 📝 `src/features/catalog/chats/hooks/use-chats.ts` (+1 -1) 📝 `src/features/catalog/chats/lib/chat-transcript-export.ts` (+145 -11) </details> ### 📄 Description ## Linked issue Closes #2308 ## Why this change - Refactor kept JSONL/text chat export affordances, but JSONL emitted raw Marinara message objects instead of the legacy/ST-compatible transcript rows. - Sidebar Native JSON bulk chat export produced `format: "marinara-chat-bulk"` files with no matching recovery import route. ## What changed - Restored single-chat JSONL export to emit a header row plus ST-compatible message rows with `name`, `is_user`, `is_system`, `mes`, and `send_date`. - Restored text transcript context with chat metadata, speaker/display labels, and timestamps. - Added a manifest to bulk JSONL/text ZIP exports so branch/group/roster metadata travels with the transcript files. - Added native `marinara-chat-bulk` JSON recovery through Marinara file import, creating fresh chat/message IDs while preserving chat mode, roster, group, persona, connection, prompt preset, metadata, message content, and timestamps. - Added Rust coverage for native chat-bulk importability and a negative-control JSON shape that must not match the chat-bulk importer. ## Refactor impact Primary owner: - Catalog chat export helpers and Rust storage/imports. Impact areas reviewed: - Chat/catalog export hook. - Sidebar bulk export consumer. - Settings Marinara file import route. - Native import rollback behavior. Boundary notes: - React feature code still calls existing catalog export helpers. - Import recovery stays inside the existing Rust Marinara file import path rather than adding a broad feature-side router or new raw invoke surface. - No engine imports, remote-runtime allowlist changes, or command registration changes were needed. Pressure points touched: - `src/features/catalog/chats/lib/chat-transcript-export.ts` - `src-tauri/src/commands/storage/imports/marinara.rs` ## Validation - [x] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [x] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - `pnpm typecheck` - `cargo fmt --manifest-path src-tauri/Cargo.toml` - `cargo test --manifest-path src-tauri/Cargo.toml marinara_file_import_` - Scratch Vitest export-shape proof passed locally and was removed before commit. - `cargo check --manifest-path src-tauri/Cargo.toml` - `git diff --check` ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [x] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - Compatibility fix for existing chat export/import affordances. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence - No screenshots. Export/import data-shape change verified by focused command proof. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:17: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#5541
No description provided.