[PR #1652] [MERGED] [codex] Move persona hooks to catalog personas #5184

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1652
Author: @Xelvanis
Created: 5/30/2026
Status: ✅ Merged
Merged: 5/30/2026
Merged by: @Xelvanis

Base: refactor ← Head: codex/persona-ownership-cleanup


📝 Commits (2)

  • e576cea Move persona hooks to catalog personas
  • c1e526a Fix active persona cache invalidation

📊 Changes

33 files changed (+407 additions, -271 deletions)

View changed files

📝 docs/developer/architecture.html (+4 -4)
📝 docs/developer/modules.html (+3 -3)
📝 src/features/catalog/characters/components/CharacterEditor.test.tsx (+13 -3)
📝 src/features/catalog/characters/components/CharacterEditor.tsx (+1 -2)
📝 src/features/catalog/characters/hooks/use-characters.ts (+1 -203)
📝 src/features/catalog/characters/query-keys.ts (+0 -7)
📝 src/features/catalog/lorebooks/components/LorebookEditor.tsx (+2 -1)
📝 src/features/catalog/lorebooks/components/LorebooksPanel.tsx (+2 -1)
📝 src/features/catalog/personas/components/CreatePersonaModal.tsx (+1 -1)
📝 src/features/catalog/personas/components/ImportPersonaModal.tsx (+2 -2)
📝 src/features/catalog/personas/components/PersonaEditor.tsx (+1 -1)
📝 src/features/catalog/personas/components/PersonaMakerModal.tsx (+1 -1)
📝 src/features/catalog/personas/components/PersonasPanel.tsx (+1 -1)
➕ src/features/catalog/personas/hooks/use-personas.test.tsx (+156 -0)
📝 src/features/catalog/personas/hooks/use-personas.ts (+166 -6)
➕ src/features/catalog/personas/index.ts (+2 -0)
➕ src/features/catalog/personas/query-keys.test.ts (+14 -0)
📝 src/features/catalog/personas/query-keys.ts (+5 -0)
📝 src/features/modes/conversation/components/ConversationInput.tsx (+5 -4)
📝 src/features/modes/game/components/GameSetupWizard.tsx (+1 -1)

...and 13 more files

📄 Description

Linked issue

No linked GitHub issue. This follows the architecture ownership remediation work for persona catalog ownership.

Why this change

  • Move persona data ownership out of catalog/characters and behind the existing catalog/personas feature boundary.
  • Preserve existing TanStack Query cache keys so the ownership cleanup does not split or invalidate active persona caches unexpectedly.

What changed

  • Added src/features/catalog/personas/index.ts as the public persona data entrypoint.
  • Moved public persona hooks, summary type, and persona query keys behind catalog/personas.
  • Removed persona-owned hooks and persona key members from catalog/characters.
  • Updated callers across shell, lorebooks, shared chat UI, conversation input, game setup, and runtime tracker to import persona hooks/keys from catalog/personas.
  • Added focused cache-key and active-persona invalidation regression tests for persona query behavior.
  • Updated developer architecture/module docs to reflect the new persona ownership boundary.

Refactor impact

Primary owner:

features/catalog/personas

Impact areas reviewed:

  • features/catalog/personas hook/query-key ownership and persona UI components
  • features/catalog/characters character hooks, query keys, and import-as-persona workflow
  • Shared chat UI persona selectors and cached persona reads
  • Conversation input persona update/cache reads
  • Runtime tracker persona cache/update paths
  • Shell settings/imports/Mari persona consumers
  • Lorebook and game setup persona summary/list consumers

Boundary notes:

  • Feature/catalog-only ownership cleanup.
  • No engine, shared API adapter, Rust, Tauri command, or remote runtime routing changes.
  • Existing storageApi, personaApi, and storageCommandsApi usage remains in the catalog feature layer.
  • Existing persona cache key strings are preserved and covered by a focused test.

Pressure points touched:

  • Shared mode UI imports only; no shared mode UI behavior moved.
  • Runtime tracker cache helper imports now use personaKeys.list.
  • Active persona cache now invalidates after persona update/delete/avatar upload.
  • No ModeSurface, GameSurface, src-tauri/src/lib.rs, or command registration changes.

Validation

  • pnpm check passes locally
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Playwright, screenshot, or recording evidence added for UI changes
  • Remote runtime smoke checked when relevant

Manual verification notes

Automated validation run:

  • Bunny follow-up commit c1e526aa addressed the active persona cache invalidation review finding for update/delete/avatar upload.
  • pnpm test -- src/features/catalog/personas/query-keys.test.ts src/features/catalog/personas/hooks/use-personas.test.tsx src/features/shell/settings/hooks/tracker-card-color-manager.test.ts src/features/catalog/characters/components/CharacterEditor.test.tsx passed, 4 files / 8 tests.
  • pnpm typecheck passed.
  • pnpm check:architecture passed.
  • pnpm check:docs passed.
  • pnpm build passed. Vite emitted the existing large-chunk warning, but the build completed successfully.
  • git diff --check origin/refactor...HEAD -- . ':(exclude)graphify-out/**' passed.

No browser or native Tauri manual QA was run; this is an import/cache ownership cleanup with no intended visible UI behavior change.

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

Docs note: docs/developer/architecture.html and docs/developer/modules.html were updated. No CHANGELOG.md is present in this checkout, and this change is not release-visible behavior.

UI evidence

Not applicable; no visible UI change intended.

Summary by CodeRabbit

Release Notes

  • Refactor
    • Reorganized persona-related data hooks and utilities into the personas module. All persona features remain fully functional.

Review Change Stack


🔄 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/1652 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 5/30/2026 **Status:** ✅ Merged **Merged:** 5/30/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `codex/persona-ownership-cleanup` --- ### 📝 Commits (2) - [`e576cea`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e576cea73b5250c5c11d7165edb6af68f85a0e53) Move persona hooks to catalog personas - [`c1e526a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c1e526aae70c26e3254455c68f11f5abc3bbe0a5) Fix active persona cache invalidation ### 📊 Changes **33 files changed** (+407 additions, -271 deletions) <details> <summary>View changed files</summary> 📝 `docs/developer/architecture.html` (+4 -4) 📝 `docs/developer/modules.html` (+3 -3) 📝 `src/features/catalog/characters/components/CharacterEditor.test.tsx` (+13 -3) 📝 `src/features/catalog/characters/components/CharacterEditor.tsx` (+1 -2) 📝 `src/features/catalog/characters/hooks/use-characters.ts` (+1 -203) 📝 `src/features/catalog/characters/query-keys.ts` (+0 -7) 📝 `src/features/catalog/lorebooks/components/LorebookEditor.tsx` (+2 -1) 📝 `src/features/catalog/lorebooks/components/LorebooksPanel.tsx` (+2 -1) 📝 `src/features/catalog/personas/components/CreatePersonaModal.tsx` (+1 -1) 📝 `src/features/catalog/personas/components/ImportPersonaModal.tsx` (+2 -2) 📝 `src/features/catalog/personas/components/PersonaEditor.tsx` (+1 -1) 📝 `src/features/catalog/personas/components/PersonaMakerModal.tsx` (+1 -1) 📝 `src/features/catalog/personas/components/PersonasPanel.tsx` (+1 -1) ➕ `src/features/catalog/personas/hooks/use-personas.test.tsx` (+156 -0) 📝 `src/features/catalog/personas/hooks/use-personas.ts` (+166 -6) ➕ `src/features/catalog/personas/index.ts` (+2 -0) ➕ `src/features/catalog/personas/query-keys.test.ts` (+14 -0) 📝 `src/features/catalog/personas/query-keys.ts` (+5 -0) 📝 `src/features/modes/conversation/components/ConversationInput.tsx` (+5 -4) 📝 `src/features/modes/game/components/GameSetupWizard.tsx` (+1 -1) _...and 13 more files_ </details> ### 📄 Description ## Linked issue No linked GitHub issue. This follows the architecture ownership remediation work for persona catalog ownership. ## Why this change - Move persona data ownership out of `catalog/characters` and behind the existing `catalog/personas` feature boundary. - Preserve existing TanStack Query cache keys so the ownership cleanup does not split or invalidate active persona caches unexpectedly. ## What changed - Added `src/features/catalog/personas/index.ts` as the public persona data entrypoint. - Moved public persona hooks, summary type, and persona query keys behind `catalog/personas`. - Removed persona-owned hooks and persona key members from `catalog/characters`. - Updated callers across shell, lorebooks, shared chat UI, conversation input, game setup, and runtime tracker to import persona hooks/keys from `catalog/personas`. - Added focused cache-key and active-persona invalidation regression tests for persona query behavior. - Updated developer architecture/module docs to reflect the new persona ownership boundary. ## Refactor impact Primary owner: `features/catalog/personas` Impact areas reviewed: - `features/catalog/personas` hook/query-key ownership and persona UI components - `features/catalog/characters` character hooks, query keys, and import-as-persona workflow - Shared chat UI persona selectors and cached persona reads - Conversation input persona update/cache reads - Runtime tracker persona cache/update paths - Shell settings/imports/Mari persona consumers - Lorebook and game setup persona summary/list consumers Boundary notes: - Feature/catalog-only ownership cleanup. - No engine, shared API adapter, Rust, Tauri command, or remote runtime routing changes. - Existing `storageApi`, `personaApi`, and `storageCommandsApi` usage remains in the catalog feature layer. - Existing persona cache key strings are preserved and covered by a focused test. Pressure points touched: - Shared mode UI imports only; no shared mode UI behavior moved. - Runtime tracker cache helper imports now use `personaKeys.list`. - Active persona cache now invalidates after persona update/delete/avatar upload. - No `ModeSurface`, `GameSurface`, `src-tauri/src/lib.rs`, or command registration changes. ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> - [ ] `pnpm check` passes locally - [x] `pnpm typecheck` passes locally - [x] `pnpm build` passes locally - [x] `pnpm check:architecture` passes locally - [x] `pnpm check:docs` passes locally - [ ] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Playwright, screenshot, or recording evidence added for UI changes - [ ] Remote runtime smoke checked when relevant ### Manual verification notes Automated validation run: - Bunny follow-up commit `c1e526aa` addressed the active persona cache invalidation review finding for update/delete/avatar upload. - `pnpm test -- src/features/catalog/personas/query-keys.test.ts src/features/catalog/personas/hooks/use-personas.test.tsx src/features/shell/settings/hooks/tracker-card-color-manager.test.ts src/features/catalog/characters/components/CharacterEditor.test.tsx` passed, 4 files / 8 tests. - `pnpm typecheck` passed. - `pnpm check:architecture` passed. - `pnpm check:docs` passed. - `pnpm build` passed. Vite emitted the existing large-chunk warning, but the build completed successfully. - `git diff --check origin/refactor...HEAD -- . ':(exclude)graphify-out/**'` passed. No browser or native Tauri manual QA was run; this is an import/cache ownership cleanup with no intended visible UI behavior change. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [x] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims Docs note: `docs/developer/architecture.html` and `docs/developer/modules.html` were updated. No `CHANGELOG.md` is present in this checkout, and this change is not release-visible behavior. ## UI evidence Not applicable; no visible UI change intended. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **Refactor** * Reorganized persona-related data hooks and utilities into the personas module. All persona features remain fully functional. <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/1652?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- 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:14:01 +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#5184
No description provided.