[PR #2237] [MERGED] Fix Chub card import detail merge #5500

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

📋 Pull Request Information

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

Base: refactor ← Head: fix/issue-2159-chub-detail-merge


📝 Commits (4)

  • 0a32bb5 Fix Chub card import detail merge
  • cf19e7c Record Chub import PR verification
  • a6cde2e Guard Chub import detail blanks
  • 9813387 Use Chub detail string helper consistently

📊 Changes

3 files changed (+84 additions, -69 deletions)

View changed files

📝 scratch/bugfix-verification.json (+55 -63)
📝 src/features/shell/bot-browser/components/BotBrowserView.tsx (+4 -1)
📝 src/features/shell/bot-browser/lib/character-detail-merge.ts (+25 -5)

📄 Description

Linked issue

Fixes #2159

Why this change

  • Chub PNG-download imports were keeping stale embedded PNG fields when the freshly fetched Chub detail had newer/fuller values.
  • The refactor also let embedded PNG extension keys override Chub detail extension keys, reversing legacy behavior.

What changed

  • Restored the legacy-supported field overlay set in mergeCharacterDetailIntoCharacterJson: description, personality, scenario, first message, examples, creator notes, system/post-history prompts, version, name, creator, tags, and alternate greetings.
  • Restored detail/provider extension precedence so Chub detail extension keys win over matching embedded PNG keys.
  • Passed the browser card summary name/creator/tags into the PNG import merge detail when a provider detail is available.

Refactor impact

Primary owner:

Catalog resources / bot browser imports

Impact areas reviewed:

  • Chub PNG-download import merge path
  • Chartavern PNG-download path when detail state is available
  • V2/V3 card data target and top-level character JSON merge behavior
  • Existing embedded lorebook preservation

Boundary notes:

  • Change stays inside src/features/shell/bot-browser; no engine, shared API, Rust, storage, schema, dependency, or provider transport changes.
  • The import detail re-fetch remains best-effort and still degrades to the embedded PNG when detail is unavailable.

Pressure points touched:

  • Import helper: src/features/shell/bot-browser/lib/character-detail-merge.ts
  • PNG-download import call site: src/features/shell/bot-browser/components/BotBrowserView.tsx

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

  • Machine proof: pnpm exec vitest run --config scratch/vitest.issue2159.config.ts --reporter=verbose passed 5 focused rows after first failing before the fix:
    • stale V2 embedded PNG fields are overlaid by Chub detail fields
    • detail/provider extensions override matching embedded PNG extension keys
    • top-level character JSON gets the same detail precedence
    • missing detail leaves parsed PNG data unchanged
    • blank detail strings do not erase embedded text fields
    • existing embedded lorebook is preserved
  • Baseline: pnpm typecheck passed.
  • Baseline: pnpm check passed.
  • No human-only verification blocker remains for the core claim; this is pure import merge logic.

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 for existing bot-browser import behavior; no 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

N/A; this is pure import merge logic. The raw focused proof output was captured locally in scratch/issue2159-proof-output.txt, and the tracked verification ledger is updated in scratch/bugfix-verification.json.

Summary by CodeRabbit

  • Bug Fixes
    • Improved Chub AI character imports to correctly preserve character name, creator, and tags from search results
    • Enhanced metadata merging to support comprehensive character information during imports

🔄 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/2237 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/4/2026 **Status:** ✅ Merged **Merged:** 6/4/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-2159-chub-detail-merge` --- ### 📝 Commits (4) - [`0a32bb5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0a32bb5d26a162d754533ab294f6b1834306c394) Fix Chub card import detail merge - [`cf19e7c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cf19e7c002d6cd296331c032a083d995ac3de859) Record Chub import PR verification - [`a6cde2e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a6cde2e3eb72297a2b4ace43ea90e3f81f9ab91f) Guard Chub import detail blanks - [`9813387`](https://github.com/Pasta-Devs/Marinara-Engine/commit/98133879568d7f96396b4428f2300c41d12193cb) Use Chub detail string helper consistently ### 📊 Changes **3 files changed** (+84 additions, -69 deletions) <details> <summary>View changed files</summary> 📝 `scratch/bugfix-verification.json` (+55 -63) 📝 `src/features/shell/bot-browser/components/BotBrowserView.tsx` (+4 -1) 📝 `src/features/shell/bot-browser/lib/character-detail-merge.ts` (+25 -5) </details> ### 📄 Description ## Linked issue Fixes #2159 ## Why this change - Chub PNG-download imports were keeping stale embedded PNG fields when the freshly fetched Chub detail had newer/fuller values. - The refactor also let embedded PNG extension keys override Chub detail extension keys, reversing legacy behavior. ## What changed - Restored the legacy-supported field overlay set in `mergeCharacterDetailIntoCharacterJson`: description, personality, scenario, first message, examples, creator notes, system/post-history prompts, version, name, creator, tags, and alternate greetings. - Restored detail/provider extension precedence so Chub detail extension keys win over matching embedded PNG keys. - Passed the browser card summary name/creator/tags into the PNG import merge detail when a provider detail is available. ## Refactor impact Primary owner: Catalog resources / bot browser imports Impact areas reviewed: - Chub PNG-download import merge path - Chartavern PNG-download path when detail state is available - V2/V3 card data target and top-level character JSON merge behavior - Existing embedded lorebook preservation Boundary notes: - Change stays inside `src/features/shell/bot-browser`; no engine, shared API, Rust, storage, schema, dependency, or provider transport changes. - The import detail re-fetch remains best-effort and still degrades to the embedded PNG when detail is unavailable. Pressure points touched: - Import helper: `src/features/shell/bot-browser/lib/character-detail-merge.ts` - PNG-download import call site: `src/features/shell/bot-browser/components/BotBrowserView.tsx` ## 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 - Machine proof: `pnpm exec vitest run --config scratch/vitest.issue2159.config.ts --reporter=verbose` passed 5 focused rows after first failing before the fix: - stale V2 embedded PNG fields are overlaid by Chub detail fields - detail/provider extensions override matching embedded PNG extension keys - top-level character JSON gets the same detail precedence - missing detail leaves parsed PNG data unchanged - blank detail strings do not erase embedded text fields - existing embedded lorebook is preserved - Baseline: `pnpm typecheck` passed. - Baseline: `pnpm check` passed. - No human-only verification blocker remains for the core claim; this is pure import merge logic. ## 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 for existing bot-browser import behavior; no 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 N/A; this is pure import merge logic. The raw focused proof output was captured locally in `scratch/issue2159-proof-output.txt`, and the tracked verification ledger is updated in `scratch/bugfix-verification.json`. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved Chub AI character imports to correctly preserve character name, creator, and tags from search results * Enhanced metadata merging to support comprehensive character information during imports <!-- 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:50 +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#5500
No description provided.