feat(search): the Tracks results use the app's full track row

Search already mounted the shared TrackRow, but had never switched on
any of its affordances: no artwork, no artist link, no album column. So
the one surface where people are most often hunting for an album gave
them no way to reach it except the context menu's "Go to", three clicks
deep, while every other track list in the app links straight through.

Turning the arms on is most of it. The missing half was in Rust:
`search_qt::TrackRow` carried `albumId` but not the album TITLE, and the
row draws `item.album` as the column's label and uses `item.albumId` for
the click — so without the title the column would render empty and the
link would be invisible. `track.album` was already being read one line
above for the id.

No layout work: TrackCols already reserves the album cell and its gap
behind the same `showAlbum` flag, so the widths redistribute themselves.

Verified by driving the app: a search for "beatles", the Tracks tab, and
a click on "Abbey Road" in a row opens Abbey Road (Super Deluxe Edition).

cc
This commit is contained in:
vicrodh committed 2026-08-22 01:43:50 -06:00
1 parent cf07f10a59
commit 7fc7605887
2 files changed
+29

No files matched your search

+18
View File
@@ -828,6 +828,24 @@ Rectangle {
item: modelData
number: index + 1
menuShowFavorite: false
// THE ROW'S OWN AFFORDANCES, which this call
// site had never switched on. TrackRow draws
// an artwork thumb, a clickable artist and a
// clickable album column, and search left all
// three off — so the only way from a result to
// its album was the context menu's "Go to",
// three clicks deep, on the surface where
// people are most often hunting for exactly
// that (owner smoke 2026-08-22).
//
// Nothing here is new machinery: every other
// track list in the app already mounts the row
// this way, and `search_qt::TrackRow` now
// carries the album TITLE the column needs to
// have something to draw.
showArtwork: true
showAlbum: true
artistLink: true
onPlayRequested: QbzPlayer.playTrack(item.id)
onEnqueueRequested: function (m) { QbzPlayer.enqueueTrack(item.id, m) }
// MyQBZ "Add to mixtape" — the HOST builds the
+11
View File
@@ -191,6 +191,11 @@ pub struct TrackRow {
pub artist: String,
#[serde(rename = "artistId")]
pub artist_id: String,
/// The album's TITLE. `album_id` alone is not enough for the row's album
/// column: TrackRow.qml draws `item.album` as the label and uses
/// `item.albumId` for the click, so without this the column renders empty
/// and the only way to the album is the context menu.
pub album: String,
#[serde(rename = "albumId")]
pub album_id: String,
pub duration: String,
@@ -375,6 +380,11 @@ fn map_track(track: &Track) -> TrackRow {
.and_then(|a| a.image.best().cloned())
.unwrap_or_default();
let album_id = track.album.as_ref().map(|a| a.id.clone()).unwrap_or_default();
let album = track
.album
.as_ref()
.map(|a| a.title.clone())
.unwrap_or_default();
let (artist, artist_id) = track
.performer
.clone()
@@ -390,6 +400,7 @@ fn map_track(track: &Track) -> TrackRow {
title,
artist,
artist_id,
album,
album_id,
duration: mmss(track.duration),
quality_tier: tier(track.maximum_bit_depth).to_string(),