[PR #2120] [MERGED] Scope game media runtime by game id #5446

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2120
Author: @Promansis
Created: 6/4/2026
Status: ✅ Merged
Merged: 6/4/2026
Merged by: @Promansis

Base: refactor ← Head: fix/2107-game-media-scope


📝 Commits (1)

  • 13520a2 Scope game media runtime by game id

📊 Changes

1 file changed (+26 additions, -19 deletions)

View changed files

📝 src/features/modes/game/components/GameSurface.tsx (+26 -19)

📄 Description

Linked issue

Closes #2107

Why this change

  • Same-chat game replacement could keep scene media/background runtime state scoped only to the chat id, allowing stale backgrounds, playback state, restore flags, and scene readiness to leak across game identities.

What changed

  • Added a scene runtime scope key based on activeChatId and chatMeta.gameId.
  • Used that scope key for game runtime reset, media playback reset, intro presentation storage, scene restore effect dependencies, and the last resolved background cache.
  • Reused the same scoped game id for existing session operations instead of re-reading raw metadata later.

Refactor impact

Primary owner:

Game mode runtime visuals/media.

Impact areas reviewed:

  • GameSurface scene media/background reset behavior.
  • Scene restore refs and pending readiness refs.
  • Last resolved background cache during scene preparation.

Boundary notes:

  • Stays inside React game-mode feature code.
  • No engine, shared API, Rust, storage, or remote-runtime boundary changes.

Pressure points touched:

  • GameSurface only.

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

  • pnpm typecheck passed.
  • git diff --check passed.
  • Static review confirmed the reset/cache paths now depend on sceneRuntimeScopeKey rather than activeChatId alone.

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 visible layout change. Runtime behavior change is scoped to same-chat game identity replacement.


🔄 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/2120 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 6/4/2026 **Status:** ✅ Merged **Merged:** 6/4/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `refactor` ← **Head:** `fix/2107-game-media-scope` --- ### 📝 Commits (1) - [`13520a2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/13520a2c8f6278208c775d76fcfd7556212d9c01) Scope game media runtime by game id ### 📊 Changes **1 file changed** (+26 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `src/features/modes/game/components/GameSurface.tsx` (+26 -19) </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 #2107 ## Why this change - Same-chat game replacement could keep scene media/background runtime state scoped only to the chat id, allowing stale backgrounds, playback state, restore flags, and scene readiness to leak across game identities. ## What changed - Added a scene runtime scope key based on `activeChatId` and `chatMeta.gameId`. - Used that scope key for game runtime reset, media playback reset, intro presentation storage, scene restore effect dependencies, and the last resolved background cache. - Reused the same scoped game id for existing session operations instead of re-reading raw metadata later. ## Refactor impact Primary owner: Game mode runtime visuals/media. Impact areas reviewed: - `GameSurface` scene media/background reset behavior. - Scene restore refs and pending readiness refs. - Last resolved background cache during scene preparation. Boundary notes: - Stays inside React game-mode feature code. - No engine, shared API, Rust, storage, or remote-runtime boundary changes. Pressure points touched: - `GameSurface` only. ## 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. --> - [x] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [x] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - `pnpm typecheck` passed. - `git diff --check` passed. - Static review confirmed the reset/cache paths now depend on `sceneRuntimeScopeKey` rather than `activeChatId` alone. ## 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 - [x] 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 layout change. Runtime behavior change is scoped to same-chat game identity replacement. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:16:24 +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#5446
No description provided.