[PR #1656] [MERGED] [codex] Refactor personas catalog ownership #5190

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

📋 Pull Request Information

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

Base: refactor ← Head: codex/personas-audit


📝 Commits (6)

  • 3291d17 Refactor personas catalog ownership
  • aafa7fe Fix persona sprite ownership review findings
  • 880d770 Document shared catalog sprite ownership
  • 2556009 Fix personas review findings
  • a2b88c0 Clear stale persona sprite selections
  • 17b022e Fix refactor replay import

📊 Changes

53 files changed (+4372 additions, -2596 deletions)

View changed files

📝 AGENTS.md (+1 -0)
📝 CONTRIBUTING.md (+1 -1)
📝 docs/developer/architecture.html (+14 -4)
📝 docs/developer/modules.html (+12 -2)
📝 skills/marinara-architecture-guard/references/repo-layout.md (+1 -0)
📝 src-tauri/src/commands/storage/commands/media.rs (+16 -7)
📝 src-tauri/src/commands/storage/sprites.rs (+341 -38)
📝 src-tauri/src/http_dispatch.rs (+10 -1)
📝 src/features/catalog/characters/components/CharacterEditor.test.tsx (+16 -5)
📝 src/features/catalog/characters/components/CharacterEditor.tsx (+46 -14)
📝 src/features/catalog/characters/hooks/use-characters.ts (+3 -121)
📝 src/features/catalog/characters/query-keys.ts (+0 -5)
➕ src/features/catalog/personas/components/PersonaColorsTab.tsx (+158 -0)
➕ src/features/catalog/personas/components/PersonaDescriptionTab.tsx (+271 -0)
📝 src/features/catalog/personas/components/PersonaEditor.tsx (+9 -1643)
➕ src/features/catalog/personas/components/PersonaEditorSectionHeader.tsx (+8 -0)
➕ src/features/catalog/personas/components/PersonaGroupsSection.tsx (+282 -0)
➕ src/features/catalog/personas/components/PersonaListItem.tsx (+165 -0)
➕ src/features/catalog/personas/components/PersonaSpriteDeleteDialog.tsx (+82 -0)
➕ src/features/catalog/personas/components/PersonaSpriteEditors.tsx (+51 -0)

...and 33 more files

📄 Description

Linked issue

No linked issue.

Why this change

Prepare Personas for follow-up refactor work by making the feature boundaries explicit: Personas owns persona data/editing, shared sprite behavior lives in features/catalog/sprites, and tracker card UI/color behavior lives in features/runtime/tracker.

What changed

  • Split the large Personas editor/panel surface into focused components and model helpers under src/features/catalog/personas.
  • Moved shared character/persona sprite hooks and query keys into src/features/catalog/sprites.
  • Restored tracker card color code under the runtime tracker owner instead of Personas or shell settings.
  • Added owner-typed sprite API/storage routing so persona sprites are namespaced separately from character sprites, with legacy migration when unambiguous.
  • Updated runtime/game/chat consumers to use the public sprite and persona entrypoints.
  • Updated architecture docs and repo guidance to document features/catalog/sprites ownership.

Refactor impact

Primary owner:

Catalog Personas, Catalog Sprites, Runtime Tracker, Shared API, and Rust sprite storage.

Impact areas reviewed:

  • Persona editor/panel tabs, groups, filters, avatar/sprite editing, and persona data hooks.
  • Character sprite callers and runtime sprite consumers.
  • Tracker card color settings and persona tracker card rendering.
  • Game surface persona sprite lookup and shared chat settings sprite queries.
  • Hostable runtime sprite command dispatch through remote-runtime.ts and http_dispatch.rs.

Boundary notes:

  • Feature callers use public package entrypoints; import scans found no outside callers reaching into private Personas internals.
  • catalog/sprites is a catalog-level shared owner for sprite hooks/query keys; catalog code still does not import runtime/modes/shell.
  • image-generation-api.ts remains the focused shared API wrapper for sprite commands and now passes ownerType for character/persona storage.
  • Rust sprite command facades and HTTP dispatch both route to the same focused sprites.rs implementation.
  • Engine code was not changed.

Pressure points touched:

  • GameSurface.tsx and ChatSettingsDrawer.tsx only at sprite query call sites.
  • src-tauri/src/lib.rs command registration was not changed in this branch.
  • No import modules touched.

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

Agent-run validation, with template checkboxes intentionally left unchecked for human verification:

  • pnpm vitest run src/features/catalog/sprites/hooks/use-sprites.test.tsx src/features/catalog/personas/lib/personas-panel-model.test.ts src/features/runtime/tracker/lib/tracker-card-color-manager.test.ts passed: 3 files, 17 tests.
  • cargo test --manifest-path src-tauri/Cargo.toml sprite_upload_tests -- --nocapture passed: 5 tests.
  • pnpm typecheck passed.
  • cargo check --manifest-path src-tauri/Cargo.toml passed.
  • pnpm check:architecture passed.
  • pnpm check:docs passed after the docs sync.
  • pnpm build passed.
  • rustfmt --edition 2021 --check passed on touched Rust files.
  • Current-head Tauri launch smoke passed via pnpm tauri dev --no-watch --config scratch\tauri-qa.config.json: WebView loaded and the native QA window was found.
  • pnpm check was not claimed; pnpm check:line-endings currently fails on pre-existing repo-wide CRLF drift unrelated to this branch.

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 updated:

  • AGENTS.md
  • CONTRIBUTING.md
  • docs/developer/architecture.html
  • docs/developer/modules.html
  • skills/marinara-architecture-guard/references/repo-layout.md

No changelog or release note was added because this is an internal refactor/storage safety fix on the refactor branch, not a user-facing release entry.

UI evidence

No screenshot/recording added. This is primarily a modular ownership and storage-boundary refactor; the native launch smoke only verified current-head app startup.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Personas feature with comprehensive editor UI including color customization, descriptions, stats, sprite management, and group organization
    • Sprite system now supports persona-owned sprites in addition to character sprites
    • Expression avatars can display persona sprites during roleplay
  • Refactor

    • Sprite operations refactored to support multiple owner types (character and persona)
    • Sprite functionality organized into dedicated catalog module
  • Documentation

    • Architecture and module documentation updated to reflect new sprite module structure and persona feature integration

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/1656 **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/personas-audit` --- ### 📝 Commits (6) - [`3291d17`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3291d17be56716285b288e596ba9e57d906c27b2) Refactor personas catalog ownership - [`aafa7fe`](https://github.com/Pasta-Devs/Marinara-Engine/commit/aafa7fe573868d8dcef33232cdc3b2667962843e) Fix persona sprite ownership review findings - [`880d770`](https://github.com/Pasta-Devs/Marinara-Engine/commit/880d770014ec2652550a03bf354e508359a916eb) Document shared catalog sprite ownership - [`2556009`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2556009e335aad9032e13b8cd2bb3b096b65dae6) Fix personas review findings - [`a2b88c0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a2b88c0e30fcb80b44e62083da30afd067de7f32) Clear stale persona sprite selections - [`17b022e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/17b022e41ab7fab437f6829ab00f2c2672ae37e6) Fix refactor replay import ### 📊 Changes **53 files changed** (+4372 additions, -2596 deletions) <details> <summary>View changed files</summary> 📝 `AGENTS.md` (+1 -0) 📝 `CONTRIBUTING.md` (+1 -1) 📝 `docs/developer/architecture.html` (+14 -4) 📝 `docs/developer/modules.html` (+12 -2) 📝 `skills/marinara-architecture-guard/references/repo-layout.md` (+1 -0) 📝 `src-tauri/src/commands/storage/commands/media.rs` (+16 -7) 📝 `src-tauri/src/commands/storage/sprites.rs` (+341 -38) 📝 `src-tauri/src/http_dispatch.rs` (+10 -1) 📝 `src/features/catalog/characters/components/CharacterEditor.test.tsx` (+16 -5) 📝 `src/features/catalog/characters/components/CharacterEditor.tsx` (+46 -14) 📝 `src/features/catalog/characters/hooks/use-characters.ts` (+3 -121) 📝 `src/features/catalog/characters/query-keys.ts` (+0 -5) ➕ `src/features/catalog/personas/components/PersonaColorsTab.tsx` (+158 -0) ➕ `src/features/catalog/personas/components/PersonaDescriptionTab.tsx` (+271 -0) 📝 `src/features/catalog/personas/components/PersonaEditor.tsx` (+9 -1643) ➕ `src/features/catalog/personas/components/PersonaEditorSectionHeader.tsx` (+8 -0) ➕ `src/features/catalog/personas/components/PersonaGroupsSection.tsx` (+282 -0) ➕ `src/features/catalog/personas/components/PersonaListItem.tsx` (+165 -0) ➕ `src/features/catalog/personas/components/PersonaSpriteDeleteDialog.tsx` (+82 -0) ➕ `src/features/catalog/personas/components/PersonaSpriteEditors.tsx` (+51 -0) _...and 33 more files_ </details> ### 📄 Description ## Linked issue No linked issue. ## Why this change Prepare Personas for follow-up refactor work by making the feature boundaries explicit: Personas owns persona data/editing, shared sprite behavior lives in `features/catalog/sprites`, and tracker card UI/color behavior lives in `features/runtime/tracker`. ## What changed - Split the large Personas editor/panel surface into focused components and model helpers under `src/features/catalog/personas`. - Moved shared character/persona sprite hooks and query keys into `src/features/catalog/sprites`. - Restored tracker card color code under the runtime tracker owner instead of Personas or shell settings. - Added owner-typed sprite API/storage routing so persona sprites are namespaced separately from character sprites, with legacy migration when unambiguous. - Updated runtime/game/chat consumers to use the public sprite and persona entrypoints. - Updated architecture docs and repo guidance to document `features/catalog/sprites` ownership. ## Refactor impact Primary owner: Catalog Personas, Catalog Sprites, Runtime Tracker, Shared API, and Rust sprite storage. Impact areas reviewed: - Persona editor/panel tabs, groups, filters, avatar/sprite editing, and persona data hooks. - Character sprite callers and runtime sprite consumers. - Tracker card color settings and persona tracker card rendering. - Game surface persona sprite lookup and shared chat settings sprite queries. - Hostable runtime sprite command dispatch through `remote-runtime.ts` and `http_dispatch.rs`. Boundary notes: - Feature callers use public package entrypoints; import scans found no outside callers reaching into private Personas internals. - `catalog/sprites` is a catalog-level shared owner for sprite hooks/query keys; catalog code still does not import runtime/modes/shell. - `image-generation-api.ts` remains the focused shared API wrapper for sprite commands and now passes `ownerType` for character/persona storage. - Rust sprite command facades and HTTP dispatch both route to the same focused `sprites.rs` implementation. - Engine code was not changed. Pressure points touched: - `GameSurface.tsx` and `ChatSettingsDrawer.tsx` only at sprite query call sites. - `src-tauri/src/lib.rs` command registration was not changed in this branch. - No import modules touched. ## 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 Agent-run validation, with template checkboxes intentionally left unchecked for human verification: - `pnpm vitest run src/features/catalog/sprites/hooks/use-sprites.test.tsx src/features/catalog/personas/lib/personas-panel-model.test.ts src/features/runtime/tracker/lib/tracker-card-color-manager.test.ts` passed: 3 files, 17 tests. - `cargo test --manifest-path src-tauri/Cargo.toml sprite_upload_tests -- --nocapture` passed: 5 tests. - `pnpm typecheck` passed. - `cargo check --manifest-path src-tauri/Cargo.toml` passed. - `pnpm check:architecture` passed. - `pnpm check:docs` passed after the docs sync. - `pnpm build` passed. - `rustfmt --edition 2021 --check` passed on touched Rust files. - Current-head Tauri launch smoke passed via `pnpm tauri dev --no-watch --config scratch\tauri-qa.config.json`: WebView loaded and the native QA window was found. - `pnpm check` was not claimed; `pnpm check:line-endings` currently fails on pre-existing repo-wide CRLF drift unrelated to this branch. ## 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 updated: - `AGENTS.md` - `CONTRIBUTING.md` - `docs/developer/architecture.html` - `docs/developer/modules.html` - `skills/marinara-architecture-guard/references/repo-layout.md` No changelog or release note was added because this is an internal refactor/storage safety fix on the refactor branch, not a user-facing release entry. ## UI evidence No screenshot/recording added. This is primarily a modular ownership and storage-boundary refactor; the native launch smoke only verified current-head app startup. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Added Personas feature with comprehensive editor UI including color customization, descriptions, stats, sprite management, and group organization * Sprite system now supports persona-owned sprites in addition to character sprites * Expression avatars can display persona sprites during roleplay * **Refactor** * Sprite operations refactored to support multiple owner types (character and persona) * Sprite functionality organized into dedicated catalog module * **Documentation** * Architecture and module documentation updated to reflect new sprite module structure and persona feature integration <!-- 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/1656?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:04 +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#5190
No description provided.