feat: Add album view and fix volume slider#6
Conversation
Review Summary by QodoAdd album view and fix volume slider with NAudio routing
WalkthroughsDescription• Add album browsing view with grid display and album detail pages • Fix volume slider by routing all playback through NAudio with proper volume tracking • Update installer version to 0.0.6 • Improve audio engine documentation and add equalizer/accent color features to README Diagramflowchart LR
A["ViewMode Enum"] -->|"Add Albums, AlbumDetail"| B["Navigation System"]
B -->|"NavAlbums_Click"| C["BuildAlbumsGrid"]
C -->|"Display album cards"| D["AlbumsGridView"]
D -->|"ItemClick"| E["AlbumDetail View"]
E -->|"Filter tracks by album"| F["TrackListView"]
G["AudioPlayerService"] -->|"Track volume state"| H["Volume Property"]
H -->|"Set AudioFileReader.Volume"| I["NAudio Playback"]
I -->|"Apply mute/unmute"| J["WasapiOut"]
File Changes1. Audiomatic/MainWindow.xaml.cs
|
Code Review by Qodo
1. Wrong theme brush lookup
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThis PR introduces album browsing and detail views to the UI with asynchronous artwork loading, refactors volume state management in the audio service to use an internal source of truth, and updates documentation and version information. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant MainWindow
participant TrackData
participant ArtworkLoader
participant UI as GridView
User->>MainWindow: Click Albums in Navigation
MainWindow->>MainWindow: Switch to Albums ViewMode
MainWindow->>TrackData: Group tracks by Album<br/>(case-insensitive)
loop For Each Album
MainWindow->>ArtworkLoader: LoadAlbumCardArtAsync()
ArtworkLoader->>ArtworkLoader: Fetch embedded art<br/>or fallback cover
ArtworkLoader->>UI: Update album card image
end
MainWindow->>UI: Render album cards<br/>(title, artist, count)
User->>UI: Click album card
UI->>MainWindow: AlbumGrid_ItemClick()
MainWindow->>MainWindow: Switch to AlbumDetail<br/>ViewMode
MainWindow->>TrackData: Filter tracks to album<br/>Sort by TrackNumber, Title
MainWindow->>MainWindow: Show AlbumHeader<br/>with album name
MainWindow->>UI: Display album tracks
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can suggest fixes for GitHub Check annotations.Configure the |
| var artGrid = new Grid | ||
| { | ||
| Width = 142, | ||
| Height = 142, | ||
| CornerRadius = new CornerRadius(8), | ||
| Background = (Brush)Application.Current.Resources["CardBackgroundFillColorSecondaryBrush"] | ||
| }; |
There was a problem hiding this comment.
1. Wrong theme brush lookup 🐞 Bug ✓ Correctness
BuildAlbumsGrid reads CardBackgroundFillColorSecondaryBrush via Application.Current.Resources, which (per ThemeHelper) resolves using the system theme rather than the app’s current RequestedTheme, so album cards can render with the wrong background when the app theme differs from the OS theme. This makes the Albums UI inconsistent with the rest of the app’s theme-aware styling.
Agent Prompt
## Issue description
`BuildAlbumsGrid()` uses `Application.Current.Resources["CardBackgroundFillColorSecondaryBrush"]` directly, which bypasses the repo’s `ThemeHelper.Brush()` logic and can render with the system theme instead of the app’s current theme.
## Issue Context
`ThemeHelper` documents that `Application.Current.Resources` lookups use the system theme, and the codebase generally uses `ThemeHelper.Brush(...)` to resolve theme-dictionary brushes correctly.
## Fix Focus Areas
- Audiomatic/MainWindow.xaml.cs[2525-2532]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| if (_viewMode == ViewMode.Visualizer || _viewMode == ViewMode.Albums) | ||
| return; |
There was a problem hiding this comment.
2. Albums grid not refreshed 🐞 Bug ✓ Correctness
ApplyFilterAndSort returns early in Albums mode, so LoadTracks (invoked after scans and metadata edits) won’t rebuild AlbumsGridView and the Albums view can become stale. NavAlbums_Click also returns when already in Albums, preventing an in-place rebuild/refresh while staying in Albums view.
Agent Prompt
## Issue description
Albums view does not refresh after library changes because `LoadTracks()` calls `ApplyFilterAndSort()`, but `ApplyFilterAndSort()` returns early for `ViewMode.Albums` and never calls `BuildAlbumsGrid()`. Additionally, `NavAlbums_Click()` returns immediately when `_viewMode == ViewMode.Albums`, preventing an in-place rebuild.
## Issue Context
`LoadTracks()` is invoked after metadata edits and after scanning folders, so this impacts real user flows.
## Fix Focus Areas
- Audiomatic/MainWindow.xaml.cs[296-318]
- Audiomatic/MainWindow.xaml.cs[2485-2495]
- Audiomatic/MainWindow.xaml.cs[1668-1678]
- Audiomatic/MainWindow.xaml.cs[3806-3813]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Summary by CodeRabbit
Release Notes
New Features
Refactor