Add playing indicator arrow in playlist
All checks were successful
Build and Release / build-and-release (push) Successful in 54s

Display a small arrow (▶) to the left of the currently playing track in the playlist, making it easier to identify which song is playing.
This commit is contained in:
Christoffer Martinsson 2025-12-12 12:57:12 +01:00
parent 0ec328881a
commit 0fa26db116
2 changed files with 10 additions and 5 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "cm-player"
version = "0.1.27"
version = "0.1.28"
edition = "2021"
[dependencies]

View File

@ -321,12 +321,17 @@ fn render_right_panel(frame: &mut Frame, state: &mut AppState, area: Rect, _tab_
let is_selected = state.focus_playlist && idx == state.selected_playlist_index;
let is_playing = idx == state.playlist_index;
// Add playing indicator arrow
let indicator = if is_playing { "" } else { " " };
// Build line with search highlighting if searching
let line = if in_playlist_search && !playlist_search_query.is_empty() {
Line::from(highlight_search_matches(&filename, &playlist_search_query, is_selected))
let mut line_spans = vec![Span::raw(indicator)];
if in_playlist_search && !playlist_search_query.is_empty() {
line_spans.extend(highlight_search_matches(&filename, &playlist_search_query, is_selected));
} else {
Line::from(filename)
};
line_spans.push(Span::raw(filename));
}
let line = Line::from(line_spans);
let style = if is_selected && is_playing {
// Both selected and playing: selection bar with bold