[PR #1647] [MERGED] Project remaining useCharacters list payload #5179

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

📋 Pull Request Information

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

Base: refactor ← Head: codex/project-usecharacters-list


📝 Commits (2)

  • b6cb02e Project useCharacters list payload
  • 63db0cd Deduplicate character list projection fields

📊 Changes

2 files changed (+79 additions, -5 deletions)

View changed files

📝 src/features/catalog/characters/hooks/use-characters.test.ts (+72 -3)
📝 src/features/catalog/characters/hooks/use-characters.ts (+7 -2)

📄 Description

Linked issue

Closes #1582
Related: #1643

Why this change

  • Xel's #1582 follow-up comment noted that useCharacters() still called storageApi.list("characters") without a projection after the earlier partial fix.
  • #1643 moved the active library/panel paths to useCharacterSummaries(), but the exported full-list hook still allowed future callers to fetch embedded avatar payloads by accident.

What changed

  • Added a full-list projection for useCharacters() that keeps full data while omitting embedded avatarPath from list rows.
  • Added a regression test that mounts the hook and asserts the projected storageApi.list("characters", ...) call.

Refactor impact

Primary owner:

  • catalog

Impact areas reviewed:

  • Character library/panel call sites already use useCharacterSummaries() after #1643.
  • Raw unprojected storageApi.list("characters") grep now returns no matches.

Boundary notes:

  • Feature hook change only. It continues to use the focused shared storageApi wrapper; no engine, Rust, or remote-runtime boundary changes.

Pressure points touched:

  • none

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

  • pnpm typecheck
  • pnpm exec vitest run src/features/catalog/characters/hooks/use-characters.test.ts
  • pnpm check:architecture
  • pnpm build
  • git diff --check
  • rg -n -F 'storageApi.list("characters"' src src-tauri returned no matches.
  • rg -n "useCharacters\\(" src/features src/app src/shared -g "*.ts" -g "*.tsx" only found the hook definition and its regression test.

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

  • No visible UI change; this narrows the character list payload for the remaining full-list hook.

Summary by CodeRabbit

  • Refactor
    • Optimized the character list query to fetch only essential fields, reducing payload size and improving performance. Unnecessary embedded data is now excluded from character list requests.

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/1647 **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/project-usecharacters-list` --- ### 📝 Commits (2) - [`b6cb02e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b6cb02e5beaf593289670a77198c6345399dbbf5) Project useCharacters list payload - [`63db0cd`](https://github.com/Pasta-Devs/Marinara-Engine/commit/63db0cdfd8005867a12f4bf55848f885fac3bef9) Deduplicate character list projection fields ### 📊 Changes **2 files changed** (+79 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/features/catalog/characters/hooks/use-characters.test.ts` (+72 -3) 📝 `src/features/catalog/characters/hooks/use-characters.ts` (+7 -2) </details> ### 📄 Description ## Linked issue Closes #1582 Related: #1643 ## Why this change - Xel's #1582 follow-up comment noted that `useCharacters()` still called `storageApi.list("characters")` without a projection after the earlier partial fix. - #1643 moved the active library/panel paths to `useCharacterSummaries()`, but the exported full-list hook still allowed future callers to fetch embedded avatar payloads by accident. ## What changed - Added a full-list projection for `useCharacters()` that keeps full `data` while omitting embedded `avatarPath` from list rows. - Added a regression test that mounts the hook and asserts the projected `storageApi.list("characters", ...)` call. ## Refactor impact Primary owner: - catalog Impact areas reviewed: - Character library/panel call sites already use `useCharacterSummaries()` after #1643. - Raw unprojected `storageApi.list("characters")` grep now returns no matches. Boundary notes: - Feature hook change only. It continues to use the focused shared `storageApi` wrapper; no engine, Rust, or remote-runtime boundary changes. Pressure points touched: - none ## 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 - `pnpm typecheck` - `pnpm exec vitest run src/features/catalog/characters/hooks/use-characters.test.ts` - `pnpm check:architecture` - `pnpm build` - `git diff --check` - `rg -n -F 'storageApi.list("characters"' src src-tauri` returned no matches. - `rg -n "useCharacters\\(" src/features src/app src/shared -g "*.ts" -g "*.tsx"` only found the hook definition and its regression test. ## 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 - No visible UI change; this narrows the character list payload for the remaining full-list hook. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Optimized the character list query to fetch only essential fields, reducing payload size and improving performance. Unnecessary embedded data is now excluded from character list requests. <!-- 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/1647?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:13:59 +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#5179
No description provided.