[PR #1472] [MERGED] Fix character picker cache refresh #5106

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1472
Author: @cha1latte
Created: 5/28/2026
Status: ✅ Merged
Merged: 5/28/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/refactor-issue-1466-character-picker


📝 Commits (2)

  • f9b355e Fix character summary cache refresh
  • 4de122b Fix refactor Rust clippy warnings

📊 Changes

11 files changed (+222 additions, -78 deletions)

View changed files

➕ pr-evidence/issue-1466/after-created-character-visible.png (+0 -0)
➕ pr-evidence/issue-1466/before-picker-empty.png (+0 -0)
📝 src-tauri/src/state.rs (+5 -6)
📝 src/features/catalog/characters/components/ImportCharacterModal.tsx (+17 -6)
➕ src/features/catalog/characters/hooks/use-characters.test.ts (+61 -0)
📝 src/features/catalog/characters/hooks/use-characters.ts (+82 -31)
📝 src/features/modes/conversation/components/ConversationView.tsx (+2 -2)
📝 src/features/modes/conversation/hooks/autonomous/use-autonomous-messaging.ts (+28 -18)
📝 src/features/modes/conversation/hooks/autonomous/use-background-autonomous.ts (+15 -8)
📝 src/features/shell/bot-browser/components/BotBrowserView.tsx (+10 -5)
📝 src/features/shell/imports/components/STBulkImportModal.tsx (+2 -2)

📄 Description

Linked issue

Closes #1466

Why this change

  • Creating a character refreshed the full character list cache but left the summary cache stale. The new conversation picker reads useCharacterSummaries(), so it could keep showing the pre-create set until the app reloaded.

What changed

  • Added shared character collection cache helpers that update or invalidate both full character rows and character summary rows together.
  • Updated character create, duplicate, delete, avatar/status refresh, and import paths to use the shared collection refresh behavior instead of only touching characterKeys.list().
  • Added focused unit coverage for list/summary upsert and delete cache behavior.
  • Added reviewer-visible UI evidence for the picker before/after path.
  • Included a clippy-only Rust cleanup in src-tauri/src/state.rs after rebasing onto the latest refactor head.

Refactor impact

Primary owner:

  • Catalog character hooks/cache helpers.
  • Rust state media-reference helper cleanup for CI after rebase.

Impact areas reviewed:

  • Conversation quick setup picker (useCharacterSummaries()).
  • Character import surfaces and bot browser imports.
  • Conversation autonomous/status refresh paths that update character summary data.
  • Rust local media-reference path helper (local_path_from_media_reference) for clippy-only shape cleanup.

Boundary notes:

  • The bug fix is React feature-layer cache handling only. The Rust touch is a clippy-only cleanup; no engine, shared API transport, Rust storage behavior, schema, command registration, or remote-runtime command boundaries changed.

Pressure points touched:

  • Shared character query cache helpers.
  • Conversation setup wizard data source.
  • Import surfaces that can add character records.
  • src-tauri/src/state.rs local media-reference migration helper, clippy-only.

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 exec vitest run --config scratch/vitest.issue-1466.config.ts: before the fix, reproduced the stale summary cache; after the fix, passed.
  • pnpm exec vitest run src/features/catalog/characters/hooks/use-characters.test.ts: passed, 3 tests.
  • node scratch\issue-1466-ui-verify.mjs: passed against Vite + marinara-server; the script opened the picker first, created a character through the Characters panel, opened a new conversation picker, and found the created character without refreshing.
  • pnpm check: passed.
  • pnpm build: passed with the existing large chunk warning.
  • cargo clippy --manifest-path src-tauri/Cargo.toml --workspace --all-targets -- -D warnings: passed.
  • graphify update .: ran after code changes; generated output was not included because the temp worktree name polluted Graphify report metadata and a stable-name junction rerun was blocked by Windows permissions.

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

Before, after loading the picker with no new character selected:

Before picker state

After creating a character, a new conversation picker shows the created character without refresh:

After created character visible


🔄 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/1472 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/28/2026 **Status:** ✅ Merged **Merged:** 5/28/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/refactor-issue-1466-character-picker` --- ### 📝 Commits (2) - [`f9b355e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f9b355e2e7fbfb7af47a92154d04e40ad2605034) Fix character summary cache refresh - [`4de122b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4de122b37a9aad03c25d81f6c0dfdc0791e45eec) Fix refactor Rust clippy warnings ### 📊 Changes **11 files changed** (+222 additions, -78 deletions) <details> <summary>View changed files</summary> ➕ `pr-evidence/issue-1466/after-created-character-visible.png` (+0 -0) ➕ `pr-evidence/issue-1466/before-picker-empty.png` (+0 -0) 📝 `src-tauri/src/state.rs` (+5 -6) 📝 `src/features/catalog/characters/components/ImportCharacterModal.tsx` (+17 -6) ➕ `src/features/catalog/characters/hooks/use-characters.test.ts` (+61 -0) 📝 `src/features/catalog/characters/hooks/use-characters.ts` (+82 -31) 📝 `src/features/modes/conversation/components/ConversationView.tsx` (+2 -2) 📝 `src/features/modes/conversation/hooks/autonomous/use-autonomous-messaging.ts` (+28 -18) 📝 `src/features/modes/conversation/hooks/autonomous/use-background-autonomous.ts` (+15 -8) 📝 `src/features/shell/bot-browser/components/BotBrowserView.tsx` (+10 -5) 📝 `src/features/shell/imports/components/STBulkImportModal.tsx` (+2 -2) </details> ### 📄 Description ## Linked issue Closes #1466 ## Why this change - Creating a character refreshed the full character list cache but left the summary cache stale. The new conversation picker reads `useCharacterSummaries()`, so it could keep showing the pre-create set until the app reloaded. ## What changed - Added shared character collection cache helpers that update or invalidate both full character rows and character summary rows together. - Updated character create, duplicate, delete, avatar/status refresh, and import paths to use the shared collection refresh behavior instead of only touching `characterKeys.list()`. - Added focused unit coverage for list/summary upsert and delete cache behavior. - Added reviewer-visible UI evidence for the picker before/after path. - Included a clippy-only Rust cleanup in `src-tauri/src/state.rs` after rebasing onto the latest `refactor` head. ## Refactor impact Primary owner: - Catalog character hooks/cache helpers. - Rust state media-reference helper cleanup for CI after rebase. Impact areas reviewed: - Conversation quick setup picker (`useCharacterSummaries()`). - Character import surfaces and bot browser imports. - Conversation autonomous/status refresh paths that update character summary data. - Rust local media-reference path helper (`local_path_from_media_reference`) for clippy-only shape cleanup. Boundary notes: - The bug fix is React feature-layer cache handling only. The Rust touch is a clippy-only cleanup; no engine, shared API transport, Rust storage behavior, schema, command registration, or remote-runtime command boundaries changed. Pressure points touched: - Shared character query cache helpers. - Conversation setup wizard data source. - Import surfaces that can add character records. - `src-tauri/src/state.rs` local media-reference migration helper, clippy-only. ## 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 exec vitest run --config scratch/vitest.issue-1466.config.ts`: before the fix, reproduced the stale summary cache; after the fix, passed. - `pnpm exec vitest run src/features/catalog/characters/hooks/use-characters.test.ts`: passed, 3 tests. - `node scratch\issue-1466-ui-verify.mjs`: passed against Vite + `marinara-server`; the script opened the picker first, created a character through the Characters panel, opened a new conversation picker, and found the created character without refreshing. - `pnpm check`: passed. - `pnpm build`: passed with the existing large chunk warning. - `cargo clippy --manifest-path src-tauri/Cargo.toml --workspace --all-targets -- -D warnings`: passed. - `graphify update .`: ran after code changes; generated output was not included because the temp worktree name polluted Graphify report metadata and a stable-name junction rerun was blocked by Windows permissions. ## 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 Before, after loading the picker with no new character selected: ![Before picker state](pr-evidence/issue-1466/before-picker-empty.png) After creating a character, a new conversation picker shows the created character without refresh: ![After created character visible](pr-evidence/issue-1466/after-created-character-visible.png) --- <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:20 +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#5106
No description provided.