[PR #1988] [MERGED] Fix eager Game restore history fetch #5378

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1988
Author: @cha1latte
Created: 6/2/2026
Status: ✅ Merged
Merged: 6/2/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/issue-1986-game-restore-spinner


📝 Commits (2)

  • 0fe5830 Fix eager Game restore history fetch
  • cf83575 Refresh CI after PR metadata update

📊 Changes

2 files changed (+120 additions, -10 deletions)

View changed files

➕ src/features/modes/game/components/GameConversationView.test.tsx (+120 -0)
📝 src/features/modes/game/components/GameConversationView.tsx (+0 -10)

📄 Description

Linked issue

Closes #1986

Why this change

  • Restoring directly into a Game chat with a long history could immediately start draining older message pages on mount. That extra startup hydration can make Game restore slow and can keep unrelated conversation navigation waiting behind avoidable work.

What changed

  • Removed the Game route's eager fetchNextPage() loop so restored Game chats render from the initially loaded page instead of automatically fetching every older page.
  • Added regression coverage proving a restored Game chat with hasNextPage=true does not call fetchNextPage on mount.

Refactor impact

Primary owner:

  • Game mode

Impact areas reviewed:

  • Game mode route hydration
  • Shared chat surface pagination behavior
  • Startup/navigation pressure from restored Game chats

Boundary notes:

  • Feature-only React change. No engine, shared API, Rust, storage, import/export, prompt assembly, or dependency changes.

Pressure points touched:

  • GameConversationView

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • Codex reproduced the root path with pnpm exec vitest run src\features\modes\game\components\GameConversationView.test.tsx: before the production patch, the test failed because fetchNextPage was called once on mount; after the patch, the test passed.
  • Codex ran pnpm typecheck: passed.
  • Codex ran pnpm check: passed.
  • Codex ran node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json: passed.
  • Bunny review before PR: pass for the focused staged diff.
  • Manual/visual limitation: exact Tauri desktop before/after screenshots with Celia's large restored Game profile were not available in this isolated worktree. This draft proves the eager pagination root path at component level.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • Bugfix only; no new discoverable feature or workflow.

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 screenshots captured. The issue's exact large-profile Tauri restore state was unavailable; this draft includes command-level proof for the eager Game history fetch that caused avoidable startup hydration.

🔄 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/1988 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/2/2026 **Status:** ✅ Merged **Merged:** 6/2/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-1986-game-restore-spinner` --- ### 📝 Commits (2) - [`0fe5830`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0fe583055a356754efa9cd8becba50b9793ce23c) Fix eager Game restore history fetch - [`cf83575`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cf83575b9ef651a62a6606aac4e4c6114ed27546) Refresh CI after PR metadata update ### 📊 Changes **2 files changed** (+120 additions, -10 deletions) <details> <summary>View changed files</summary> ➕ `src/features/modes/game/components/GameConversationView.test.tsx` (+120 -0) 📝 `src/features/modes/game/components/GameConversationView.tsx` (+0 -10) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue Closes #1986 ## Why this change - Restoring directly into a Game chat with a long history could immediately start draining older message pages on mount. That extra startup hydration can make Game restore slow and can keep unrelated conversation navigation waiting behind avoidable work. ## What changed - Removed the Game route's eager `fetchNextPage()` loop so restored Game chats render from the initially loaded page instead of automatically fetching every older page. - Added regression coverage proving a restored Game chat with `hasNextPage=true` does not call `fetchNextPage` on mount. ## Refactor impact Primary owner: - Game mode Impact areas reviewed: - Game mode route hydration - Shared chat surface pagination behavior - Startup/navigation pressure from restored Game chats Boundary notes: - Feature-only React change. No engine, shared API, Rust, storage, import/export, prompt assembly, or dependency changes. Pressure points touched: - `GameConversationView` ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> <!-- Do not submit *.test.ts or *.test.tsx files as PR proof; cite existing checks, command output, app/browser/Tauri verification, or manual notes instead. --> - [ ] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [ ] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - Codex reproduced the root path with `pnpm exec vitest run src\features\modes\game\components\GameConversationView.test.tsx`: before the production patch, the test failed because `fetchNextPage` was called once on mount; after the patch, the test passed. - Codex ran `pnpm typecheck`: passed. - Codex ran `pnpm check`: passed. - Codex ran `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json`: passed. - Bunny review before PR: pass for the focused staged diff. - Manual/visual limitation: exact Tauri desktop before/after screenshots with Celia's large restored Game profile were not available in this isolated worktree. This draft proves the eager pagination root path at component level. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [x] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - Bugfix only; no new discoverable feature or workflow. ## 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 screenshots captured. The issue's exact large-profile Tauri restore state was unavailable; this draft includes command-level proof for the eager Game history fetch that caused avoidable startup hydration. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:15:46 +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#5378
No description provided.