[PR #1847] [MERGED] Fix profile import export parity #5317

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1847
Author: @cha1latte
Created: 6/1/2026
Status: ✅ Merged
Merged: 6/1/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/issue-1811-profile-import-export


📝 Commits (1)

  • 6af2fce Fix profile import export parity

📊 Changes

14 files changed (+479 additions, -45 deletions)

View changed files

📝 src-tauri/src/commands/storage/backup.rs (+18 -0)
📝 src-tauri/src/commands/storage/commands/profile.rs (+14 -2)
📝 src-tauri/src/commands/storage/exports.rs (+42 -0)
📝 src-tauri/src/commands/storage/profile.rs (+146 -6)
📝 src-tauri/src/commands/storage/profile/assets.rs (+29 -15)
📝 src-tauri/src/commands/storage/profile/zip_import.rs (+50 -0)
📝 src-tauri/src/http_dispatch.rs (+8 -1)
📝 src-tauri/src/lib.rs (+1 -0)
📝 src/features/shell/settings/components/ProfileImportSection.test.tsx (+35 -2)
📝 src/features/shell/settings/components/ProfileImportSection.tsx (+37 -6)
📝 src/features/shell/settings/components/SettingsPanel.tsx (+57 -7)
📝 src/shared/api/profile-api.ts (+32 -3)
📝 src/shared/api/remote-runtime.ts (+1 -0)
📝 src/shared/components/ui/ExportFormatDialog.tsx (+9 -3)

📄 Description

Linked issue

Closes #1811

Why this change

  • Settings profile import/export regressed to a native-JSON-only path in places, which removed compatible/profile ZIP export choices, blocked remote ZIP imports, and made ZIP imports fail hard when an otherwise recoverable profile referenced a missing asset file.

What changed

  • Restored profile export format selection for native JSON, compatible ZIP bundles, and profile ZIP downloads.
  • Added JSON-too-large fallback metadata so native JSON export can offer profile ZIP recovery instead of failing without a next step.
  • Added remote/browser profile upload import support for JSON and ZIP files through the shared profile API wrapper.
  • Changed profile ZIP asset restoration to warn about missing asset files while importing recoverable profile data.
  • Added focused Rust and settings component coverage for the restored export/import paths.

Refactor impact

Primary owner:

  • Rust storage/import-export

Impact areas reviewed:

  • Settings Advanced profile export UI
  • Settings profile import UI
  • Shared profile API wrapper and remote runtime command allowlist
  • Tauri command registration and remote invoke dispatch
  • Profile ZIP asset recovery

Boundary notes:

  • Feature UI continues to call src/shared/api/profile-api.ts instead of raw Tauri or remote fetch.
  • Rust storage owns the profile export/import behavior and warning payloads.
  • Engine code is not touched.

Pressure points touched:

  • src-tauri/src/lib.rs command registration
  • Profile import/export modules
  • Remote runtime dispatch for profile commands

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

  • cargo test --manifest-path src-tauri\Cargo.toml profile_zip_assets_warn_manifest_entries_without_matching_file
  • cargo test --manifest-path src-tauri\Cargo.toml import_profile_zip_warns_and_preserves_data_when_asset_file_is_missing
  • cargo test --manifest-path src-tauri\Cargo.toml profile_export_supports_compatible_and_zip_formats
  • cargo test --manifest-path src-tauri\Cargo.toml profile_upload_import_accepts_json_payloads
  • pnpm exec vitest run src\features\shell\settings\components\ProfileImportSection.test.tsx
  • pnpm typecheck
  • cargo check --manifest-path src-tauri\Cargo.toml
  • pnpm check
  • node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json

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:

  • Bugfix restores existing profile import/export compatibility and recovery options; it does not add a new discoverable feature.

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

  • Not captured. This change is covered by component tests and Rust import/export command tests; no browser proof was required for the non-layout claim.

🔄 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/1847 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/1/2026 **Status:** ✅ Merged **Merged:** 6/1/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-1811-profile-import-export` --- ### 📝 Commits (1) - [`6af2fce`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6af2fce11e665764a0a49fc4d813cf698614c5a5) Fix profile import export parity ### 📊 Changes **14 files changed** (+479 additions, -45 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/backup.rs` (+18 -0) 📝 `src-tauri/src/commands/storage/commands/profile.rs` (+14 -2) 📝 `src-tauri/src/commands/storage/exports.rs` (+42 -0) 📝 `src-tauri/src/commands/storage/profile.rs` (+146 -6) 📝 `src-tauri/src/commands/storage/profile/assets.rs` (+29 -15) 📝 `src-tauri/src/commands/storage/profile/zip_import.rs` (+50 -0) 📝 `src-tauri/src/http_dispatch.rs` (+8 -1) 📝 `src-tauri/src/lib.rs` (+1 -0) 📝 `src/features/shell/settings/components/ProfileImportSection.test.tsx` (+35 -2) 📝 `src/features/shell/settings/components/ProfileImportSection.tsx` (+37 -6) 📝 `src/features/shell/settings/components/SettingsPanel.tsx` (+57 -7) 📝 `src/shared/api/profile-api.ts` (+32 -3) 📝 `src/shared/api/remote-runtime.ts` (+1 -0) 📝 `src/shared/components/ui/ExportFormatDialog.tsx` (+9 -3) </details> ### 📄 Description ## Linked issue Closes #1811 ## Why this change - Settings profile import/export regressed to a native-JSON-only path in places, which removed compatible/profile ZIP export choices, blocked remote ZIP imports, and made ZIP imports fail hard when an otherwise recoverable profile referenced a missing asset file. ## What changed - Restored profile export format selection for native JSON, compatible ZIP bundles, and profile ZIP downloads. - Added JSON-too-large fallback metadata so native JSON export can offer profile ZIP recovery instead of failing without a next step. - Added remote/browser profile upload import support for JSON and ZIP files through the shared profile API wrapper. - Changed profile ZIP asset restoration to warn about missing asset files while importing recoverable profile data. - Added focused Rust and settings component coverage for the restored export/import paths. ## Refactor impact Primary owner: - Rust storage/import-export Impact areas reviewed: - Settings Advanced profile export UI - Settings profile import UI - Shared profile API wrapper and remote runtime command allowlist - Tauri command registration and remote invoke dispatch - Profile ZIP asset recovery Boundary notes: - Feature UI continues to call `src/shared/api/profile-api.ts` instead of raw Tauri or remote fetch. - Rust storage owns the profile export/import behavior and warning payloads. - Engine code is not touched. Pressure points touched: - `src-tauri/src/lib.rs` command registration - Profile import/export modules - Remote runtime dispatch for profile commands ## 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 - `cargo test --manifest-path src-tauri\Cargo.toml profile_zip_assets_warn_manifest_entries_without_matching_file` - `cargo test --manifest-path src-tauri\Cargo.toml import_profile_zip_warns_and_preserves_data_when_asset_file_is_missing` - `cargo test --manifest-path src-tauri\Cargo.toml profile_export_supports_compatible_and_zip_formats` - `cargo test --manifest-path src-tauri\Cargo.toml profile_upload_import_accepts_json_payloads` - `pnpm exec vitest run src\features\shell\settings\components\ProfileImportSection.test.tsx` - `pnpm typecheck` - `cargo check --manifest-path src-tauri\Cargo.toml` - `pnpm check` - `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json` ## 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: - Bugfix restores existing profile import/export compatibility and recovery options; it does not add a new discoverable feature. ## 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 - Not captured. This change is covered by component tests and Rust import/export command tests; no browser proof was required for the non-layout claim. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:15:12 +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#5317
No description provided.