fix(baseball): treat empty Lift Builder player selection as "none" (#491)#645
Conversation
) Deselecting every athlete in GroupAvailabilityGrid previously sent playerIds: undefined, which saveLiftSessionPlan interpreted as "no subset filter" and blasted the session to the entire team/group — the opposite of "nobody". - LiftBuilderClient: block save with a clear error when zero athletes are selected, always send the explicit selection set (no more undefined footgun), and change the button copy to "Save — N selected athlete(s)". - saveLiftSessionPlan: honor an explicitly-provided (even empty) playerIds array by intersecting with the resolved scope, so an empty selection yields count: 0 with no DB writes. Only an omitted (undefined) value still falls back to the whole resolved scope. Auth wrapper (withBaseballAction) and table prefixes unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017VUauUXsm9aXegShmpJi5n
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Summary by QodoFix Lift Builder empty athlete selection to target nobody (not whole team)
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
Context used✅ Tickets:
🎫 BaseballHelm: Treat empty Lift Builder player selection as "assign to none," not whole team✅ Compliance rules (platform):
93 rules 1. lift-builder.ts outside actions dir
|
|
🤖 Mission Control — PR summary Changes: Deselecting every athlete in Lift Builder now means “assign to none”, not the whole team — blocks save on an empty selection and always sends the explicit set; server honors an empty array as |
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
What & why
Closes #491. In the Lift Builder, deselecting every athlete in
GroupAvailabilityGridsentplayerIds: undefinedtosaveLiftSessionPlan, which skipped the subset filter and materialized the session for the entire team/group — the exact opposite of "nobody". The UI implies per-player targeting, so an empty selection must mean none.Changes
LiftBuilderClient.tsxSelect at least one athlete before saving.) when zero athletes are selected, matching the existing title/date/exercise guards.playerIds: [...selectedPlayerIds]) instead of collapsing empty toundefined.Save — N selected athlete(s).lift-builder.ts(saveLiftSessionPlan)playerIdsarray by intersecting with the resolved group/team scope. An empty selection now yieldscount: 0with no DB writes. Only an omitted (undefined) value falls back to the whole resolved scope (documented affordance for non-UI callers).No schema/table changes, no migration. Auth wrapper (
withBaseballAction) andbaseball_*table prefixes untouched.Acceptance criteria
count: 0, no DB writes if an empty set reaches the server).🤖 Generated with Claude Code