Skip to content

feat: Add OP.GG historical ranks integration and UI improvements#3

Open
mderouet wants to merge 6 commits intoAntApper:mainfrom
mderouet:feat/multi-account-opgg-integration
Open

feat: Add OP.GG historical ranks integration and UI improvements#3
mderouet wants to merge 6 commits intoAntApper:mainfrom
mderouet:feat/multi-account-opgg-integration

Conversation

@mderouet
Copy link
Copy Markdown

@mderouet mderouet commented Jan 24, 2026

Summary

This PR adds OP.GG integration to display historical ranks for players and various UI improvements.

Builds on #2 - should be merged after #2

New Features

  • OP.GG historical ranks: Display previous season ranks for all match participants
  • Live game rank history: Show rank progression for players in current game
  • Background pre-fetching: Silently fetch OP.GG data for all participants

UI Enhancements

  • Compact panel layout: Reduced height for summary and stats panels (more room for match list)
  • 50/50 split: Match list and rank preview now equal width with consistent gap
  • Improved Match Ranks display: Headers, separators, and formatted columns

Bug Fixes

  • Fix "InvalidKDA" display for ARAM games (queueId 450)
  • Handle missing role data gracefully with proper spacing

What does it look like?

The Match Ranks panel now shows historical ranks from previous seasons (S25:G4, S24:G2, etc.) alongside the current rank, helping identify smurfs or returning players.

  • Blue Team and Red Team with formatted headers
  • Current rank with historical rank badges
  • Compact layout giving more space to match history
Screenshot 2026-01-24 at 15 17 03

mderouet added 6 commits January 16, 2026 20:10
…stats display

New Features:
- Multi-account management: save/switch between accounts (Tab/Shift+Tab)
- Persistent caching: per-account cache in ~/.lol-cli/ for matches, ranks, masteries
- Ranked info display: Solo/Duo and Flex ranks with LP, tier, win rate
- Champion mastery display: top 5 champions with levels and points
- Champion stats panel: recent game performance by champion with win rate/KDA
- Queue type detection: auto-detects Ranked/Flex/ARAM/Normal/Arena
- Region auto-detection: detects region from Riot ID tagline (e.g., #NA1)
- Last search persistence: remembers last searched account

Bug Fixes:
- Add retry with exponential backoff for rate-limited API calls (429)
- Fix API error handling to preserve original error information
- Handle 404 gracefully for live game endpoint (not in game)
- Fix rank calculation for edge cases (score <= 0)
- Fix .env path detection for binary builds

Code Improvements:
- Refactored API functions to use consistent retryWithBackoff() wrapper
- Multi-panel results layout with collapsible sections
- Generic readCacheFile() helper with validation
- PUUID validation to prevent directory traversal
- Dynamic footer hints based on context
- Progress bar message-only updates
The account list now uses cyan color for the selected account instead
of just a > marker, making it easier to identify the active account.
Added clearPos() call to force blessed to redraw the match list
border when switching between normal and ranked-only filter modes.
Code quality improvements following multi-account management feature:

- Extract delay utility to utils.js (removes 3 duplicate definitions)
- Remove unused refreshAllAccounts function (~35 lines of dead code)
- Add fetchAndCacheRank helper to reduce duplication across rank fetching
- Remove unused rankSuffix variable from ui.js
- Add DEBUG guards to console.error statements for cleaner output
- Add OP.GG integration to display historical ranks in Match Ranks panel
- Show rank history for live game participants
- Pre-fetch OP.GG data in background for all match participants
- Adjust match list and rank preview panels to 50/50 split
- Add consistent gap between bottom panels
- Compact panel layout: reduce summary/mastery/stats height
- Fix InvalidKDA display for ARAM games
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