fix(playball): use correct jersey number based on team side #74

Merged
umpire274 merged 1 commit from fix/using-correct-jersey-number-playball into main 2026-06-03 11:09:47 +02:00
umpire274 commented 2026-06-03 11:08:15 +02:00 (Migrated from github.com)
  • Use home jersey number for home team players
  • Use away jersey number for away team players
  • Fix lineup display and player selection in playball mode
  • Ensure roster rendering uses the correct jersey number
- Use home jersey number for home team players - Use away jersey number for away team players - Fix lineup display and player selection in playball mode - Ensure roster rendering uses the correct jersey number
chatgpt-codex-connector[bot] (Migrated from github.com) reviewed 2026-06-03 11:14:02 +02:00
chatgpt-codex-connector[bot] (Migrated from github.com) left a comment

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2413eb42e9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `2413eb42e9` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". </details>
chatgpt-codex-connector[bot] (Migrated from github.com) commented 2026-06-03 11:14:02 +02:00

P2 Badge Avoid resolving away lineups by non-unique numbers

When is_home_team is false, this lookup now matches on away_number, but the schema only enforces UNIQUE(team_id, number) and the player create/edit/import paths allow duplicate away numbers. In that case the away roster display can show two players with the same jersey, this loop accepts the duplicate number, and the subsequent find always selects the first matching player while used_numbers prevents selecting the other, so a valid-looking away lineup cannot be entered correctly. Consider enforcing away-number uniqueness or selecting players by a unique roster index/id.

Useful? React with 👍 / 👎.

**<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Avoid resolving away lineups by non-unique numbers** When `is_home_team` is false, this lookup now matches on `away_number`, but the schema only enforces `UNIQUE(team_id, number)` and the player create/edit/import paths allow duplicate away numbers. In that case the away roster display can show two players with the same jersey, this loop accepts the duplicate number, and the subsequent `find` always selects the first matching player while `used_numbers` prevents selecting the other, so a valid-looking away lineup cannot be entered correctly. Consider enforcing away-number uniqueness or selecting players by a unique roster index/id. Useful? React with 👍 / 👎.
Sign in to join this conversation.
No description provided.