Skip to content

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

Merged
aalonsolopez merged 20 commits into
OpenLeagueManager:developfrom
NicoRuedaA:0.2.1-remove-football-related-technical-debt-from-codebase
May 18, 2026
Merged

refactor: remove football-related technical debt from codebase#246
aalonsolopez merged 20 commits into
OpenLeagueManager:developfrom
NicoRuedaA:0.2.1-remove-football-related-technical-debt-from-codebase

Conversation

@NicoRuedaA

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.

Rebased onto 0.2.1 (main) and targeting develop for merge.

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 to 9 LoL stats)

Full attribute rename table included in original PR #216.

Test Results

  • cargo test --workspace: All 500+ Rust tests pass
  • npm test: All frontend tests pass

273 files changed, 6318 insertions(+), 30228 deletions(-)

NicoRuedaA and others added 20 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
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
- 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
Release 0.2.1 hotfix
…nup into 0.2.1

Integrates cleanup branch with 3 conflict resolutions: renamed football_position_to_lol_role to position_to_lol_role, removed profile_image_url field, renamed PlayStyle to DraftStrategy.
@aalonsolopez
aalonsolopez merged commit ba19f81 into OpenLeagueManager:develop May 18, 2026
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)

2 participants