[PR #8121] [MERGED] Add a pluggable combat-style seam to the game surface #8115

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8121
Author: @kolacheee
Created: 10/22/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @kolacheee

Base: staging ← Head: claude/project-thread-71u921


📝 Commits (8)

  • 3d8c63d Add a pluggable combat-style seam to the game surface (#8109)
  • 38db48d Guard and save a style-owned combat start (#8109 review)
  • a77b0bb Merge remote-tracking branch 'origin/staging' into claude/project-thread-71u921
  • 27aa2f9 Merge remote-tracking branch 'origin/staging' into claude/project-thread-71u921
  • 531193a Release the style-start latch and save before entering combat (#8109 review)
  • fa78a7a Treat a party-less save as stale unless its style can report the fight (#8109 review)
  • 20bf09d Merge remote-tracking branch 'origin/staging' into claude/project-thread-71u921
  • aa4a026 Ask the style whether a party-less save is still live (#8109 review)

📊 Changes

10 files changed (+603 additions, -80 deletions)

View changed files

📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+4 -3)
📝 packages/client/src/components/game/GameSetupWizard.tsx (+2 -1)
📝 packages/client/src/components/game/GameSurface.tsx (+144 -71)
➕ packages/client/src/components/game/combat-styles.tsx (+238 -0)
📝 packages/client/src/features/chat-settings/sections/CombatStyleSection.tsx (+8 -0)
📝 packages/server/src/routes/game.routes.ts (+8 -1)
📝 packages/server/src/services/generation/game-gm-prompt-runtime.ts (+2 -1)
📝 packages/shared/src/features/world/game-intro.ts (+3 -1)
📝 packages/shared/src/types/game.ts (+10 -2)
➕ scripts/regressions/combat-style-registry.regression.ts (+184 -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 #8109

Why this change

GameSurface.tsx branched on the closed "classic" | "tactical" union wherever combat touched it: the start of a fight, the battle UI it mounts, the top-chrome offset and the "is a fight on screen" check. There was no seam a combat style could plug into, so adding one meant hand-editing the same 14k-line file in all of those places, which is also where nearly all of the rebase conflicts land for anyone carrying an extra style (see #8109).

What changed

  • New client combat-style registry (packages/client/src/components/game/combat-styles.tsx). A style can provide:
    • start(): return true to take over the start of a fight, which skips the classic generation pass.
    • render(): the battle UI mounted in place of the built-in one.
    • ownsTopChrome: the style draws its own top bar, so the HUD and controls move below --tactical-chrome-height.
    • isActive() / subscribe(): lets a style that keeps its own state (outside the generated party and enemies) count as an active fight, so the map, party and other overlays hide for it like they do for the built-ins.
  • Classic and Tactical are registered through the same seam, with no behavior change. GameSurface now asks the active style instead of naming one. The two built-in UI components are lazy-loaded from the registry, and the director keeps running the built-in styles and a ruleset's own fights as before.
  • GameCombatStyle is now the built-in styles plus any registered id (BUILT_IN_GAME_COMBAT_STYLES in shared). An id the client does not know plays as classic. The game setup route accepts any well-formed style id. Experience setup defaults still name built-in styles only, so the Capability API surface is unchanged.
  • The chat settings combat style picker lists registered styles alongside Classic and Tactical.
  • New regression combat-style-registry.regression.ts covers the registry (built-ins, unknown ids, registering and removing styles) and checks that the surface goes through the seam.

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

Agent-run results: every pnpm check step passes (impeccable, localization, format, lint, e2e/token types, build), with one pre-existing lint warning in HomeProfessorMariChat.tsx. In the full regression run, 1020 of 1024 passed, including the new combat-style-registry. The four that failed are sandbox-only failures in files this PR does not touch: launcher-browser-ready (no IPv6 ::1), capability-server-externals (tmp-dir rmSync), mari-guard-sibling-paths and storage-writer-lock.

Manual verification notes

  • Manually verify a Classic fight starts, draws the menu battle UI, and ends as before.
  • Manually verify a Tactical fight draws the grid, and that the top-right controls and the left HUD row sit below the tactical top bar.
  • Manually verify a fight with the combat director on (Classic, Tactical, and a ruleset fight) still mounts the directed UI.
  • Manually verify that reloading mid-fight restores the same style.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) 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)

UI evidence (if applicable)

No visible change: Classic and Tactical look and behave as before.


🔄 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/8121 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `claude/project-thread-71u921` --- ### 📝 Commits (8) - [`3d8c63d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3d8c63d8a4f55df2c03595bf6796cd7683218dec) Add a pluggable combat-style seam to the game surface (#8109) - [`38db48d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/38db48dc7b6739cc786e9fbb0e2c97f32291b61f) Guard and save a style-owned combat start (#8109 review) - [`a77b0bb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a77b0bb15e78f601f4b392516ece1c94507e97a0) Merge remote-tracking branch 'origin/staging' into claude/project-thread-71u921 - [`27aa2f9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/27aa2f9e461ccd5aee1c134e41679844e061502c) Merge remote-tracking branch 'origin/staging' into claude/project-thread-71u921 - [`531193a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/531193a7b97480bb60cfa308c87aed8248f5c834) Release the style-start latch and save before entering combat (#8109 review) - [`fa78a7a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/fa78a7ae492b2389a6704a33193e1bea4f5d44aa) Treat a party-less save as stale unless its style can report the fight (#8109 review) - [`20bf09d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/20bf09d3e9a0157c59ee36667784c42fe97b2d0b) Merge remote-tracking branch 'origin/staging' into claude/project-thread-71u921 - [`aa4a026`](https://github.com/Pasta-Devs/Marinara-Engine/commit/aa4a026cda453b373fc7a0d27950871b539a944a) Ask the style whether a party-less save is still live (#8109 review) ### 📊 Changes **10 files changed** (+603 additions, -80 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+4 -3) 📝 `packages/client/src/components/game/GameSetupWizard.tsx` (+2 -1) 📝 `packages/client/src/components/game/GameSurface.tsx` (+144 -71) ➕ `packages/client/src/components/game/combat-styles.tsx` (+238 -0) 📝 `packages/client/src/features/chat-settings/sections/CombatStyleSection.tsx` (+8 -0) 📝 `packages/server/src/routes/game.routes.ts` (+8 -1) 📝 `packages/server/src/services/generation/game-gm-prompt-runtime.ts` (+2 -1) 📝 `packages/shared/src/features/world/game-intro.ts` (+3 -1) 📝 `packages/shared/src/types/game.ts` (+10 -2) ➕ `scripts/regressions/combat-style-registry.regression.ts` (+184 -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 #8109 ## Why this change `GameSurface.tsx` branched on the closed `"classic" | "tactical"` union wherever combat touched it: the start of a fight, the battle UI it mounts, the top-chrome offset and the "is a fight on screen" check. There was no seam a combat style could plug into, so adding one meant hand-editing the same 14k-line file in all of those places, which is also where nearly all of the rebase conflicts land for anyone carrying an extra style (see #8109). ## What changed - New client combat-style registry (`packages/client/src/components/game/combat-styles.tsx`). A style can provide: - `start()`: return true to take over the start of a fight, which skips the classic generation pass. - `render()`: the battle UI mounted in place of the built-in one. - `ownsTopChrome`: the style draws its own top bar, so the HUD and controls move below `--tactical-chrome-height`. - `isActive()` / `subscribe()`: lets a style that keeps its own state (outside the generated party and enemies) count as an active fight, so the map, party and other overlays hide for it like they do for the built-ins. - Classic and Tactical are registered through the same seam, with no behavior change. `GameSurface` now asks the active style instead of naming one. The two built-in UI components are lazy-loaded from the registry, and the director keeps running the built-in styles and a ruleset's own fights as before. - `GameCombatStyle` is now the built-in styles plus any registered id (`BUILT_IN_GAME_COMBAT_STYLES` in shared). An id the client does not know plays as classic. The game setup route accepts any well-formed style id. Experience setup defaults still name built-in styles only, so the Capability API surface is unchanged. - The chat settings combat style picker lists registered styles alongside Classic and Tactical. - New regression `combat-style-registry.regression.ts` covers the registry (built-ins, unknown ids, registering and removing styles) and checks that the surface goes through the seam. ## 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` Agent-run results: every `pnpm check` step passes (impeccable, localization, format, lint, e2e/token types, build), with one pre-existing lint warning in `HomeProfessorMariChat.tsx`. In the full regression run, 1020 of 1024 passed, including the new `combat-style-registry`. The four that failed are sandbox-only failures in files this PR does not touch: `launcher-browser-ready` (no IPv6 `::1`), `capability-server-externals` (tmp-dir `rmSync`), `mari-guard-sibling-paths` and `storage-writer-lock`. ### Manual verification notes - Manually verify a Classic fight starts, draws the menu battle UI, and ends as before. - Manually verify a Tactical fight draws the grid, and that the top-right controls and the left HUD row sit below the tactical top bar. - Manually verify a fight with the combat director on (Classic, Tactical, and a ruleset fight) still mounts the directed UI. - Manually verify that reloading mid-fight restores the same style. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) 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) ## UI evidence (if applicable) No visible change: Classic and Tactical look and behave as before. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:10:30 +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#8115
No description provided.