[PR #1630] [MERGED] Triage non-GameSurface hook dependency warnings #5161

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

📋 Pull Request Information

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

Base: refactor ← Head: chore/eslint-hooks-deps-triage-2026-05-30


📝 Commits (2)

  • 167b442 Triage non-GameSurface hook dependency warnings
  • e1b0c06 Stabilize roleplay expression avatar sprite data

📊 Changes

9 files changed (+111 additions, -95 deletions)

View changed files

📝 src/app/shell/AppShell.tsx (+11 -5)
📝 src/app/shell/ChatSidebar.tsx (+1 -1)
📝 src/features/catalog/lorebooks/components/LorebookEditor.tsx (+4 -3)
📝 src/features/modes/conversation/hooks/autonomous/use-autonomous-messaging.ts (+52 -49)
📝 src/features/modes/game/components/GameConversationView.tsx (+6 -11)
📝 src/features/modes/game/components/GameNodeMap.tsx (+6 -4)
📝 src/features/modes/roleplay/components/RoleplayModeRoute.tsx (+16 -13)
📝 src/features/modes/shared/chat-ui/hooks/use-chat-metadata-sync.ts (+3 -2)
📝 src/features/runtime/visuals/components/SpriteOverlay.tsx (+12 -7)

📄 Description

Linked issue

Part of #1619

Why this change

  • Continues the React Hooks exhaustive-deps triage by clearing the lower-risk warnings outside the broad GameSurface component.

What changed

  • Captures app-shell and shared metadata refs before cleanup functions use them.
  • Makes chat sidebar, autonomous conversation polling, game conversation pagination, game node-map, lorebook vectorization, roleplay expression-avatar, and sprite overlay hook dependencies explicit.
  • Stabilizes roleplay expression-avatar sprite query data so the sprite map does not recompute just because useQueries returned a fresh result array.
  • Leaves the remaining GameSurface hook warnings for a separate focused branch because that component is a known broad pressure point.

Refactor impact

Primary owner:

React UI hook hygiene across app shell, catalog, chat, roleplay, game, shared mode UI, and runtime visuals

Impact areas reviewed:

  • App shell mobile panel inert cleanup
  • Chat sidebar active-tab sync
  • Conversation autonomous polling and exchange chaining
  • Lorebook vectorization entry memoization
  • Game conversation pagination and node map editing state
  • Roleplay expression-avatar sprite lookup
  • Shared chat metadata background persist cleanup
  • Runtime sprite expression fallback and visible sprite selection

Boundary notes:

  • No engine, shared API, Rust, Tauri command, or remote runtime behavior changed.
  • Mode ownership stays intact: chat/autonomous behavior remains in conversation hooks, roleplay expression avatars stay in roleplay route code, and game UI fixes stay in game components.

Pressure points touched:

  • GameSurface intentionally not touched; its 10 remaining hook warnings stay isolated for the next slice.
  • Shared mode UI touched narrowly in use-chat-metadata-sync.ts for cleanup ref capture 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

  • Verified CodeRabbit nitpick on RoleplayModeRoute: still valid; fixed in commit e1b0c068.
  • pnpm lint:eslint:full-report -- --output .eslint-reports/eslint-full-report-before-hooks-deps.json before the change: 0 errors, 25 warnings across 10 files.
  • pnpm lint:eslint:full-report -- --output .eslint-reports/eslint-full-report-after-hooks-deps-slice-coderabbit.json after the latest fix: 0 errors, 10 warnings across 1 file; all remaining warnings are react-hooks/exhaustive-deps in GameSurface.
  • pnpm lint
  • pnpm typecheck
  • pnpm check:architecture
  • pnpm check:docs
  • pnpm check:unused
  • pnpm test passed: 78 files, 489 tests.
  • pnpm build passed; Vite emitted the existing large-chunk warning.
  • git diff --check passed with the existing CRLF warning for the touched file.

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

No changelog update: this is internal hook-lint cleanup, and this branch does not currently have a CHANGELOG.md file.

UI evidence

N/A; no visible UI changes and no manual app QA was run.

Summary by CodeRabbit

Release Notes

  • Refactor
    • Optimized internal React hooks and component logic across the application for improved performance and maintainability.
    • Enhanced memoization in several components to reduce unnecessary re-renders and improve responsiveness.
    • Improved cleanup routines and dependency tracking in effect hooks to ensure more reliable and predictable component behavior.

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/1630 **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:** `chore/eslint-hooks-deps-triage-2026-05-30` --- ### 📝 Commits (2) - [`167b442`](https://github.com/Pasta-Devs/Marinara-Engine/commit/167b442a8083a0435c2131830d75505074cdd1ed) Triage non-GameSurface hook dependency warnings - [`e1b0c06`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e1b0c068cb29059bacf0b4740da0826eb01dc4ce) Stabilize roleplay expression avatar sprite data ### 📊 Changes **9 files changed** (+111 additions, -95 deletions) <details> <summary>View changed files</summary> 📝 `src/app/shell/AppShell.tsx` (+11 -5) 📝 `src/app/shell/ChatSidebar.tsx` (+1 -1) 📝 `src/features/catalog/lorebooks/components/LorebookEditor.tsx` (+4 -3) 📝 `src/features/modes/conversation/hooks/autonomous/use-autonomous-messaging.ts` (+52 -49) 📝 `src/features/modes/game/components/GameConversationView.tsx` (+6 -11) 📝 `src/features/modes/game/components/GameNodeMap.tsx` (+6 -4) 📝 `src/features/modes/roleplay/components/RoleplayModeRoute.tsx` (+16 -13) 📝 `src/features/modes/shared/chat-ui/hooks/use-chat-metadata-sync.ts` (+3 -2) 📝 `src/features/runtime/visuals/components/SpriteOverlay.tsx` (+12 -7) </details> ### 📄 Description ## Linked issue Part of #1619 ## Why this change - Continues the React Hooks `exhaustive-deps` triage by clearing the lower-risk warnings outside the broad `GameSurface` component. ## What changed - Captures app-shell and shared metadata refs before cleanup functions use them. - Makes chat sidebar, autonomous conversation polling, game conversation pagination, game node-map, lorebook vectorization, roleplay expression-avatar, and sprite overlay hook dependencies explicit. - Stabilizes roleplay expression-avatar sprite query data so the sprite map does not recompute just because `useQueries` returned a fresh result array. - Leaves the remaining `GameSurface` hook warnings for a separate focused branch because that component is a known broad pressure point. ## Refactor impact Primary owner: React UI hook hygiene across app shell, catalog, chat, roleplay, game, shared mode UI, and runtime visuals Impact areas reviewed: - App shell mobile panel inert cleanup - Chat sidebar active-tab sync - Conversation autonomous polling and exchange chaining - Lorebook vectorization entry memoization - Game conversation pagination and node map editing state - Roleplay expression-avatar sprite lookup - Shared chat metadata background persist cleanup - Runtime sprite expression fallback and visible sprite selection Boundary notes: - No engine, shared API, Rust, Tauri command, or remote runtime behavior changed. - Mode ownership stays intact: chat/autonomous behavior remains in conversation hooks, roleplay expression avatars stay in roleplay route code, and game UI fixes stay in game components. Pressure points touched: - `GameSurface` intentionally not touched; its 10 remaining hook warnings stay isolated for the next slice. - Shared mode UI touched narrowly in `use-chat-metadata-sync.ts` for cleanup ref capture only. ## Validation - [x] `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 - Verified CodeRabbit nitpick on `RoleplayModeRoute`: still valid; fixed in commit `e1b0c068`. - `pnpm lint:eslint:full-report -- --output .eslint-reports/eslint-full-report-before-hooks-deps.json` before the change: 0 errors, 25 warnings across 10 files. - `pnpm lint:eslint:full-report -- --output .eslint-reports/eslint-full-report-after-hooks-deps-slice-coderabbit.json` after the latest fix: 0 errors, 10 warnings across 1 file; all remaining warnings are `react-hooks/exhaustive-deps` in `GameSurface`. - `pnpm lint` - `pnpm typecheck` - `pnpm check:architecture` - `pnpm check:docs` - `pnpm check:unused` - `pnpm test` passed: 78 files, 489 tests. - `pnpm build` passed; Vite emitted the existing large-chunk warning. - `git diff --check` passed with the existing CRLF warning for the touched file. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims No changelog update: this is internal hook-lint cleanup, and this branch does not currently have a `CHANGELOG.md` file. ## UI evidence N/A; no visible UI changes and no manual app QA was run. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **Refactor** * Optimized internal React hooks and component logic across the application for improved performance and maintainability. * Enhanced memoization in several components to reduce unnecessary re-renders and improve responsiveness. * Improved cleanup routines and dependency tracking in effect hooks to ensure more reliable and predictable component behavior. <!-- 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/1630?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:51 +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#5161
No description provided.