Update CLAUDE.md with completed features

- Replace implementation plan with feature documentation
- Document all keybindings
- Add technical details about MPV IPC
- List UI layout structure
- Mark all phases as complete
This commit is contained in:
Christoffer Martinsson 2025-12-06 13:15:02 +01:00
parent 81908beb75
commit e44c9e5bba

View File

@ -38,40 +38,40 @@ paths = [
4. Playback uses cached file paths 4. Playback uses cached file paths
5. Rescan command/keybinding to refresh cache 5. Rescan command/keybinding to refresh cache
### Implementation Plan ## Features
**Phase 1: Foundation + Cache System (CRITICAL)** ### Core Functionality
- Create Cargo.toml with dependencies (ratatui, crossterm, libmpv-rs, tokio, serde) - **Cache-Only Operation** - Browse media from cached file structure, no direct filesystem access
- Set up cache directory structure (XDG_CACHE_HOME/cm-player/) - **MPV Integration** - Playback via MPV IPC (subprocess), no library linking required
- Implement cache serialization/deserialization - **Playlist Management** - Play single files, entire directories, or marked files
- File metadata cache schema (path, size, duration, codec, hash) - **File Marking** - Mark multiple files to create custom playlists
- Config file parsing (scan paths) - **Tree Navigation** - Vim-style keybindings for browsing collapsible directory structure
- Basic TUI two-panel layout - **Manual Library Refresh** - User-controlled scanning with 'r' key
- State management with cache integration
**Phase 2: File Scanner with Caching** ### UI Layout (cm-dashboard style)
- Directory traversal with media filtering (.mp3, .mp4, .mkv, .flac, etc.) - **Title Bar** - Shows player state (Playing/Paused/Stopped/Refreshing)
- Write all metadata to cache immediately - **Left Panel** - Cached media file tree with vim navigation
- Load from cache on startup (instant) - **Right Panel** - Player info (progress, volume) + Playlist view
- Background refresh/validation - **Status Bar** - Centered help text with all keybindings
- Display cached structure in left panel with tree navigation
**Phase 3: MPV Integration** ### Keybindings
- Initialize libmpv - `j/k` or `↑↓` - Navigate files
- Playback from cached file paths - `h/l` - Collapse/expand directories
- Status display in right panel - `t` - Mark/unmark file
- Event handling (position, duration, state) - `c` - Clear all marks
- `Enter` - Play (priority: marked files > directory > single file)
- `Space` - Pause/resume
- `← →` - Seek backward/forward 10 seconds
- `+ -` - Volume up/down by 5%
- `n/p` - Next/previous track in playlist
- `r` - Rescan library (manual refresh)
- `q` - Quit
**Phase 4: Player Controls** ### Technical Details
- Keyboard shortcuts (space: pause, q: quit, arrows: navigate/seek, r: rescan) - **MPV IPC** - Communicates with mpv via Unix socket and JSON protocol
- Volume control - **No Version Lock** - Uses mpv binary, not libmpv library (avoids version mismatch)
- Progress bar - **Logging** - Redirected to `/tmp/cm-player.log` to avoid TUI interference
- Playlist/queue (cached) - **Auto-advance** - Automatically plays next track when current ends
**Phase 5: Polish**
- Error handling
- Bandwidth optimization validation
- CI integration with release workflow
## Automated Binary Release System ## Automated Binary Release System