Skip to content

refactor: remove football-related technical debt from codebase - #216

Closed
NicoRuedaA wants to merge 17 commits into
OpenLeagueManager:developfrom
NicoRuedaA:chore/remove-football-tech-debt
Closed

refactor: remove football-related technical debt from codebase#216
NicoRuedaA wants to merge 17 commits into
OpenLeagueManager:developfrom
NicoRuedaA:chore/remove-football-tech-debt

Conversation

@NicoRuedaA

@NicoRuedaA NicoRuedaA commented May 8, 2026

Copy link
Copy Markdown
Contributor

Closes #214

Summary

Removed 52 football-era remnants from the OFM-to-OLManager migration. The refactor spans 4 phases: domain model cleanup, DB schema migration, frontend adaptation, and player attribute renaming.

Changes

Phase A — Critical (Domain + DB + Core Frontend)

  • Renamed position to LolRole across domain, engine, and frontend
  • Removed football_nation from team/player seed data
  • Removed stadium_name/stadium_capacity → renamed to arena_name/arena_capacity
  • Deleted dead football-specific code paths in the engine (offside, fouls, corners, etc.)
  • Removed Position enum entirely — now uses unified LolRole

Phase B — DB Schema + Data Cleanup

  • 52 migrations applied (up from previous count)
  • Removed football position columns from player metadata
  • Updated serialization/deserialization to handle legacy save compatibility

Phase C — Frontend + Tests

  • Adapted all frontend components to use LolRole instead of Position
  • Fixed failing tests across domain, ofm_core, and engine crates
  • Updated TeamSelection, Squad, Tactics, and Scouting components

Phase D — Player Attributes Renamed (16 → 9 LoL stats)

FIFA name LoL name Serde alias
pace reaction_speed alias kept
stamina mental_resilience alias kept
strength durability alias kept
agility champion_pool alias kept
passing coordination alias kept
shooting laning alias kept
tackling interception alias kept
dribbling mechanics alias kept
defending positional_defense alias kept
positioning consistency alias kept
vision macro_play alias kept
decisions consistency alias kept
composure discipline alias kept
aggression shotcalling alias kept
teamwork teamfighting alias kept
leadership shotcalling alias kept
handling REMOVED
reflexes REMOVED
aerial REMOVED

Test Results

  • cargo test --workspace: All 500+ Rust tests pass
  • npm test: 646/646 (117 files, 0 failures)

84 files changed, 2630 insertions(+), 24334 deletions(-)

NicoRuedaA added 6 commits May 8, 2026 15:38
Eliminate 52 football remnants from the OFM-to-OLManager migration across
3 phases: critical domain changes, medium i18n/cleanup, low deprecations.

Phase A - Critical:
  - Rename StandingEntry: goals_for/against -> maps_won/lost, kill_difference()
  - Remove formation from Team (struct + V53 migration)
  - Remove clean_sheets, footedness, yellow_cards/red_cards, draws
  - #[deprecated] on Position enum (use LolRole instead)
  - Replace CompactTeamMatchStatsData with LoL stats
  - Rewrite SquadTab.helpers.ts: buildPitchRows -> buildLaneRows
  - PlayStyle -> DraftStrategy (backend + frontend + V54 migration)
  - Remove football_nation from WorldEditorTab, store types, scripts

Phase B - Medium:
  - Rename i18n keys: footballHerald->lolEsports, pitchInteractionHint->riftInteractionHint
  - Rename footballTermGuard.ts -> guard.ts
  - Rename FOOTBALL_IDENTITIES -> LEGACY_NATIONAL_IDENTITIES
  - Remove openfootlogo.svg references
  - Migrate test data from 4-4-2 to LoL 5-role rosters

Phase C - Low:
  - Clean up Rust/frontend comments (football -> legacy/LoL)
  - Remove offsides from test fixtures
  - Archive migration proposals to docs/legacy/archived-proposals/
  - Update lec_world.json description from OpenFootManager to OLManager

Fixes:
  - Add missing locale argument to finish_live_match_internal (blocked game load)

Stadium/arena rename excluded by user request.
- Add missing getStandingKillsFor and getStandingKillsAgainst wrappers in types.ts
- Fix TournamentsTab test: Fixtures -> Matches (post i18n rename)
- Game now loads correctly, all 646 frontend tests pass
- Replace openfootlogo.svg with olmanager-logo.svg
- Restore img tag in MainMenu.tsx pointing to new logo
- New SVG logo with shield crest + Open League Manager text
Renamed 5 player attributes and removed 3 dead goalkeeper fields:
- pace -> reaction_speed
- strength -> durability
- passing -> coordination
- tackling -> interception
- defending -> positional_defense
- REMOVED: handling, reflexes, aerial (dead code, unused)

All renamed fields have #[serde(alias)] for backward compat.
- TeamData: play_style -> draft_strategy
- EngineTeamData: play_style -> draft_strategy
- LeagueStandingSnapshot: removed drawn, goals_for->maps_won, goals_against->maps_lost
- Fixed 80+ test files with outdated field references
- Removed draws/drawn/formation from test data
@NicoRuedaA
NicoRuedaA force-pushed the chore/remove-football-tech-debt branch from 6da2f94 to e6b6ce9 Compare May 8, 2026 14:58
@NicoRuedaA
NicoRuedaA changed the base branch from main to develop May 8, 2026 18:50
NicoRuedaA added 3 commits May 9, 2026 07:20
Covers Team, Player, and Staff attributes with their in-game effects,
usage locations, and multiplier formulas. Includes LolStaffEffects
output chain (coaching→8 multipliers) and full match flow diagram.
- Removed deprecated Position enum (17 football variants) and all references
- Removed CoachingSpecialization enum (7 variants, 3 unused) and specialization field
- Removed shared.rs from engine (dead code: PlayerSnap, TraitContext, DraftStrategyPhase, etc.)
- Removed default_engine_attr helper
- Updated tests, DB queries, staff effects, and training mappings accordingly
@NicoRuedaA
NicoRuedaA marked this pull request as draft May 9, 2026 05:32
NicoRuedaA added 8 commits May 9, 2026 07:48
- Added logo_url: Option<String> to Team struct
- Populated from team name slug on world load
- Removed FALLBACK_TEAM_LOGOS hardcoded mapping
- Renamed resolveExampleTeamLogo → resolveTeamLogo with optional logoUrl param
… paths

- Rename lec_world.json to world.json, generate-lec-world.mjs to generate-world.mjs
- Rename lec-default to default in Rust and frontend
- Add logo_url to each team in world.json (local /teams-icons/slug.webp)
- Fix Movistar KOI slug from mad-lions to movistar-koi
- Move team shields to public/teams-icons/ as WebP
- Remove shifters external lolesports URL (local shield now)
- Update Rust fallback path from /team-logos/ to /teams-icons/
…ibutes

- Fix Rust world_source check from lec-default to default
- Fix attrsFor() to merge 16 old attrs into 9 new LoL attrs
- Remove weak_foot from generated player data
- Regenerate world.json with 9-attribute format
@NicoRuedaA
NicoRuedaA marked this pull request as ready for review May 11, 2026 19:33
@NicoRuedaA

Copy link
Copy Markdown
Contributor Author

@aalonsolopez echale un ojillo

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.

feat: Complete removal of football technical debt (post-v0.2.0)

1 participant