[PR #5338] [MERGED] fix(game): preserve reusable world map draft options #6733

Closed
opened 2026-10-23 04:13:10 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5338
Author: @SpicyMarinara
Created: 8/20/2026
Status: ✅ Merged
Merged: 8/20/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/5337-world-map-setup-options


📝 Commits (2)

  • ea74977 test(game): define world map setup round-trip
  • 5b6ddc4 fix(game): preserve world map setup options

📊 Changes

6 files changed (+218 additions, -15 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 packages/client/src/components/game/GameSetupWizard.tsx (+17 -12)
📝 packages/client/src/lib/game-setup-share.ts (+76 -3)
📝 packages/server/src/routes/game.routes.ts (+18 -0)
📝 packages/shared/src/types/game.ts (+25 -0)
📝 scripts/regressions/open-issues.regression.ts (+81 -0)

📄 Description

Linked issue

Closes #5337

Why this change

  • Reusable Game Mode setup exports lost the selected World Maps draft size, exact place target, and build-from mode, so importing a setup could silently generate a different map.

What changed

  • Store the three World Maps AI draft choices as optional fields in the existing Game setup contract.
  • Normalize the size bucket from the exact place target during export, import, and server creation so the values cannot disagree.
  • Restore saved choices in New Game and fall back to Game setup with a clear warning when no referenced lorebook can be restored.
  • Include the map draft choices in the readable setup summary and cover legacy defaults, presets, custom targets, grounding modes, and invalid input.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Automated proof run:

  • pnpm check
  • pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/open-issues.regression.ts
  • pnpm --filter @marinara-engine/server lint
  • git diff --check

Manual verification notes

  • Manual browser file-picker verification was not performed. The deterministic regression exercises every preset, a custom target, every grounding mode, invalid values, legacy defaults, summary output, and the unavailable-lorebook fallback.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

The user-facing change is recorded under CHANGELOG.md [Unreleased]; no guide under docs/ changes.

UI evidence (if applicable)

  • Not applicable: this preserves values in existing controls and adds no visual surface.

Summary by CodeRabbit

  • New Features

    • Reusable Game Mode setups now preserve World Map draft size, exact target location count, and lore-grounding settings.
    • World Map setup summaries display the selected size, target count, and grounding source.
    • Imported setups restore and validate supported map configuration options.
  • Improvements

    • Invalid map settings are normalized during import and game creation.
    • If an imported lorebook is unavailable, the setup falls back to setup-based grounding and displays a warning.

🔄 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/5338 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 8/20/2026 **Status:** ✅ Merged **Merged:** 8/20/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/5337-world-map-setup-options` --- ### 📝 Commits (2) - [`ea74977`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ea7497709d299161387c5946d52f726764fb61dc) test(game): define world map setup round-trip - [`5b6ddc4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5b6ddc4edd5f49c95f4ed06d8ef77a0472ed59f7) fix(game): preserve world map setup options ### 📊 Changes **6 files changed** (+218 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `packages/client/src/components/game/GameSetupWizard.tsx` (+17 -12) 📝 `packages/client/src/lib/game-setup-share.ts` (+76 -3) 📝 `packages/server/src/routes/game.routes.ts` (+18 -0) 📝 `packages/shared/src/types/game.ts` (+25 -0) 📝 `scripts/regressions/open-issues.regression.ts` (+81 -0) </details> ### 📄 Description ## Linked issue Closes #5337 ## Why this change - Reusable Game Mode setup exports lost the selected World Maps draft size, exact place target, and build-from mode, so importing a setup could silently generate a different map. ## What changed - Store the three World Maps AI draft choices as optional fields in the existing Game setup contract. - Normalize the size bucket from the exact place target during export, import, and server creation so the values cannot disagree. - Restore saved choices in New Game and fall back to Game setup with a clear warning when no referenced lorebook can be restored. - Include the map draft choices in the readable setup summary and cover legacy defaults, presets, custom targets, grounding modes, and invalid input. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Automated proof run: - `pnpm check` - `pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/open-issues.regression.ts` - `pnpm --filter @marinara-engine/server lint` - `git diff --check` ### Manual verification notes - Manual browser file-picker verification was not performed. The deterministic regression exercises every preset, a custom target, every grounding mode, invalid values, legacy defaults, summary output, and the unavailable-lorebook fallback. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) The user-facing change is recorded under `CHANGELOG.md` `[Unreleased]`; no guide under `docs/` changes. ## UI evidence (if applicable) - Not applicable: this preserves values in existing controls and adds no visual surface. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Reusable Game Mode setups now preserve World Map draft size, exact target location count, and lore-grounding settings. - World Map setup summaries display the selected size, target count, and grounding source. - Imported setups restore and validate supported map configuration options. - **Improvements** - Invalid map settings are normalized during import and game creation. - If an imported lorebook is unavailable, the setup falls back to setup-based grounding and displays a warning. <!-- 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-23 04:13:10 +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#6733
No description provided.