Skip to content

feat: UI v2 complete migration — v1 removed, new design system, bug fixes - #294

Merged
aalonsolopez merged 223 commits into
OpenLeagueManager:developfrom
NicoRuedaA:main
Jun 8, 2026
Merged

feat: UI v2 complete migration — v1 removed, new design system, bug fixes#294
aalonsolopez merged 223 commits into
OpenLeagueManager:developfrom
NicoRuedaA:main

Conversation

@NicoRuedaA

Copy link
Copy Markdown
Contributor

Summary

Complete migration from v1 to v2 UI. The old UI (src/components/, src/pages/, src/App.tsx) has been removed entirely. The new v2 UI is the only interface.

Changes

Infrastructure

  • src/components/ deleted — entire legacy component tree removed
  • src/pages/ deleted — all legacy pages removed (MainMenu, Dashboard, MatchSimulation, Settings, TeamSelection)
  • src/App.tsx + src/App.css deleted — entry point consolidated into src/ui-v2/AppV2.tsx
  • src/main.tsx simplified — always renders AppV2, no v1/v2 toggle
  • src/ui-v2/uiVersion.ts — stub (always returns v2)

Helpers moved to src/lib/

  • Squad, Home, Inbox, Schedule, Scouting, Transfers, Training, PlayerProfile, Dashboard helpers migrated from @/components/ to @/lib/
  • 19 helper files moved, 545 imports updated

Legacy components preserved as _legacy/

  • Components still used by v2 wrappers were copied to src/ui-v2/_legacy/
  • All relative imports (545+) converted to @/ aliases
  • All @/components/ imports redirected to @/ui-v2/_legacy/components/ (326+)
  • Includes: NewsTab, SocialTab, PlayerProfile, TeamProfile, MainMenu, MatchSimulation, transfer modals, draft screens

Bug Fixes

  • time_blocker: build_effective_lineup_ids ignored valid_saved_ids for LoL (5-player) path — created empty Vec instead of using saved IDs
  • auto-lineup on team select: select_team now auto-populates active_lineup_ids after team assembly
  • SquadTab auto-save: auto-saves computed lineup to backend on mount
  • TeamSelectionV2: uses correct game state after set_active_lineup (was using stale state)

AppV2 Features (Phase 3)

  • Update checker with modal (useUpdater hook)
  • UI scale (settings.ui_scale → fontSize)
  • Android immersive mode (fullscreen + landscape)
  • Mouse back/forward button blocking

Visual

  • v2 color palette applied across legacy components (SocialTab, PreMatchSetup, PreMatchLineup, DraftResultScreen, ChampionDraft, OpponentIntelCard)
  • Tournaments button removed from sidebar (Spanish translation was 'Liga')
  • OVR numbers removed from next-match comparison bar (kept bar only)

Architecture

\
src/
├── main.tsx # entry → always AppV2
├── lib/ # helpers (moved from @/components/)
├── ui-v2/
│ ├── AppV2.tsx # router root + update checker + UI scale + Android
│ ├── _legacy/ # v1 copies with converted imports (~30 dirs)
│ ├── components/ui/ # shadcn primitives
│ ├── dashboard/ # DashboardV2 + 21 native tabs
│ └── pages/ # v2 pages (SettingsV2, TeamSelectionV2)
├── store/, services/, hooks/ # shared
└── src-tauri/ # Rust backend
└── crates/olm_core/src/time_blockers.rs # bug fix
\\

Migration Guide

No toggle between v1/v2. Settings still has the UI version selector but it's a no-op. The _legacy/ directory is a static snapshot — wrappers can be ported to native v2 incrementally.

Test Plan

  • npx tsc --noEmit
  • npm run build
  • cargo build --package openleaguemanager
  • Manual: team selection flow
  • Manual: dashboard navigation
  • Manual: continue/advance time

Notes for Reviewers

This is a large PR (431 commits, 5502 files changed). Recommend reviewing in this order:

  1. src-tauri/ — Rust backend bug fixes (time_blocker.rs, game.rs)
  2. src/main.tsx — simplified entry point
  3. src/ui-v2/AppV2.tsx — new app root
  4. src/ui-v2/_legacy/ — preserved v1 components (read-only)
  5. src/lib/ — extracted helpers
  6. src/ui-v2/dashboard/ — 21 v2 tab implementations
  7. AGENTS.md — project handoff doc

NicoRuedaA and others added 30 commits May 13, 2026 19:59
Enables v052_multi_competitions migration (was SELECT 1 no-op), creates competitions/seasons tables. Fixes 6 orphan conflict markers in commands/*.rs and FixtureCompetition/competition renames in squad.rs.
Adds tier field to CompetitionSummary (backend + frontend). Groups competitions by tier with 'Tier 1' / 'Tier 2' section headers. Removes tier >= 1 filter to show all tiers.
Fixed lck_cl, les, lfl, lrn, prime_league, tcl teams: normalized data.country->country, empty arrays, added missing required fields.
Adds missing required fields (city, country, history, form, arena_name, arrays) to lck_cl, les, lrn, tcl team files. Normalizes data.country/data.team_kind prefixes.
LFL manifest: tier 2. All team files: fixed null colors.secondary, null lol_tactics fields, null facilities. Global null normalization for all fields.
LFL manifest: tier 1 -> 2. TCL teams: fixed null colors.secondary.
PlayersListTab, TransfersTab, FinancesTab, HomeRosterLineupCard were calling resolvePlayerPhoto without profile_image_url, causing all players to show generic fallback photo instead of their actual image.
Added 80+ country name entries (English, Portuguese, Spanish) to DEMONYM_TO_CODE map so player nationalities like 'South Korea', 'China', 'Brazil', etc. resolve to ISO codes like 'KR', 'CN', 'BR' for CountryFlag component.
CompetitionsTab CompetitionCard was hardcoded to show Trophy SVG. Now renders the competition logo from /competitions-icons/{league.id}.webp with Trophy fallback on error.
league.id is a UUID, not usable for icon filenames. Changed to use competition_id (manifest ID) with space-to-underscore mapping to match icon filenames. Added competition_id to LeagueData interface.
CompetitionsTab CompetitionCard was using league.id (UUID) for icon URL. Changed to use league.competition_id (manifest ID like 'lec') with space-to-underscore mapping to match /competitions-icons/ filenames.
…ningTab

Added profile_image_url fallback and resolvePlayerPhoto calls where player photos still showed the broken generic image.
…allback

Updated resolvePlayerPhoto to handle 'player-XXXX' and 'team-XXXX' ID patterns directly as photo filenames. This fixes photos in TacticsTab and any other component that calls resolvePlayerPhoto without profile_image_url.
TacticsTab now finds the player from gameState.players by ID/name to get profile_image_url before falling back to resolvePlayerPhoto.
TournamentsTab now finds the user's team competition by matching team.competition_id instead of showing gameState.leagues[0]. Fixes hardcoded LEC logo to use /competitions-icons/{id}.webp.
NicoRuedaA and others added 28 commits June 8, 2026 10:28
…ender icons

- Add sender_icon field to InboxMessage/MessageData (Rust + TypeScript)
- Create TemplateStore: loads message templates from data/messages/*/*.json
- Create 3 welcome message templates as example
- init_template_store() called during select_team before generating messages
- welcome_message() now tries template store first, falls back to hardcoded
- Frontend: display sender icon in MessageRow and DetailPane (falls back to initial if no icon)
…sed dispatch

- New JSON format: single file with trigger, weight, translations per language
- TemplateStore now groups by trigger, weighted random selection
- Inline translations: tr.es, tr.de etc. inside the same JSON
- Frontend icon path: /messages-icons/{file} with any extension
- welcome.json → trigger select_team, es/de translations inline
- Sender icon references 734e515cd773648598ce19ae30153f5f.jpg from public/messages-icons/
…ions

- select_team Tauri command now accepts optional lang parameter
- TeamSelectionV2 passes i18n.language to selectTeam
- welcome_message() takes lang parameter for template translation resolution
- Frontend: sender_icon path fix (references file directly, no hardcoded .webp)
- Imported TournamentsTab component into DashboardTabContent.
- Updated DashboardSidebarV2 to include a new Tournaments tab with a Trophy icon.
- Enhanced DashboardV2 to handle Tournaments and Market tabs, including rendering their respective components.
- Created TournamentsTab component to display tournament details, standings, and fixtures.
- Added MarketTabV2 component to manage transfer history and player transactions.
- Updated StaffTabV2 to support world mode for staff management.
Phase 1 (senders): board (existing), assistant_coach, director_of_football, scout, fitness_coach, press, player_relations, al_lio, yuste
Phase 2 (message templates): staff_advice, board_expectations/warning/final/fired/objectives, season_schedule, transfer_complete/offer/terminated, contract_expired/renewal, academy_acquired/moved, jobs_welcome/offer/rejection, sponsor_offer, finance_critical/warning/wage, scout_report/potential
- Add match_preview templates (2 variations, venue-aware)
- Add match_result templates (victory x2, defeat x2, draw x1)
- Add player_event templates: low_morale, bench_complaint, happy_player, contract_concern (2 each with ChooseOption actions)
- Add second season_schedule variation
- Update pre_match_message, match_result_message, and 4 player event functions to use template store
- media_story: 20 templates (10 positive + 10 negative) via press sender
- podcast: 10 templates via al_lio sender
- stream: 20 templates via yuste sender (10 positive + 10 negative)
- rival_interest: 10 templates via director_of_football sender
- Updated: media_story_message, allio_podcast_message, yuste_stream_message, rival_interest_message
…() helper

- Move data/senders/ → data/messages/senders/ (senders alongside templates)
- Add with_sender() helper to apply sender name/role/icon from senders store
- Update contract_expired_message and terminate_contract to use with_sender()
- Fix senders init path in game.rs
All message trigger folders now under data/messages/triggers/:
  academy, board, contract, finance, jobs, match_preview,
  match_result, media, player_event, podcast, rival_interest,
  scout, season, staff, stream, transfer, welcome, training

Template store init updated to look for triggers/ subdirectory.
Senders store remains at data/messages/senders/.
14 competitions now point to their staff_*.json files:
cblol, lck, lckcl, lcp, lcs, lec, les, lfl, lfl-l, lpl, lrn, lrs, prm, prm-l

Previously all staff_file were null, so only free_agents.json (2 staff) was loaded.
Add sender icons: board, assistantcoach, coach, director, press, relations, scout
- Remove TournamentsTab.tsx (legacy) and TournamentsTabV2.tsx (dead code)
- Remove old misspelled icons (assistantcoach, directtor)
- Add corrected icons (assistant, director, yuste)
- Update sender JSONs to use corrected icon filenames
- Rename _SELECT_COMPETITION_TEAM.md → _SELECT_COMPETITION_AND_TEAM.md
… from PlayerData

- Changed the background class of the Select component from "bg-gray-100" to "bg-muted".
- Removed the "injury" attribute from PlayerData in multiple files including WorldEditorTab, helpers, finances, and player tests.
- Cleaned up the DEMONYM_TO_CODE mapping by removing duplicate and unused country entries.
- Updated type assertions in API calls for better type safety.
- Enhanced test cases for player photo resolution and academy contracts.
- Refactored various components in the UI to remove unused imports and improve readability.
- Added a new script to sync data directory for Tauri bundling.
# Conflicts:
#	src/components/tournaments/TournamentsTab.tsx
…anup

upstream/main removed the TournamentsTabV2 file + import but left the JSX
usage in DashboardV2, causing a TS2304 (missing-import crash class). Drop
the orphaned ternary branch to restore a clean tsc.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Add handleExitWithoutSave() that exits without calling exit_to_menu
- DashboardOverlays now receives handleExitWithoutSave prop
- Exit confirm modal's 'Salir sin guardar' button now properly exits to menu
…on team select, v2 color conversion, remove Tournaments sidebar button, remove OVR numbers from bar
@aalonsolopez
aalonsolopez changed the base branch from main to develop June 8, 2026 19:04
@aalonsolopez
aalonsolopez merged commit da08820 into OpenLeagueManager:develop Jun 8, 2026
2 of 5 checks passed
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.

3 participants