[PR #1379] [MERGED] Fix legacy HUD starting values #5049

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

📋 Pull Request Information

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

Base: refactor ← Head: fix/refactor-issue-1365-hud-starting-value


📝 Commits (1)

  • 4c20e10 Fix legacy HUD starting values

📊 Changes

3 files changed (+78 additions, -14 deletions)

View changed files

📝 src/engine/contracts/types/game.ts (+3 -0)
📝 src/features/modes/game/components/GameWidgetPanel.tsx (+48 -14)
📝 src/features/modes/game/hooks/use-game.ts (+27 -0)

📄 Description

Linked issue

Closes #1365

Why this change

  • Refactor Game HUD widgets lost the legacy startingValue path used by numeric widgets, so older/imported configs could render or edit as empty/default instead of using their intended initial values.

What changed

  • Restored startingValue on the shared HUD widget config contract.
  • Hydrate numeric HUD widgets from value ?? startingValue ?? 0 during game-state sync, while preserving current runtime value when present.
  • Updated numeric widget display and editing to fall back to startingValue, and to sync edited starting values during initial session prep.

Refactor impact

Primary owner:

  • Game mode

Impact areas reviewed:

  • HUD widget contract
  • Game metadata sync
  • HUD widget panel/editor

Boundary notes:

  • No server, Rust, storage schema, dependency, remote runtime, or prompt assembly boundaries touched.

Pressure points touched:

  • Game HUD widget rendering/editing and game-state metadata hydration.

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

  • Codex proof: node scratch\issue-1365-starting-value-proof.mjs failed before the fix and passes after the fix.
  • Codex proof: pnpm check passed locally.
  • Codex proof: node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json passed with legacy compatibility rows and negative controls.
  • Manual follow-up: try a legacy/imported game HUD with numeric widgets that only have startingValue, then confirm the first session shows the starting value and editing Review Starting Widgets preserves it.

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

  • Not attached. This fix is covered by source/row compatibility proof and pnpm check; no browser screenshot was captured.

🔄 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/1379 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/27/2026 **Status:** ✅ Merged **Merged:** 5/27/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/refactor-issue-1365-hud-starting-value` --- ### 📝 Commits (1) - [`4c20e10`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4c20e1035a31c259271bd69a5b6ba01b8b753974) Fix legacy HUD starting values ### 📊 Changes **3 files changed** (+78 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `src/engine/contracts/types/game.ts` (+3 -0) 📝 `src/features/modes/game/components/GameWidgetPanel.tsx` (+48 -14) 📝 `src/features/modes/game/hooks/use-game.ts` (+27 -0) </details> ### 📄 Description ## Linked issue Closes #1365 ## Why this change - Refactor Game HUD widgets lost the legacy `startingValue` path used by numeric widgets, so older/imported configs could render or edit as empty/default instead of using their intended initial values. ## What changed - Restored `startingValue` on the shared HUD widget config contract. - Hydrate numeric HUD widgets from `value ?? startingValue ?? 0` during game-state sync, while preserving current runtime `value` when present. - Updated numeric widget display and editing to fall back to `startingValue`, and to sync edited starting values during initial session prep. ## Refactor impact Primary owner: - Game mode Impact areas reviewed: - HUD widget contract - Game metadata sync - HUD widget panel/editor Boundary notes: - No server, Rust, storage schema, dependency, remote runtime, or prompt assembly boundaries touched. Pressure points touched: - Game HUD widget rendering/editing and game-state metadata hydration. ## 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 - Codex proof: `node scratch\issue-1365-starting-value-proof.mjs` failed before the fix and passes after the fix. - Codex proof: `pnpm check` passed locally. - Codex proof: `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json` passed with legacy compatibility rows and negative controls. - Manual follow-up: try a legacy/imported game HUD with numeric widgets that only have `startingValue`, then confirm the first session shows the starting value and editing Review Starting Widgets preserves it. ## 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 - Not attached. This fix is covered by source/row compatibility proof and `pnpm check`; no browser screenshot was captured. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:12: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#5049
No description provided.