[PR #2337] [MERGED] Fix legacy HUD bottom widgets #5539

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

📋 Pull Request Information

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

Base: refactor ← Head: fix/issue-2152-legacy-hud-bottom


📝 Commits (2)

  • 93a3ec1 Fix legacy HUD bottom widgets
  • aed7860 Handle malformed legacy inventory widgets

📊 Changes

4 files changed (+147 additions, -69 deletions)

View changed files

📝 src/features/modes/game/components/GameSurface.tsx (+2 -1)
📝 src/features/modes/game/hooks/use-game.ts (+1 -68)
➕ src/features/modes/game/lib/hud-widget-normalization.test.ts (+54 -0)
➕ src/features/modes/game/lib/hud-widget-normalization.ts (+90 -0)

📄 Description

Linked issue

Closes #2152

Why this change

  • Legacy persisted game HUD widgets with position: "hud_bottom" were silently hidden on the refactor branch because the rendering panels only accept hud_left and hud_right.

What changed

  • Restored the legacy hud_bottom compatibility remap, alternating those widgets into hud_left and hud_right.
  • Moved existing HUD widget normalization into a pure game helper so sync and render paths share the same behavior.
  • Added a regression test for legacy bottom widgets and for preserving existing left/right widget positions.

Refactor impact

Primary owner:

Game mode

Impact areas reviewed:

  • Game HUD widget metadata sync
  • Game HUD widget rendering
  • Legacy persisted gameWidgetState compatibility

Boundary notes:

  • Feature-layer compatibility normalization only. No engine, shared API, Rust, storage, schema, dependency, or persisted-data migration changes.

Pressure points touched:

  • GameSurface
  • useSyncGameState

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 ran pnpm exec vitest run src/features/modes/game/lib/hud-widget-normalization.test.ts - passed, 1 file / 3 tests.
  • 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.
  • Full visual repro in the Tauri game surface with a real legacy user profile was not run; the core compatibility behavior is covered by static before-proof plus focused normalization regression tests.

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:

  • Compatibility bugfix only; no new user-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

  • Not attached. This draft should stay draft until a reviewer/contributor either accepts the focused compatibility proof or manually opens a legacy game profile with hud_bottom widget metadata in Tauri and confirms the widget appears in a HUD column.

🔄 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/2337 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/5/2026 **Status:** ✅ Merged **Merged:** 6/5/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-2152-legacy-hud-bottom` --- ### 📝 Commits (2) - [`93a3ec1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/93a3ec1cf556827ddd5b235bd12afd03740d3ebf) Fix legacy HUD bottom widgets - [`aed7860`](https://github.com/Pasta-Devs/Marinara-Engine/commit/aed78602d30d23e1eaf93e7393476e8173ae7aef) Handle malformed legacy inventory widgets ### 📊 Changes **4 files changed** (+147 additions, -69 deletions) <details> <summary>View changed files</summary> 📝 `src/features/modes/game/components/GameSurface.tsx` (+2 -1) 📝 `src/features/modes/game/hooks/use-game.ts` (+1 -68) ➕ `src/features/modes/game/lib/hud-widget-normalization.test.ts` (+54 -0) ➕ `src/features/modes/game/lib/hud-widget-normalization.ts` (+90 -0) </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 <!-- Every user-facing PR should reference a feature request or issue report when practical. --> Closes #2152 ## Why this change <!-- What user problem, bug, refactor goal, or maintenance need does this solve? --> - Legacy persisted game HUD widgets with `position: "hud_bottom"` were silently hidden on the refactor branch because the rendering panels only accept `hud_left` and `hud_right`. ## What changed <!-- List the key changes in this PR. --> - Restored the legacy `hud_bottom` compatibility remap, alternating those widgets into `hud_left` and `hud_right`. - Moved existing HUD widget normalization into a pure game helper so sync and render paths share the same behavior. - Added a regression test for legacy bottom widgets and for preserving existing left/right widget positions. ## Refactor impact Primary owner: <!-- Examples: app shell, catalog, chat mode, roleplay mode, game mode, runtime generation, world-state, shared API, engine generation, Rust storage, imports, remote runtime. --> Game mode Impact areas reviewed: - Game HUD widget metadata sync - Game HUD widget rendering - Legacy persisted `gameWidgetState` compatibility Boundary notes: <!-- Note engine/shared-api/feature/Rust/remote-runtime boundaries. Say "none" only if you checked. --> - Feature-layer compatibility normalization only. No engine, shared API, Rust, storage, schema, dependency, or persisted-data migration changes. Pressure points touched: <!-- Mention ModeSurface, GameSurface, shared mode UI, src-tauri/src/lib.rs command registration, or import modules if touched. --> - `GameSurface` - `useSyncGameState` ## 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 <!-- Describe exact commands and manual steps, including typecheck/build/docs/architecture/Rust/browser/remote-runtime checks when they apply. If an AI agent filled this out, verify it yourself before ticking boxes. --> - Codex ran `pnpm exec vitest run src/features/modes/game/lib/hud-widget-normalization.test.ts` - passed, 1 file / 3 tests. - 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. - Full visual repro in the Tauri game surface with a real legacy user profile was not run; the core compatibility behavior is covered by static before-proof plus focused normalization regression tests. ## 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: - Compatibility bugfix only; no new user-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 <!-- Add before/after screenshots or recordings for visible UI changes. --> - Not attached. This draft should stay draft until a reviewer/contributor either accepts the focused compatibility proof or manually opens a legacy game profile with `hud_bottom` widget metadata in Tauri and confirms the widget appears in a HUD column. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:17:11 +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#5539
No description provided.