Skip to content

feat: Add Squad Number panel to the Scouting Report#53

Open
ggaisenn wants to merge 11 commits into
Younesfdj:masterfrom
ggaisenn:player-number
Open

feat: Add Squad Number panel to the Scouting Report#53
ggaisenn wants to merge 11 commits into
Younesfdj:masterfrom
ggaisenn:player-number

Conversation

@ggaisenn

@ggaisenn ggaisenn commented Jul 10, 2026

Copy link
Copy Markdown

What does this PR do?

  • Adds a new Squad Number panel to the scouting report (bottom-right, below the Scouting Metrics).
  • It automatically assigning each developer an iconic football squad number based on their position, login hash and overall rating.

Problem It Solves

  • GitFut cards are inspired by Ultimate Team, and every player needs a squad number.
  • Right now, there isn't a number anywhere on the report, which leaves out a core piece of football identity that fans expect to see.

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 squadNumber to the Card interface and assigned it in buildCard().

  • The UI: Created a PlayerNumber component that renders the number in a Section card, matching the existing scouting report UI. It sits right below MetricsPanel in ResultView.

Changes

File Change
lib/scoring/squadNumber.ts New — squad number generator
lib/scoring/types.ts Added squadNumber: number to Card
lib/scoring/engine.ts Calls generator in buildCard()
components/ScoutReport.tsx Exported Section component for reuse
components/PlayerNumber.tsx New — squad number display panel
components/ResultView.tsx Renders PlayerNumber below MetricsPanel

CI

  • npm run lint ✅ 0 errors, 12 warnings
  • npm run build ✅ compiled successfully (TypeScript strict)
  • npm test ✅ 152 tests passed (16 suites)

Note on lint warnings: All 12 warnings are pre-existing @next/next/no-img-element
warnings in PlayerCard.tsx, FlagPicker.tsx, ScoutReport.tsx, Mascot.tsx, StoryFrame.tsx and lib/og/renderCard.tsx.
No new warnings were introduced by this PR.

Before / After

| Before |

Screenshot 2026-07-15 at 10 02 31 AM | After | Screenshot 2026-07-15 at 10 09 58 AM

@ggaisenn

Copy link
Copy Markdown
Author

Hi @Younesfdj,
I hope you are doing well.

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,
Gaurav Gaisenn

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