mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #679] [MERGED] fix(game-setup): recover HUD widgets through schema slips and mount prep modal on Start Game #4728
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#4728
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/679
Author: @Romuromylus
Created: 5/11/2026
Status: ✅ Merged
Merged: 5/11/2026
Merged by: @Romuromylus
Base:
main← Head:fix/hud-widget-setup-recovery📝 Commits (2)
3b3b79dfix(game-setup): recover HUD widgets through schema slips and mount prep modal on Start Game891b9dafix(gm-prompts): disambiguate pressureClock current bound wording📊 Changes
3 files changed (+77 additions, -28 deletions)
View changed files
📝
packages/client/src/components/game/GameSurface.tsx(+14 -0)📝
packages/server/src/routes/game.routes.ts(+61 -27)📝
packages/server/src/services/game/gm-prompts.ts(+2 -1)📄 Description
Linked issue
Closes #664
Why this change
Setting up a Game Mode game with Custom HUD Widgets enabled has two related failure modes (originally reported on Discord by
jasonwocky):pressureClocks/factions/questSeeds/encounterPrinciples, or apressureClock.stepsvalue above 12),blueprintSchema.safeParse()rejects the whole payload and theif (parsed.success)branch is a no-op — soupdates.gameBlueprintnever gets persisted and the user's HUD widgets vanish without any log line or UI feedback.handleStartGameRequestsetsprepareInitialWidgetsOpen=trueto openGameWidgetSessionPrepModal, but the modal element is only rendered inside the main game-surface return — thesessionStatus === "ready" && !introPresentedearly-return branch (the Start Game screen itself) never mounts it, so the state flip goes nowhere visible.What changed
packages/server/src/routes/game.routes.ts— wrapped the offendingcampaignPlanfields inz.preprocess(...)to coerce LLM slips into the documented ranges (slice arrays to the max, clampstepsto 1-12 andcurrentto 0-12) instead of rejecting them. Added alogger.warn({ issues }, ...)plus a hudWidgets-only retry parse as a last-ditch recovery so the user keeps their widgets even when the rest of the blueprint is malformed beyond preprocessing.packages/client/src/components/game/GameSurface.tsx— mounted<GameWidgetSessionPrepModal mode="initial">inside thesessionStatus === "ready"early-return branch with the same props the existing main-return instance uses, so the modal can actually open whenhandleStartGameRequestflipsprepareInitialWidgetsOpenon the Start Game screen.packages/server/src/services/game/gm-prompts.ts— tightened thecampaign_structure_ruleswording so the LLM is told the hard caps explicitly (max 2pressureClocks/ 2 factions / 3 quest seeds / 2 encounter principles;pressureClock.steps1-12). Defense in depth: even with the new permissive schema, fewer retries / coercion are needed if the LLM stays in range.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
pressureClocksorpressureClock.steps > 12): widgets should now persist and the warn log should appear in server output if anything still slips past preprocessing.GameWidgetSessionPrepModal(previously the click was a no-op).<GameWidgetSessionPrepModal>instance is untouched, but worth sanity-checking that the two instances don't conflict.Docs and release impact
UI evidence (if applicable)
No visual change to the Start Game screen itself — the fix re-enables the existing prep modal that was already styled in the codebase but unreachable from this branch.
Summary by CodeRabbit
New Features
Improvements
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.