Skip to content

feat: Multi-account management, persistent caching, and code improvements#2

Open
mderouet wants to merge 5 commits intoAntApper:mainfrom
mderouet:refactor/code-cleanup
Open

feat: Multi-account management, persistent caching, and code improvements#2
mderouet wants to merge 5 commits intoAntApper:mainfrom
mderouet:refactor/code-cleanup

Conversation

@mderouet
Copy link
Copy Markdown

@mderouet mderouet commented Jan 21, 2026

Summary

This PR adds major new features for tracking multiple summoner accounts with persistent caching, enhanced statistics displays, and code quality improvements.

New Features

  • Multi-account management: Save and switch between multiple summoner accounts using Tab/Shift+Tab
  • Persistent caching: Per-account cache for matches, ranks, and masteries in ~/.lol-cli/
  • LP progression graph: Visual ASCII chart showing rank progression over time
  • Time scope filters: Filter stats by All/Last 10/Today/Weekly (t key)
  • Ranked-only filter: Toggle to show only ranked games (r key)
  • Live game detection: Shows current game info with participant ranks
  • Spectate mode: Launch spectator client directly from the app (s key)
  • Account removal: Remove accounts from monitored list (d key)
  • Offline mode: Graceful degradation when API is unavailable

UI Enhancements

  • Ranked info display: Shows Solo/Duo and Flex queue ranks with LP and win rate
  • Champion mastery display: Top 5 mastery champions with levels and points
  • Champion stats panel: Recent game performance by champion with win rate and KDA
  • Match rank preview: Shows all participants' ranks in side panel
  • Queue detection: Auto-detects game mode (Ranked, Flex, ARAM, Normal, Arena)
  • Region auto-detection: Detects region from Riot ID tagline
  • Selected account highlighting: Cyan highlight for active account
  • Dynamic border colors: Yellow borders when ranked filter is active

Code Improvements

  • Extract delay utility: Consolidated 3 duplicate delay function definitions into utils.js
  • Remove dead code: Deleted unused refreshAllAccounts function (~35 lines)
  • Extract rank-fetching helper: Created fetchAndCacheRank() to reduce duplication
  • Add DEBUG guards: Console error logs now respect DEBUG environment variable
  • Refactored API functions: Consistent retry wrapper with exponential backoff

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
  • Fix border color updates when toggling filters

What does it look like?

  • Multi-account switcher in header with cyan highlight for active account
  • Ranked info with LP progression graph
  • Summary and champion stats filtered by time scope (Ranked + Week)
  • Match history with average lobby rank
  • Match ranks panel showing all participants
Screenshot 2026-01-21 at 19 44 53

Builds on #1 - should be merged after #1

mderouet added 2 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.
@mderouet mderouet force-pushed the refactor/code-cleanup branch from 56bff78 to ab617fc Compare January 21, 2026 18:38
@mderouet mderouet changed the title refactor: Code cleanup and deduplication feat: Multi-account management, persistent caching, and code improvements Jan 21, 2026
mderouet added 3 commits January 21, 2026 21:03
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
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