[PR #4784] [MERGED] feat: add custom New Game AI map target #6497

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4784
Author: @thetopham
Created: 8/9/2026
Status: ✅ Merged
Merged: 8/9/2026
Merged by: @thetopham

Base: staging ← Head: agent/4783-new-game-ai-map-target


📝 Commits (1)

  • d6bbe3a feat: add custom New Game AI map target

📊 Changes

6 files changed (+119 additions, -10 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 packages/client/src/components/game/GameSetupWizard.tsx (+97 -10)
📝 packages/client/src/components/game/GameSurface.tsx (+2 -0)
📝 packages/client/src/hooks/use-spatial-context.ts (+2 -0)
📝 packages/client/src/localization/locales/en.json (+2 -0)
📝 scripts/regressions/open-issues.regression.ts (+15 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #4783

Why this change

New Game's Draft with AI map setup exposes only the Small, Medium, and Large presets even though World Maps supports the exact targetLocationCount parameter added by Pasta-Devs/Marinara-Agents#281. Users should be able to choose an exact initial place target without leaving New Game setup.

What changed

  • Added a custom whole-number place target from 1 to 40 alongside the existing 8, 16, and 28 place presets.
  • Kept custom and preset selections synchronized and derived the compatible Small, Medium, or Large size bucket.
  • Blocked game start for blank, fractional, or otherwise invalid custom targets.
  • Forwarded the exact targetLocationCount through the post-setup map plan to World Maps draft generation.
  • Added English localization, regression coverage, and an Unreleased changelog entry.

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 evidence recorded by Codex:

  • pnpm check passed locally.
  • pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/open-issues.regression.ts passed.
  • pnpm smoke:ui completed with 201 passed, 100 skipped, and 5 failures outside this change; the relevant desktop Game setup coverage passed.
  • git diff --check passed.

Manual verification notes

  • Manually verify Small, Medium, and Large set the custom target to 8, 16, and 28.
  • Manually enter a custom target such as 23 and verify the generated World Map receives the exact target.
  • Manually verify blank, fractional, zero, and values above 40 cannot start the game.
  • Manually verify the control and validation state in light and dark themes at desktop and mobile widths.

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] <paths> follow-up issue opened
  • Version/release files updated (only if this PR includes a version bump)

The Unreleased changelog is updated. No user-facing documentation or version metadata changes are required.

UI evidence (if applicable)

Pending human browser review; no screenshots or recordings are attached yet.

Summary by CodeRabbit

  • New Features
    • Added customizable AI world-map targets in the New Game wizard.
    • Choose a preset map size or enter a whole-number target from 1–40.
    • The selected target count is preserved through setup and map generation.
  • Bug Fixes
    • Added validation and localized feedback for invalid target counts.
    • Imported game setups now correctly reset custom map-count settings.

🔄 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/4784 **Author:** [@thetopham](https://github.com/thetopham) **Created:** 8/9/2026 **Status:** ✅ Merged **Merged:** 8/9/2026 **Merged by:** [@thetopham](https://github.com/thetopham) **Base:** `staging` ← **Head:** `agent/4783-new-game-ai-map-target` --- ### 📝 Commits (1) - [`d6bbe3a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d6bbe3a81ba1258996f795b5a0f390b4e559c6bb) feat: add custom New Game AI map target ### 📊 Changes **6 files changed** (+119 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `packages/client/src/components/game/GameSetupWizard.tsx` (+97 -10) 📝 `packages/client/src/components/game/GameSurface.tsx` (+2 -0) 📝 `packages/client/src/hooks/use-spatial-context.ts` (+2 -0) 📝 `packages/client/src/localization/locales/en.json` (+2 -0) 📝 `scripts/regressions/open-issues.regression.ts` (+15 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #4783 ## Why this change New Game's **Draft with AI** map setup exposes only the Small, Medium, and Large presets even though World Maps supports the exact `targetLocationCount` parameter added by Pasta-Devs/Marinara-Agents#281. Users should be able to choose an exact initial place target without leaving New Game setup. ## What changed - Added a custom whole-number place target from 1 to 40 alongside the existing 8, 16, and 28 place presets. - Kept custom and preset selections synchronized and derived the compatible Small, Medium, or Large size bucket. - Blocked game start for blank, fractional, or otherwise invalid custom targets. - Forwarded the exact `targetLocationCount` through the post-setup map plan to World Maps draft generation. - Added English localization, regression coverage, and an Unreleased changelog entry. ## Validation - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [x] 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 evidence recorded by Codex: - `pnpm check` passed locally. - `pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/open-issues.regression.ts` passed. - `pnpm smoke:ui` completed with 201 passed, 100 skipped, and 5 failures outside this change; the relevant desktop Game setup coverage passed. - `git diff --check` passed. ### Manual verification notes - [ ] Manually verify Small, Medium, and Large set the custom target to 8, 16, and 28. - [ ] Manually enter a custom target such as 23 and verify the generated World Map receives the exact target. - [ ] Manually verify blank, fractional, zero, and values above 40 cannot start the game. - [ ] Manually verify the control and validation state in light and dark themes at desktop and mobile widths. ## Docs and release impact - [x] 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] <paths>` follow-up issue opened - [ ] Version/release files updated (only if this PR includes a version bump) The Unreleased changelog is updated. No user-facing documentation or version metadata changes are required. ## UI evidence (if applicable) Pending human browser review; no screenshots or recordings are attached yet. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added customizable AI world-map targets in the New Game wizard. * Choose a preset map size or enter a whole-number target from 1–40. * The selected target count is preserved through setup and map generation. * **Bug Fixes** * Added validation and localized feedback for invalid target counts. * Imported game setups now correctly reset custom map-count settings. <!-- 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:10:59 +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#6497
No description provided.