Skip to content

feat: select untap choices on battlefield - #6936

Merged
matthewevans merged 4 commits into
mainfrom
ship/select-untap-choices-on-battlefield
Aug 2, 2026
Merged

feat: select untap choices on battlefield#6936
matthewevans merged 4 commits into
mainfrom
ship/select-untap-choices-on-battlefield

Conversation

@matthewevans

@matthewevans matthewevans commented Aug 2, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Added interactive untap choices directly on the game board, including “Untap” and “Keep tapped” actions.
    • Untap selections support delegated turn authority and collapsed card groups.
    • Multiplayer boards temporarily use split layout during untap decisions for clearer interaction.
  • Bug Fixes

    • Improved board-choice overlays, button states, and confirmation styling.
    • Added localized untap labels across supported languages.
  • Tests

    • Expanded coverage for untap selection, skipping, delegated actions, and board layouts.

@matthewevans
matthewevans enabled auto-merge August 2, 2026 19:37
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@matthewevans, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 21 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 04dd6e0b-9dba-40f6-8814-dfbb6fc7253c

📥 Commits

Reviewing files that changed from the base of the PR and between 97ce0c5 and 55ea6cf.

📒 Files selected for processing (1)
  • client/src/components/modal/CardChoiceModal.tsx
📝 Walkthrough

Walkthrough

The change adds untap board-choice support, routes untap prompts through native board interactions, enables delegated waiting-state authorization, and propagates an effective multiplayer layout through board-rendering components.

Changes

Untap board-choice experience

Layer / File(s) Summary
Untap board-choice mapping
client/src/viewmodel/gameStateView.ts, client/src/viewmodel/__tests__/gameStateView.test.ts, client/src/test/factories/gameStateFactory.ts
Adds untap intents, responses, waiting-state mappings, selection bounds, skip behavior, action construction, factories, and tests.
Effective multiplayer layout plumbing
client/src/pages/GamePage.tsx, client/src/pages/ReplayPage.tsx, client/src/components/board/*, client/src/components/stack/StackDisplay.tsx, client/src/pages/__tests__/GamePage.bracketViolation.test.tsx
Derives an effective layout during multiplayer untap choices and passes it to board, stack, combat-line, and replay components.
Board untap interaction authorization
client/src/components/board/GroupedPermanent.tsx, client/src/components/board/PermanentCard.tsx, client/src/components/board/__tests__/*
Uses waiting-state authorization for untap selection, adds untap visual styling, and tests delegated and authorized ChooseUntap dispatches.
Native untap prompts and presentation
client/src/components/modal/*, client/src/components/targeting/*, client/src/i18n/locales/*/game.json, client/src/pages/GamePage.tsx
Removes the subset modal, makes untap dialogs click-through, updates overlay labels and styling, removes the obsolete modal path, and adds translations.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GamePage
  participant GameStateView
  participant NativeBoard
  participant GameEngine
  GamePage->>GameStateView: map untap waiting state
  GameStateView->>NativeBoard: expose untap candidate and skip action
  NativeBoard->>GameEngine: dispatch ChooseUntap
  GameEngine-->>GamePage: update waiting state
Loading

Possibly related PRs

  • phase-rs/phase#6675: Both changes modify GamePage.tsx and GamePage.bracketViolation.test.tsx for mode-dependent UI behavior.

Suggested labels: feature

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding battlefield support for selecting untap choices.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ship/select-untap-choices-on-battlefield

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@client/src/pages/GamePage.tsx`:
- Around line 964-970: Extend the colocated BlockAssignmentLines/layout
regression tests to cover the branch computing effectiveMultiplayerBoardLayout:
add a three-or-more-player waiting untap-choice case that verifies forced
"split" visibility, plus a non-untap control case that continues using the
stored multiplayerBoardLayout preference. Keep the existing focused-layout
coverage unchanged.

In `@client/src/viewmodel/gameStateView.ts`:
- Around line 447-455: Update the UntapChoice handling around
waitingFor.data.candidates to expose every candidate in objectIds instead of
selecting candidates[0]. Build the ChooseUntap response and affirmative action
from the selected object ID, preserving the existing false/skip behavior; update
the related test to verify selecting the second candidate. Keep game-data
interpretation out of the client/src display layer.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 741175ae-55d1-4812-b3d3-1f7c07411bf3

📥 Commits

Reviewing files that changed from the base of the PR and between b657ac0 and 2618726.

📒 Files selected for processing (28)
  • client/src/components/board/AttackTargetLines.tsx
  • client/src/components/board/BlockAssignmentLines.tsx
  • client/src/components/board/GameBoard.tsx
  • client/src/components/board/GroupedPermanent.tsx
  • client/src/components/board/PermanentCard.tsx
  • client/src/components/board/__tests__/BlockAssignmentLines.test.tsx
  • client/src/components/board/__tests__/GameBoard.test.tsx
  • client/src/components/board/__tests__/GroupedPermanent.test.tsx
  • client/src/components/board/__tests__/PermanentCard.test.tsx
  • client/src/components/modal/CardChoiceModal.tsx
  • client/src/components/modal/DialogHost.tsx
  • client/src/components/modal/__tests__/ChooseUntapSubsetModal.test.tsx
  • client/src/components/modal/__tests__/DialogHost.test.tsx
  • client/src/components/modal/__tests__/DiscardCostModal.test.tsx
  • client/src/components/stack/StackDisplay.tsx
  • client/src/components/targeting/TargetingOverlay.tsx
  • client/src/components/targeting/__tests__/TargetingOverlay.test.tsx
  • client/src/i18n/locales/de/game.json
  • client/src/i18n/locales/en/game.json
  • client/src/i18n/locales/es/game.json
  • client/src/i18n/locales/fr/game.json
  • client/src/i18n/locales/it/game.json
  • client/src/i18n/locales/pl/game.json
  • client/src/i18n/locales/pt/game.json
  • client/src/pages/GamePage.tsx
  • client/src/pages/ReplayPage.tsx
  • client/src/viewmodel/__tests__/gameStateView.test.ts
  • client/src/viewmodel/gameStateView.ts
💤 Files with no reviewable changes (1)
  • client/src/components/modal/tests/ChooseUntapSubsetModal.test.tsx

Comment thread client/src/pages/GamePage.tsx
Comment thread client/src/viewmodel/gameStateView.ts
@matthewevans

Copy link
Copy Markdown
Member Author

Addressed CodeRabbit feedback:

  • Added GamePage coverage proving an authorized 3-player UntapChoice forces the transient split layout, while a non-untap Priority state retains the persisted focused layout.
  • Kept UntapChoice limited to candidates[0]: the engine resolves this prompt sequentially, publishing the next candidate only after the current ChooseUntap response. Exposing all candidates in the client would allow selection of a future engine decision, so the board projection intentionally preserves the one-at-a-time contract.

@matthewevans
matthewevans force-pushed the ship/select-untap-choices-on-battlefield branch from 7677f13 to 97ce0c5 Compare August 2, 2026 20:13
@matthewevans
matthewevans added this pull request to the merge queue Aug 2, 2026
Merged via the queue into main with commit 28d744a Aug 2, 2026
14 checks passed
@matthewevans
matthewevans deleted the ship/select-untap-choices-on-battlefield branch August 2, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant