[GH-ISSUE #2000] [Issue]: Native prompt preset import leaves section and group order IDs stale #980

Closed
opened 2026-10-21 05:24:42 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Xelvanis on GitHub (Jun 3, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2000

Originally assigned to: @cha1latte on GitHub.

Summary

Native marinara_preset import recreates prompt groups and sections with new IDs, but the imported preset root can keep exported sectionOrder and groupOrder arrays that still point at the old child IDs.

Expected behavior

When importing a native prompt preset, sectionOrder and groupOrder should be remapped from exported child IDs to the newly created child IDs, matching legacy behavior and current prompt preset duplicate behavior.

Actual behavior

src-tauri/src/commands/storage/imports/marinara.rs creates the new preset, groups, sections, and variables, but does not patch the preset root order arrays after child ID remap. The preset editor builds ordered sections from preset.sectionOrder, so imported sections can be hidden from the editor order when the array contains old IDs.

Steps to reproduce

  1. Export a native Marinara prompt preset with multiple sections and a non-empty sectionOrder / groupOrder.
  2. Import that exported marinara_preset envelope into another profile or a fresh profile.
  3. Open the imported preset in the preset editor.
  4. Compare the created prompt-sections / prompt-groups row IDs with the imported preset root sectionOrder / groupOrder values.

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: origin/refactor at 805ab939
  • Run mode: not run; static parityscan only
  • OS + version: not collected
  • Node + pnpm versions: not collected
  • Rust version, if relevant: not collected
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: not relevant

Logs, screenshots, or video

No runtime logs or screenshots. Evidence is static code comparison against legacy 1.6.1 behavior.

Regression notes

Legacy native preset import remapped old section and group order IDs to newly created IDs before saving the imported preset root. Refactor duplicate logic also has an ID remap helper for prompt preset children, but the native import path does not apply equivalent order remapping.

Evidence:

  • Refactor import creates the preset and children in src-tauri/src/commands/storage/imports/marinara.rs, but no sectionOrder / groupOrder remap patch is present after child creation.
  • Refactor preset editor trusts preset.sectionOrder when building orderedSections in src/features/catalog/presets/components/PresetEditor.tsx.
  • Legacy import remapped sectionOrder and groupOrder in packages/server/src/services/import/marinara.importer.ts.
  • Current refactor duplicate path already remaps prompt child order arrays in src-tauri/src/commands/storage/prompts.rs.

Additional context

Found during target 8 presets and prompt settings parityscan for #1904. Existing closed #1784 covered prompt preset duplicate/delete, runtime precedence, and chat-settings preset import/export; this native prompt preset import order gap appears separate.

Suggested repair: collect old-to-new group, section, and variable ID maps during native preset import, then patch the created preset with remapped groupOrder, sectionOrder, and variableOrder arrays, falling back to created child order when exported arrays are missing or stale.

Template check

Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Xelvanis on GitHub (Jun 3, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2000 Originally assigned to: @cha1latte on GitHub. ## Summary Native `marinara_preset` import recreates prompt groups and sections with new IDs, but the imported preset root can keep exported `sectionOrder` and `groupOrder` arrays that still point at the old child IDs. ## Expected behavior When importing a native prompt preset, `sectionOrder` and `groupOrder` should be remapped from exported child IDs to the newly created child IDs, matching legacy behavior and current prompt preset duplicate behavior. ## Actual behavior `src-tauri/src/commands/storage/imports/marinara.rs` creates the new preset, groups, sections, and variables, but does not patch the preset root order arrays after child ID remap. The preset editor builds ordered sections from `preset.sectionOrder`, so imported sections can be hidden from the editor order when the array contains old IDs. ## Steps to reproduce 1. Export a native Marinara prompt preset with multiple sections and a non-empty `sectionOrder` / `groupOrder`. 2. Import that exported `marinara_preset` envelope into another profile or a fresh profile. 3. Open the imported preset in the preset editor. 4. Compare the created `prompt-sections` / `prompt-groups` row IDs with the imported preset root `sectionOrder` / `groupOrder` values. ## Impact area - [ ] App shell, navigation, startup, or providers - [x] Catalog resources - [ ] Chat mode - [ ] Roleplay mode - [ ] Game mode - [ ] Shared mode UI - [ ] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [ ] React-free engine behavior, contracts, agents, or capability ports - [ ] Shared API wrapper or remote runtime routing - [x] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: `origin/refactor` at `805ab939` - Run mode: not run; static parityscan only - OS + version: not collected - Node + pnpm versions: not collected - Rust version, if relevant: not collected - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: not relevant ## Logs, screenshots, or video No runtime logs or screenshots. Evidence is static code comparison against legacy 1.6.1 behavior. ## Regression notes Legacy native preset import remapped old section and group order IDs to newly created IDs before saving the imported preset root. Refactor duplicate logic also has an ID remap helper for prompt preset children, but the native import path does not apply equivalent order remapping. Evidence: - Refactor import creates the preset and children in `src-tauri/src/commands/storage/imports/marinara.rs`, but no `sectionOrder` / `groupOrder` remap patch is present after child creation. - Refactor preset editor trusts `preset.sectionOrder` when building `orderedSections` in `src/features/catalog/presets/components/PresetEditor.tsx`. - Legacy import remapped `sectionOrder` and `groupOrder` in `packages/server/src/services/import/marinara.importer.ts`. - Current refactor duplicate path already remaps prompt child order arrays in `src-tauri/src/commands/storage/prompts.rs`. ## Additional context Found during target 8 presets and prompt settings parityscan for #1904. Existing closed #1784 covered prompt preset duplicate/delete, runtime precedence, and chat-settings preset import/export; this native prompt preset import order gap appears separate. Suggested repair: collect old-to-new group, section, and variable ID maps during native preset import, then patch the created preset with remapped `groupOrder`, `sectionOrder`, and `variableOrder` arrays, falling back to created child order when exported arrays are missing or stale. ## Template check Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:24:42 +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#980
No description provided.