Improvements to album header visibility & control#234
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughReplaces parameterized header initialization with setHeaderStateFromTracks/refreshHeaderState, adds a headerManual flag, and updates initialization, key handlers, overlays, playback flows, and Model.Update handlers to recompute header visibility after playlist mutations. ChangesHeader State Refresh Refactoring
Sequence DiagramssequenceDiagram
participant User
participant Handler as UI Handler
participant Playlist
participant HeaderUI as Header State
User->>Handler: action (enter, R, a, q, play, ctrl+h)
Handler->>Playlist: Add/Replace tracks
Handler->>HeaderUI: refreshHeaderState() / setHeaderStateFromTracks()
HeaderUI->>Playlist: Tracks()
HeaderUI->>HeaderUI: computeHeaderState
sequenceDiagram
participant Events as Event/Message
participant UpdateHandler
participant Playlist
participant HeaderUI as Header State
Events->>UpdateHandler: tracksLoaded, navTracksLoaded, ytdlBatch, etc.
UpdateHandler->>Playlist: Replace or Add tracks
UpdateHandler->>HeaderUI: refreshHeaderState() / setHeaderStateFromTracks()
HeaderUI->>Playlist: Tracks()
HeaderUI->>HeaderUI: computeHeaderState
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ui/model/view_helpers.go`:
- Around line 223-225: refreshHeaderState currently always sets
m.showAlbumHeaders from m.playlist.Tracks(), which breaks header heuristics for
non-playlist flows; restore source-specific computation by changing
refreshHeaderState to only apply when the visible list is the current playlist
and add/use the helper m.setHeaderStateFromTracks(tracks) to derive
m.showAlbumHeaders via isListCohesive(tracks) in playlist-manager and
nav-browser loaders and any other non-playlist callers so each caller computes
headers from its visible track slice instead of always using
m.playlist.Tracks().
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 3391f6ef-458b-4709-91cd-15afd5a0ff89
📒 Files selected for processing (7)
ui/model/init.goui/model/keys.goui/model/keys_nav.goui/model/overlays.goui/model/playback.goui/model/update.goui/model/view_helpers.go
Previously, whether or not to show album headers was only decided on application launch, or when the entire playlist was replaced. This PR ensures the layout stays in sync as content changes, while also respecting manual user preference.
Changes
ctrl+h.Summary by CodeRabbit
Refactor
New Features
Bug Fixes