CC-50: Single Match Does Not Set Player 1#326
Conversation
Fixes CC-50
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis PR refactors how match result player read-only state is managed. Previously, the 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (6)
src/components/MatchResultForm/MatchResultForm.tsxsrc/components/MatchResultForm/components/MatchResultPlayerFields/MatchResultPlayerFields.tsxsrc/components/MatchResultForm/components/MatchResultPlayerFields/gameSystems/FlamesOfWarV4MatchResultPlayerFields/FlamesOfWarV4MatchResultPlayerFields.tsxsrc/components/MatchResultForm/components/MatchResultPlayerFields/gameSystems/TeamYankeeV2MatchResultPlayerFields/TeamYankeeV2MatchResultPlayerFields.tsxsrc/components/MatchResultForm/components/PlayerField/PlayerField.tsxsrc/components/MatchResultPlayers/MatchResultPlayers.tsx
Fixes CC-50
Summary by CodeRabbit
Release Notes
New Features
Improvements