[PR #1837] [MERGED] Fix bot browser import parity #5307

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

📋 Pull Request Information

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

Base: refactor ← Head: fix/issue-1805-bot-browser-parity


📝 Commits (2)

📊 Changes

8 files changed (+259 additions, -37 deletions)

View changed files

📝 src-tauri/src/commands/storage/imports/normalization.rs (+4 -5)
📝 src-tauri/src/commands/storage/imports/service_tests.rs (+37 -0)
➕ src/features/shell/bot-browser/api/bot-browser-api.test.ts (+53 -0)
📝 src/features/shell/bot-browser/api/bot-browser-api.ts (+43 -0)
📝 src/features/shell/bot-browser/components/BotBrowserView.tsx (+23 -32)
➕ src/features/shell/bot-browser/lib/character-detail-merge.test.ts (+40 -0)
➕ src/features/shell/bot-browser/lib/character-detail-merge.ts (+55 -0)
📝 src/features/shell/bot-browser/types/provider-responses.ts (+4 -0)

📄 Description

Linked issue

Closes #1805.

Why this change

Bot Browser imports were passing _botBrowserSource, but the ST character import normalization did not persist it into data.extensions.botBrowserSource, so imported browser cards could disappear from the Browser panel's imported list. The refactor path also dropped Chub detail enrichment fields when importing downloaded PNG cards, and JannyAI search could stop at the backend Cloudflare mitigation error without trying the legacy browser-side route.

What changed

  • Persist _botBrowserSource into imported character extensions while preserving existing provider extension metadata.
  • Merge Chub detail fields into imported/downloaded card JSON, including system_prompt, post_history_instructions, character_version, embedded lorebook data, and provider extensions.
  • Add a JannyAI browser-side search fallback when the Tauri backend reports Cloudflare mitigation.
  • Add focused Rust and Vitest coverage for source-marker persistence, Chub detail merging, and the Janny fallback path.

Validation

  • Passed: pnpm exec vitest run src/features/shell/bot-browser/api/bot-browser-api.test.ts src/features/shell/bot-browser/lib/character-detail-merge.test.ts src/features/shell/bot-browser/components/BotBrowserView.test.tsx
  • Passed: cargo test --manifest-path src-tauri\Cargo.toml import_st_character_preserves_bot_browser_source_marker
  • Passed: pnpm check
  • Passed: risky-work proof health ledger. Live-provider manual rows are recorded as non-blocking because upstream provider network behavior can vary.

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:

  • Restores existing Bot Browser import/provider parity; no new discoverable surface, setting, mode, or workflow is introduced.

Docs and release impact

No docs or release notes changed. This restores refactor parity for existing Bot Browser import/provider behavior.

UI evidence (if applicable)

Not applicable: this is import/provider data-path behavior covered by targeted unit tests and the PR gate.


🔄 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/1837 **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-1805-bot-browser-parity` --- ### 📝 Commits (2) - [`0362cff`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0362cffecdf65b3e2f34d4968a9f5b72fb8411a7) Fix bot browser import parity - [`b4af441`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b4af4417dbd4be54c2344a4ebcc3f4f5978b3132) Refresh PR checks ### 📊 Changes **8 files changed** (+259 additions, -37 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/imports/normalization.rs` (+4 -5) 📝 `src-tauri/src/commands/storage/imports/service_tests.rs` (+37 -0) ➕ `src/features/shell/bot-browser/api/bot-browser-api.test.ts` (+53 -0) 📝 `src/features/shell/bot-browser/api/bot-browser-api.ts` (+43 -0) 📝 `src/features/shell/bot-browser/components/BotBrowserView.tsx` (+23 -32) ➕ `src/features/shell/bot-browser/lib/character-detail-merge.test.ts` (+40 -0) ➕ `src/features/shell/bot-browser/lib/character-detail-merge.ts` (+55 -0) 📝 `src/features/shell/bot-browser/types/provider-responses.ts` (+4 -0) </details> ### 📄 Description ## Linked issue Closes #1805. ## Why this change Bot Browser imports were passing `_botBrowserSource`, but the ST character import normalization did not persist it into `data.extensions.botBrowserSource`, so imported browser cards could disappear from the Browser panel's imported list. The refactor path also dropped Chub detail enrichment fields when importing downloaded PNG cards, and JannyAI search could stop at the backend Cloudflare mitigation error without trying the legacy browser-side route. ## What changed - Persist `_botBrowserSource` into imported character extensions while preserving existing provider extension metadata. - Merge Chub detail fields into imported/downloaded card JSON, including `system_prompt`, `post_history_instructions`, `character_version`, embedded lorebook data, and provider extensions. - Add a JannyAI browser-side search fallback when the Tauri backend reports Cloudflare mitigation. - Add focused Rust and Vitest coverage for source-marker persistence, Chub detail merging, and the Janny fallback path. ## Validation - Passed: `pnpm exec vitest run src/features/shell/bot-browser/api/bot-browser-api.test.ts src/features/shell/bot-browser/lib/character-detail-merge.test.ts src/features/shell/bot-browser/components/BotBrowserView.test.tsx` - Passed: `cargo test --manifest-path src-tauri\Cargo.toml import_st_character_preserves_bot_browser_source_marker` - Passed: `pnpm check` - Passed: risky-work proof health ledger. Live-provider manual rows are recorded as non-blocking because upstream provider network behavior can vary. ## 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: - Restores existing Bot Browser import/provider parity; no new discoverable surface, setting, mode, or workflow is introduced. ## Docs and release impact No docs or release notes changed. This restores refactor parity for existing Bot Browser import/provider behavior. ## UI evidence (if applicable) Not applicable: this is import/provider data-path behavior covered by targeted unit tests and the PR gate. --- <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:07 +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#5307
No description provided.