Skip to content

CC-39: Setting Player Faction Breaks Flexible Alignment#320

Merged
ianpaschal merged 2 commits into
mainfrom
ian/cc-39-setting-player-faction-breaks-flexible-alignment
Apr 29, 2026
Merged

CC-39: Setting Player Faction Breaks Flexible Alignment#320
ianpaschal merged 2 commits into
mainfrom
ian/cc-39-setting-player-faction-breaks-flexible-alignment

Conversation

@ianpaschal
Copy link
Copy Markdown
Owner

@ianpaschal ianpaschal commented Apr 29, 2026

Fixes CC-39

This is a temporary fix to replace the functionality lost by removing the clearable prop from <Select/>. Long term it should be replaced by creating dummy lists which later have files attached.

Summary by CodeRabbit

Release Notes

  • Style

    • Improved layout of tournament registration form details section.
  • New Features

    • Added ability to clear alignment and faction selections with a dedicated button.
    • Added "Undecided" options for alignment and faction fields.
    • Enhanced messaging to indicate when alignment selection is required.

Fixes CC-39

This is a temporary fix to replace the functionality lost by removing the `clearable` prop from `<Select/>`. Long term it should be replaced by creating dummy lists which later have files attached.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 29, 2026

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

Project Deployment Actions Updated (UTC)
combat-command Ready Ready Preview, Comment Apr 29, 2026 6:07pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 29, 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: 9f277f59-1ae1-4d63-9b2b-81c8707c7f7a

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:

  • ✅ Review completed - (🔄 Check again to review again)

Walkthrough

This change updates the tournament registration form's details fields component. The .FactionFields CSS class transitions from a flexbox column layout to an explicit CSS Grid with two columns (1fr auto) and defined gaps, aligning content to the bottom. The React component adds imports for button and icon elements, introduces "Undecided" options for both alignment and faction fields, and includes conditional rendering of a required alignment message. Clear buttons (X icons) are added to allow users to reset their alignment and faction selections to null, with the "Undecided" alignment option disabled when alignment is marked as required.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description lacks required template sections. The template requires 'Resolves: #???' but the description only mentions 'Fixes CC-39' without a GitHub issue reference, and omits the required dashes separator. Update description to follow the template: include 'Resolves: #320' at the top and add the dashes separator before the explanation.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly references the ticket (CC-39) and clearly describes the main change: fixing an issue where setting player faction breaks flexible alignment.
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-39-setting-player-faction-breaks-flexible-alignment

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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@src/components/TournamentRegistrationForm/components/DetailsFields/DetailsFields.tsx`:
- Around line 78-84: The alignment clear button still calls
setValue('details.alignment', null) even when editing is disabled by
declaredFaction, which can leave alignment null while the selector is
uneditable; update the Button (the X icon's onClick) to be disabled or no-op
when declaredFaction is truthy (or hide the Button) so it cannot clear the field
while declaredFaction disables the Select—target the Button component and the
setValue('details.alignment', null) invocation and guard it with the
declaredFaction condition.
- Around line 61-68: The factionRequired boolean is using the wrong registration
flag—replace tournament.registrationDetails?.alignment with the faction-specific
flag (e.g., tournament.registrationDetails?.faction === 'required' or the
correct property name used in your model) so factionRequired reflects the
faction setting; update the computation of factionRequired and ensure
factionOptions (and its disabled: factionRequired) uses this corrected variable
(check functions/props around factionOptions and getFactionOptions() to confirm
the exact property name).
🪄 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: d27008fc-72ca-42cf-bd8e-25876ce9492f

📥 Commits

Reviewing files that changed from the base of the PR and between ce44838 and dd69be0.

📒 Files selected for processing (2)
  • src/components/TournamentRegistrationForm/components/DetailsFields/DetailsFields.module.scss
  • src/components/TournamentRegistrationForm/components/DetailsFields/DetailsFields.tsx

@ianpaschal ianpaschal merged commit 99f1901 into main Apr 29, 2026
3 checks passed
@ianpaschal ianpaschal deleted the ian/cc-39-setting-player-faction-breaks-flexible-alignment branch April 29, 2026 18:15
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