[PR #2119] [MERGED] Support legacy array profile imports #5447

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2119
Author: @Xelvanis
Created: 6/4/2026
Status: ✅ Merged
Merged: 6/4/2026
Merged by: @Xelvanis

Base: refactor ← Head: feature/profile-import-source-formats


📝 Commits (2)

  • e9d8fd6 Support legacy array profile imports
  • 89b8b99 Address profile import review feedback

📊 Changes

4 files changed (+872 additions, -26 deletions)

View changed files

📝 src-tauri/src/commands/storage/profile.rs (+448 -9)
📝 src-tauri/src/commands/storage/profile/legacy.rs (+293 -0)
📝 src-tauri/src/commands/storage/profile/zip_import.rs (+87 -14)
📝 src/features/shell/settings/components/ProfileImportSection.tsx (+44 -3)

📄 Description

Linked issue

Related to https://github.com/Pasta-Devs/Marinara-Engine/issues/2108

Why this change

  • Profile imports should accept legacy v1.6.1-compatible profile exports that carry direct top-level arrays instead of only refactor data.collections or legacy data.fileStorage.tables.
  • Import failures should report the expected source formats clearly and avoid silent collection wipes when malformed legacy-array fields are present.

What changed

  • Added import source format metadata for native refactor profiles, legacy fileStorage profiles, and legacy direct-array profiles.
  • Added a legacy-array translator for characters, personas, lorebooks, presets, agents, and themes, including nested lorebook/preset child rows and legacy avatar base64 normalization.
  • Extended ZIP profile import to use the same legacy-array path and metadata.
  • Updated the settings import result type to accept the new metadata fields.

Refactor impact

Primary owner:

Rust storage profile import, with a small shell settings type update.

Impact areas reviewed:

  • JSON profile import dispatch
  • ZIP profile import dispatch
  • Legacy table import normalization and replacement behavior
  • Settings import result typing
  • Legacy v1.6.1 profile export shape from origin/main

Boundary notes:

  • Behavior stays in src-tauri storage/profile import modules.
  • React change is type-only and does not add raw Tauri or remote-runtime calls.
  • No engine, shared API, or remote runtime routing changes.

Pressure points touched:

  • Import modules under src-tauri/src/commands/storage/profile*.

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

  • git diff --check passed.
  • cargo test --manifest-path src-tauri/Cargo.toml profile_import -- --nocapture passed, 21 tests.
  • cargo test --manifest-path src-tauri/Cargo.toml import_profile_zip -- --nocapture passed, 3 tests.
  • pnpm check passed.
  • Native Tauri app manual import was not run.

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 an existing profile import workflow; no new discoverable UI surface.

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

No docs changes needed. This changes import compatibility and response metadata, not contributor guidance, architecture docs, or release claims.

UI evidence

N/A. Backend import behavior plus a TypeScript response type update only; no visible UI layout change.

Summary by CodeRabbit

  • New Features

    • Profile imports now include metadata showing the source format and any format conversions applied during the import process.
    • Added support for importing legacy array-based profile formats.
  • Bug Fixes

    • Enhanced error messages for invalid profile imports with clearer details about expected profile formats.

🔄 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/2119 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 6/4/2026 **Status:** ✅ Merged **Merged:** 6/4/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `feature/profile-import-source-formats` --- ### 📝 Commits (2) - [`e9d8fd6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e9d8fd62efeec9727b4999471bda3e8990d94d56) Support legacy array profile imports - [`89b8b99`](https://github.com/Pasta-Devs/Marinara-Engine/commit/89b8b99ec4e311b2537871032d43773982578d8b) Address profile import review feedback ### 📊 Changes **4 files changed** (+872 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/profile.rs` (+448 -9) 📝 `src-tauri/src/commands/storage/profile/legacy.rs` (+293 -0) 📝 `src-tauri/src/commands/storage/profile/zip_import.rs` (+87 -14) 📝 `src/features/shell/settings/components/ProfileImportSection.tsx` (+44 -3) </details> ### 📄 Description ## Linked issue Related to https://github.com/Pasta-Devs/Marinara-Engine/issues/2108 ## Why this change - Profile imports should accept legacy v1.6.1-compatible profile exports that carry direct top-level arrays instead of only refactor `data.collections` or legacy `data.fileStorage.tables`. - Import failures should report the expected source formats clearly and avoid silent collection wipes when malformed legacy-array fields are present. ## What changed - Added import source format metadata for native refactor profiles, legacy fileStorage profiles, and legacy direct-array profiles. - Added a legacy-array translator for characters, personas, lorebooks, presets, agents, and themes, including nested lorebook/preset child rows and legacy avatar base64 normalization. - Extended ZIP profile import to use the same legacy-array path and metadata. - Updated the settings import result type to accept the new metadata fields. ## Refactor impact Primary owner: Rust storage profile import, with a small shell settings type update. Impact areas reviewed: - JSON profile import dispatch - ZIP profile import dispatch - Legacy table import normalization and replacement behavior - Settings import result typing - Legacy v1.6.1 profile export shape from `origin/main` Boundary notes: - Behavior stays in `src-tauri` storage/profile import modules. - React change is type-only and does not add raw Tauri or remote-runtime calls. - No engine, shared API, or remote runtime routing changes. Pressure points touched: - Import modules under `src-tauri/src/commands/storage/profile*`. ## 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 - `git diff --check` passed. - `cargo test --manifest-path src-tauri/Cargo.toml profile_import -- --nocapture` passed, 21 tests. - `cargo test --manifest-path src-tauri/Cargo.toml import_profile_zip -- --nocapture` passed, 3 tests. - `pnpm check` passed. - Native Tauri app manual import was not run. ## 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 an existing profile import workflow; no new discoverable UI surface. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims No docs changes needed. This changes import compatibility and response metadata, not contributor guidance, architecture docs, or release claims. ## UI evidence N/A. Backend import behavior plus a TypeScript response type update only; no visible UI layout change. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Profile imports now include metadata showing the source format and any format conversions applied during the import process. * Added support for importing legacy array-based profile formats. * **Bug Fixes** * Enhanced error messages for invalid profile imports with clearer details about expected profile formats. <!-- 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-22 04:16:24 +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#5447
No description provided.