[PR #1774] [MERGED] Type game DTO handoffs #5276

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1774
Author: @Xelvanis
Created: 6/1/2026
Status: ✅ Merged
Merged: 6/1/2026
Merged by: @Xelvanis

Base: refactor ← Head: chore/game-dto-types


📝 Commits (2)

  • e4d01a1 Type game DTO handoffs
  • 5d086d1 Log invalid weather season fallback

📊 Changes

3 files changed (+43 additions, -12 deletions)

View changed files

📝 src/features/modes/game/api/game-api.ts (+27 -7)
📝 src/features/modes/game/components/GameSurface.tsx (+7 -1)
📝 src/features/modes/game/hooks/use-game.ts (+9 -4)

📄 Description

Linked issue

N/A

Why this change

  • Continues the explicit-any cleanup chore by narrowing game-mode DTO and asset-map handoffs.

What changed

  • Typed game character RPG attribute mapping inputs instead of passing an untyped array.
  • Typed combat round handoff data and player actions at the game API boundary.
  • Added a weather season guard before calling the weather generator.
  • Typed legacy inventory widget normalization, NPC store handoffs, and inline scene asset maps.

Refactor impact

Primary owner:

game mode

Impact areas reviewed:

  • Game API DTO handoffs
  • Game hook metadata/store sync
  • GameSurface inline asset/audio tag processing

Boundary notes:

  • Feature-layer game code still calls existing game-owned hooks/APIs and React-free engine services through existing imports.
  • No shared API, Rust, remote runtime, storage schema, or cross-mode boundary changes.

Pressure points touched:

  • GameSurface: type-only annotation for inline tag asset map.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • pnpm check passes locally before PR push/handoff, including the unused-code check
  • 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
  • Browser screenshot/recording evidence added when UI/browser state is the claim
  • Remote runtime smoke checked when relevant

Manual verification notes

  • pnpm check passed locally.
  • Focused game explicit-any grep now only hits prompt prose.
  • No browser or Tauri manual QA run; this is a type-only cleanup.

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:

  • Type-only internal cleanup; no user-discoverable feature changed.

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

  • N/A; no visible UI change.

Summary by CodeRabbit

  • Refactor
    • Enhanced type safety across game API and component modules by replacing generic type casting with proper typed declarations, improving code reliability and maintainability.

🔄 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/1774 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 6/1/2026 **Status:** ✅ Merged **Merged:** 6/1/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `chore/game-dto-types` --- ### 📝 Commits (2) - [`e4d01a1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e4d01a1205c8d4a38660a2c3c5deaa48bf8c35ed) Type game DTO handoffs - [`5d086d1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5d086d1a1a5616ae4fb8d2b863b6370034dd4b90) Log invalid weather season fallback ### 📊 Changes **3 files changed** (+43 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `src/features/modes/game/api/game-api.ts` (+27 -7) 📝 `src/features/modes/game/components/GameSurface.tsx` (+7 -1) 📝 `src/features/modes/game/hooks/use-game.ts` (+9 -4) </details> ### 📄 Description ## Linked issue N/A ## Why this change - Continues the explicit-any cleanup chore by narrowing game-mode DTO and asset-map handoffs. ## What changed - Typed game character RPG attribute mapping inputs instead of passing an untyped array. - Typed combat round handoff data and player actions at the game API boundary. - Added a weather season guard before calling the weather generator. - Typed legacy inventory widget normalization, NPC store handoffs, and inline scene asset maps. ## Refactor impact Primary owner: game mode Impact areas reviewed: - Game API DTO handoffs - Game hook metadata/store sync - GameSurface inline asset/audio tag processing Boundary notes: - Feature-layer game code still calls existing game-owned hooks/APIs and React-free engine services through existing imports. - No shared API, Rust, remote runtime, storage schema, or cross-mode boundary changes. Pressure points touched: - GameSurface: type-only annotation for inline tag asset map. ## Validation - [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] `pnpm check` passes locally before PR push/handoff, including the unused-code check - [x] `pnpm typecheck` passes locally - [x] `pnpm build` passes locally - [x] `pnpm check:architecture` passes locally - [x] `pnpm check:docs` passes locally - [x] `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 - [ ] Browser screenshot/recording evidence added when UI/browser state is the claim - [ ] Remote runtime smoke checked when relevant ### Manual verification notes - `pnpm check` passed locally. - Focused game explicit-any grep now only hits prompt prose. - No browser or Tauri manual QA run; this is a type-only cleanup. ## 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: - Type-only internal cleanup; no user-discoverable feature changed. ## 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 ## UI evidence - N/A; no visible UI change. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Enhanced type safety across game API and component modules by replacing generic type casting with proper typed declarations, improving code reliability and maintainability. <!-- 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:14: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#5276
No description provided.