Skip to content

CC-50: Single Match Does Not Set Player 1#326

Open
ianpaschal wants to merge 2 commits into
mainfrom
ian/cc-50-single-match-does-not-set-player-1
Open

CC-50: Single Match Does Not Set Player 1#326
ianpaschal wants to merge 2 commits into
mainfrom
ian/cc-50-single-match-does-not-set-player-1

Conversation

@ianpaschal
Copy link
Copy Markdown
Owner

@ianpaschal ianpaschal commented May 12, 2026

Fixes CC-50

Summary by CodeRabbit

Release Notes

  • New Features

    • Current user is now automatically assigned as Player 0 when creating a new match result
  • Improvements

    • Enhanced read-only field controls for player inputs with context-aware behavior
    • Player identity badges now properly disable linking when player data is unavailable

Review Change Stack

@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
combat-command Ready Ready Preview, Comment May 12, 2026 7:25pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 88de1f94-3ed6-4664-9b1a-6ffbd07ec886

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

This PR refactors how match result player read-only state is managed. Previously, the PlayerField leaf component computed its own read-only status based on authentication context. Now, parent components explicitly compute and pass down a playerReadOnly prop through the component hierarchy. The MatchResultForm determines when players should be read-only and passes the flag to game-system-specific implementations, which forward it to PlayerField. A separate change updates IdentityBadge components to conditionally disable navigation links when player data is unavailable.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly references the issue (CC-50) and accurately describes the main change: handling single match player initialization. It clearly summarizes the primary modification across the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ian/cc-50-single-match-does-not-set-player-1

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@src/components/MatchResultForm/MatchResultForm.tsx`:
- Around line 64-67: isSingleMatch and singleMatchDefaults are derived only from
incoming props (existingValues/forcedValues), so playerReadOnly for Player 0
remains true after the user changes the in-form tournament pairing; update the
logic to derive single-match state from the live form selection instead of just
props. Specifically, replace or augment uses of isSingleMatch (and
singleMatchDefaults) with a calculation that inspects the current form value for
tournamentPairingId (e.g. use the form's values or watch('tournamentPairingId'))
so playerReadOnly and defaults reflect live selection; apply the same change to
the other occurrence referenced around the 189-195 block (the other place
computing single-match/read-only state).
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5fd727d0-6c58-4977-94af-355f2db7a64c

📥 Commits

Reviewing files that changed from the base of the PR and between d5ceda5 and c7e5c99.

📒 Files selected for processing (6)
  • src/components/MatchResultForm/MatchResultForm.tsx
  • src/components/MatchResultForm/components/MatchResultPlayerFields/MatchResultPlayerFields.tsx
  • src/components/MatchResultForm/components/MatchResultPlayerFields/gameSystems/FlamesOfWarV4MatchResultPlayerFields/FlamesOfWarV4MatchResultPlayerFields.tsx
  • src/components/MatchResultForm/components/MatchResultPlayerFields/gameSystems/TeamYankeeV2MatchResultPlayerFields/TeamYankeeV2MatchResultPlayerFields.tsx
  • src/components/MatchResultForm/components/PlayerField/PlayerField.tsx
  • src/components/MatchResultPlayers/MatchResultPlayers.tsx

Comment thread src/components/MatchResultForm/MatchResultForm.tsx Outdated
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