feat: Add Squad Number panel to the Scouting Report#53
Open
ggaisenn wants to merge 11 commits into
Open
Conversation
… specific generation
…h position fallback
Author
|
Hi @Younesfdj, I am following up on my pull request regarding the new Squad Number panel feature. The implementation introduces deterministic squad number assignment based on position, hash, and overall rating, alongside the corresponding UI panel. The changes have been fully tested and compiled with zero errors or new warnings. Please let me know if you have time to review or if any changes are required. Warm Regards, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Problem It Solves
How It Works
The Logic: Created a
generateSquadNumber(login, position, overall)utility (lib/scoring/squadNumber.ts) that deterministically assigns numbers:- Position: Maps roles to iconic numbers (e.g., ST → 9, CAM → 10, RW → 7, CB → 4).
- Overall Rating: Elite players (OVR ≥ 90) always get the classic No.1 choice for their position.
- Login hash: Everyone else gets a consistent, varied pick from the position's number pool.
The Data: Added
squadNumberto theCardinterface and assigned it inbuildCard().The UI: Created a
PlayerNumbercomponent that renders the number in aSection card, matching the existing scouting report UI. It sits right belowMetricsPanelinResultView.Changes
lib/scoring/squadNumber.tslib/scoring/types.tssquadNumber: numbertoCardlib/scoring/engine.tsbuildCard()components/ScoutReport.tsxSectioncomponent for reusecomponents/PlayerNumber.tsxcomponents/ResultView.tsxPlayerNumberbelowMetricsPanelCI
Before / After
| Before |