Add card browser with similar cards and performance optimizations

This commit is contained in:
matt 2025-10-17 16:17:36 -07:00
parent a8dc1835eb
commit c2960c808e
25 changed files with 4841 additions and 1392 deletions

View file

@ -1,23 +1,36 @@
# MTG Python Deckbuilder ${VERSION}
### Summary
Card browser with advanced filters, keyboard shortcuts, and responsive design.
New card browser for exploring and discovering cards with advanced filters, similar card recommendations, and fast performance.
### Added
- **Card Browser**: Browse 26,427 Magic cards with powerful filtering
- Multi-theme filtering (up to 5 themes), color identity, type, rarity, CMC, power/toughness
- Six sorting options including EDHREC popularity
- Infinite scroll with cursor-based pagination
- Shareable filter URLs
- **Keyboard Shortcuts**: Efficient navigation
- `Enter`: Add first autocomplete match
- `Shift+Enter`: Apply filters
- `Esc` (double-tap): Clear all filters
- Desktop-only help button with keyboard shortcuts reference
- **Responsive Design**: Mobile-optimized with adaptive grid layout and touch-friendly controls
- **Card Browser**: Browse and search all 29,839 Magic cards at `/browse/cards`
- Smart autocomplete with typo tolerance for card names and themes
- Multi-theme filtering (up to 5 themes)
- Color, type, rarity, CMC, power/toughness filters
- Multiple sorting options including EDHREC popularity
- Infinite scroll with shareable URLs
- **Card Detail Pages**: Individual card pages with similar card suggestions
- Enable with `ENABLE_CARD_DETAILS=1` environment variable
- Full card stats, oracle text, and theme tags
- Similar cards based on theme overlap with color-coded scores
- Card preview on hover
- **Similarity Cache**: Pre-computed card similarities for instant page loads
- Build cache with `python -m code.scripts.build_similarity_cache_parquet --parallel`
- Control with `SIMILARITY_CACHE_ENABLED` environment variable
- **Keyboard Shortcuts**: Quick navigation
- `Enter` to add autocomplete matches
- `Shift+Enter` to apply filters
- Double `Esc` to clear all filters
### Changed
- **Theme Catalog**: Improved generation to include more themes and filter out ultra-rare entries
- **Card Database**: Expanded to 29,839 cards (from 26,427)
- **Theme Catalog**: Improved coverage and filtering
### Removed
- **Unused Scripts**: Removed redundant `regenerate_parquet.py`
### Fixed
_No unreleased changes yet._
- **Card Browser**: Improved UI consistency and image loading
- **Infinite Scroll**: No more duplicate cards when loading more
- **Sorting**: Sort order now persists correctly across pages