[codex] improve division capacity editing#509
Conversation
|
Warning Review limit reached
More reviews will be available in 50 minutes and 55 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the 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 credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. 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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ 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.
3 issues found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/wodsmith-start/src/components/divisions/organizer-division-item.tsx">
<violation number="1" location="apps/wodsmith-start/src/components/divisions/organizer-division-item.tsx:307">
P2: Pressing Enter in the division name field triggers `onLabelSave` twice (keydown + blur), causing duplicate save requests.</violation>
</file>
<file name="apps/wodsmith-start/src/components/divisions/organizer-division-manager.tsx">
<violation number="1" location="apps/wodsmith-start/src/components/divisions/organizer-division-manager.tsx:237">
P1: Team-size no-op guard compares against stale `initialDivisions`, which can block legitimate updates after prior optimistic edits.</violation>
<violation number="2" location="apps/wodsmith-start/src/components/divisions/organizer-division-manager.tsx:277">
P2: Team-size rollback uses stale initial value, so a failed later edit can incorrectly revert to an older team size.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| newTeamSize: number, | ||
| ) => { | ||
| const original = initialDivisions.find((d) => d.id === divisionId) | ||
| if (original && original.teamSize === newTeamSize) return |
There was a problem hiding this comment.
P1: Team-size no-op guard compares against stale initialDivisions, which can block legitimate updates after prior optimistic edits.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/wodsmith-start/src/components/divisions/organizer-division-manager.tsx, line 237:
<comment>Team-size no-op guard compares against stale `initialDivisions`, which can block legitimate updates after prior optimistic edits.</comment>
<file context>
@@ -220,6 +229,58 @@ export function OrganizerDivisionManager({
+ newTeamSize: number,
+ ) => {
+ const original = initialDivisions.find((d) => d.id === divisionId)
+ if (original && original.teamSize === newTeamSize) return
+
+ setDivisions((prev) =>
</file context>
| if (original && original.teamSize === newTeamSize) return | |
| if (divisions.find((d) => d.id === divisionId)?.teamSize === newTeamSize) return |
| onKeyDown={(e) => { | ||
| if (e.key === "Enter" && localLabel !== label) { | ||
| onLabelSave(localLabel) | ||
| e.currentTarget.blur() | ||
| } | ||
| }} |
There was a problem hiding this comment.
P2: Pressing Enter in the division name field triggers onLabelSave twice (keydown + blur), causing duplicate save requests.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/wodsmith-start/src/components/divisions/organizer-division-item.tsx, line 307:
<comment>Pressing Enter in the division name field triggers `onLabelSave` twice (keydown + blur), causing duplicate save requests.</comment>
<file context>
@@ -201,38 +268,118 @@ export function OrganizerDivisionItem({
+ onLabelSave(localLabel)
+ }
+ }}
+ onKeyDown={(e) => {
+ if (e.key === "Enter" && localLabel !== label) {
+ onLabelSave(localLabel)
</file context>
| onKeyDown={(e) => { | |
| if (e.key === "Enter" && localLabel !== label) { | |
| onLabelSave(localLabel) | |
| e.currentTarget.blur() | |
| } | |
| }} | |
| onKeyDown={(e) => { | |
| if (e.key === "Enter") { | |
| e.currentTarget.blur() | |
| } | |
| }} |
| setDivisions((prev) => | ||
| prev.map((d) => | ||
| d.id === divisionId | ||
| ? { ...d, teamSize: original?.teamSize ?? newTeamSize } |
There was a problem hiding this comment.
P2: Team-size rollback uses stale initial value, so a failed later edit can incorrectly revert to an older team size.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/wodsmith-start/src/components/divisions/organizer-division-manager.tsx, line 277:
<comment>Team-size rollback uses stale initial value, so a failed later edit can incorrectly revert to an older team size.</comment>
<file context>
@@ -220,6 +229,58 @@ export function OrganizerDivisionManager({
+ setDivisions((prev) =>
+ prev.map((d) =>
+ d.id === divisionId
+ ? { ...d, teamSize: original?.teamSize ?? newTeamSize }
+ : d,
+ ),
</file context>
Summary
registered / cap, including unlimited, near-capacity, at-capacity, and over-capacity states.teamSizechanges after a division has been created.Capacitysection and clarified how the default per-division cap relates to row-level overrides.Validation
PATH=/Users/ianjones/.nvm/versions/node/v24.14.1/bin:$PATH pnpm --filter wodsmith-start type-checkPATH=/Users/ianjones/.nvm/versions/node/v24.14.1/bin:$PATH pnpm --filter wodsmith-start exec biome lint src/components/divisions/organizer-division-item.tsx src/components/divisions/organizer-division-manager.tsx 'src/routes/compete/organizer/$competitionId/-components/capacity-settings-form.tsx' src/server-fns/competition-divisions-fns.tsgit diff --checkNotes
apps/wodsmith-start/.alchemy/local/wrangler.jsonc; Vite exits with the existing Alchemy config-path error until local Alchemy state is generated.Summary by cubic
Make division rows truly editable: name, team size, capacity, and notes are inline with a live capacity badge and state-aware styling. Also persist
teamSizeon the backend and clarify capacity defaults in the Competition settings.New Features
Refactors
updateCompetitionDivisionFnaccepts optionalteamSizeand persists it.CapacitySettingsForm.Written for commit 5f3611f. Summary will update on new commits.