[PR #4491] [MERGED] fix(maps): refresh lorebooks after portable imports #6399

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4491
Author: @thetopham
Created: 8/2/2026
Status: ✅ Merged
Merged: 8/3/2026
Merged by: @thetopham

Base: staging ← Head: agent/4490-world-map-lore-refresh


📝 Commits (2)

  • 96004f2 fix(maps): refresh host lorebooks after imports
  • f9ea2ae style(client): order world map cache imports

📊 Changes

2 files changed (+27 additions, -4 deletions)

View changed files

📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+9 -2)
📝 packages/client/src/components/layout/AppShell.tsx (+18 -2)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #4490

Paired World Maps 1.3.0 package work: Pasta-Devs/Marinara-Agents#213

Why this change

World Maps and the Engine app have separate React Query clients. Portable lore imports refreshed the package-local cache, but the main Lorebooks library kept its deleted-book list until the browser was reloaded. Linked-lore navigation also needed the host to invalidate that cache without delaying the requested editor transition.

What changed

  • Expose a host callback to World Maps that invalidates the complete Engine lorebook query family.
  • Supply it to the full workspace, feature-agent detail host, and both Chat Settings World Maps mounts.
  • Invalidate host lore state while opening linked lorebooks immediately through the existing detail navigation.
  • Preserve all existing Lorebooks controls and copy; this is a cache-coordination change only.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Automated evidence:

  • pnpm check passed, including Impeccable context, localization, ESLint, TypeScript, and production builds.
  • The paired package's portable-lore logic and exact World Maps 1.3.0 artifact lifecycle regressions passed.
  • Desktop Chromium scenario portable map import refreshes host lorebooks and linked navigation without reload passed against an isolated Engine data directory seeded with the exact 1.3.0 ZIP.
  • git diff --check passed.

Manual verification notes

  • Manually verify a portable lorebook copy appears in the main Lorebooks library without a browser reload.
  • Manually verify linked-lore Open from a saved map.
  • Manually verify linked-lore Open after discarding unsaved map changes.
  • Manually verify existing non-Maps lorebook navigation is unchanged.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

No user-facing copy or Engine release metadata changed.

UI evidence (if applicable)

Automated installed-package Chromium coverage proves the exact stale-cache reproduction and both host-library and linked-lore navigation paths. Human browser verification remains listed above.

Summary by CodeRabbit

  • Bug Fixes
    • Lorebook data now refreshes automatically when opening lorebooks from chat settings or spatial views.
    • Lorebook changes are reflected consistently across map and feature integrations.

🔄 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/4491 **Author:** [@thetopham](https://github.com/thetopham) **Created:** 8/2/2026 **Status:** ✅ Merged **Merged:** 8/3/2026 **Merged by:** [@thetopham](https://github.com/thetopham) **Base:** `staging` ← **Head:** `agent/4490-world-map-lore-refresh` --- ### 📝 Commits (2) - [`96004f2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/96004f2beb820b175508f384caf4d7919c08b8dd) fix(maps): refresh host lorebooks after imports - [`f9ea2ae`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f9ea2aebd5873e30a8e7b2568ee408866de35cae) style(client): order world map cache imports ### 📊 Changes **2 files changed** (+27 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+9 -2) 📝 `packages/client/src/components/layout/AppShell.tsx` (+18 -2) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #4490 Paired World Maps 1.3.0 package work: Pasta-Devs/Marinara-Agents#213 ## Why this change World Maps and the Engine app have separate React Query clients. Portable lore imports refreshed the package-local cache, but the main Lorebooks library kept its deleted-book list until the browser was reloaded. Linked-lore navigation also needed the host to invalidate that cache without delaying the requested editor transition. ## What changed - Expose a host callback to World Maps that invalidates the complete Engine lorebook query family. - Supply it to the full workspace, feature-agent detail host, and both Chat Settings World Maps mounts. - Invalidate host lore state while opening linked lorebooks immediately through the existing detail navigation. - Preserve all existing Lorebooks controls and copy; this is a cache-coordination change only. ## Validation - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Automated evidence: - `pnpm check` passed, including Impeccable context, localization, ESLint, TypeScript, and production builds. - The paired package's portable-lore logic and exact World Maps 1.3.0 artifact lifecycle regressions passed. - Desktop Chromium scenario `portable map import refreshes host lorebooks and linked navigation without reload` passed against an isolated Engine data directory seeded with the exact 1.3.0 ZIP. - `git diff --check` passed. ### Manual verification notes - Manually verify a portable lorebook copy appears in the main Lorebooks library without a browser reload. - Manually verify linked-lore Open from a saved map. - Manually verify linked-lore Open after discarding unsaved map changes. - Manually verify existing non-Maps lorebook navigation is unchanged. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) No user-facing copy or Engine release metadata changed. ## UI evidence (if applicable) Automated installed-package Chromium coverage proves the exact stale-cache reproduction and both host-library and linked-lore navigation paths. Human browser verification remains listed above. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Lorebook data now refreshes automatically when opening lorebooks from chat settings or spatial views. - Lorebook changes are reflected consistently across map and feature integrations. <!-- 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-23 04:10:03 +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#6399
No description provided.