fix(qbz-qt): covers were never actually resized, plus the adversarial parity round

**The scaled-cover fix from the last round produced nothing.** The seam ran —
462 requests in one offscreen smoke — and wrote zero files, so the owner was
right that nothing improved. The artwork cache stores files as `.img`, and
`image::open` picks its decoder from the EXTENSION, so every call failed
silently. Sniffing the content instead yields 101 derivatives on the same run.
The header atmosphere had the identical bug and had therefore never produced an
image either, which is why the flat fallback was all anyone ever saw.

Reported as fixed last round without checking that it ran. Verified by effect
this time, not by reading the diff.

The rest came through an analyse / refute / implement / verify pipeline, and the
adversarial passes earned their keep:

- The sidebar mini rail: icons sat left of centre because their slot kept its
  fixed 24px width while the rail collapsed, so the hit target was rectangular
  and off-axis. The rail narrows, rows are square, and the mini state gains the
  folder flyout and tooltips it never had. The reviewer caught a comment
  claiming the width change was a one-token revert when it is two — corrected
  rather than left to mislead the next reader.
- Playback context now travels from every producer, not the handful that
  happened to stamp it.
- Collapsible per-tab search in Library, and label artwork.
- Every View-all destination Home offers, plus the label page and its releases.
- Collapsing the sidebar drops a Large bar back to New, live, without
  overwriting the user's persisted preference.

cc
This commit is contained in:
vicrodh committed 2026-07-29 00:06:34 -06:00
1 parent 2a5b5ac16e
commit c56fab3c4e
34 files changed
+6234 -201

No files matched your search

@@ -0,0 +1,80 @@
// BrowseGenreButton — the "Filter by genre" trigger
// (discover/BrowseHeaderTools.slint:102-145): accent fill + "N genres" while
// the SHARED selection is non-empty, else a surface-elevated pill reading
// "Filter by genre".
//
// Extracted from HomeView.qml's inline copy so the Home toolbar and the two
// browse pages draw the identical control. The one difference the Slint keeps
// is the height: HomeView.slint:85 is 32px, BrowseHeaderTools.slint:108 is
// 34px (the ui-control-alignment-standard toolbar size) — hence `btnHeight`.
//
// THE BADGE READS THE BRIDGE, NOT THE POPUP. `GenreFilterPopup` is declared
// LAST in every host (declaration order is z-order) and a creation-time
// binding that dereferences a not-yet-created id registers NO dependency, so
// it would never re-evaluate. The count is parsed straight off
// `QbzBridge.genreFilterJson` here, per context.
import QtQuick
import com.blitzfc.qbz
import "../theme"
Rectangle {
id: root
/// "discover" | "library-all" — whose selection this button reports.
property string context: "discover"
property int btnHeight: 34
signal clicked()
QbzTheme { id: theme }
readonly property var genreDoc: {
try {
return JSON.parse(QbzBridge.genreFilterJson)
} catch (e) {
return {}
}
}
readonly property int count: (genreDoc.counts || {})[root.context] || 0
readonly property bool active: root.count > 0
width: genreRow.width
height: btnHeight
radius: 6
color: root.active ? theme.accent
: genreArea.containsMouse ? theme.surfaceHover : theme.surfaceElevated
Row {
id: genreRow
height: parent.height
leftPadding: 12
rightPadding: 14
spacing: 7
QbzIcon {
name: "list-filter"
width: 14
height: 14
anchors.verticalCenter: parent.verticalCenter
tintName: root.active ? "primary" : "secondary"
}
Text {
text: root.count === 0
? QbzSession.tr("Filter by genre", QbzSession.trRev)
: root.count === 1
? QbzSession.tr("1 genre", QbzSession.trRev)
: QbzSession.tr("{} genres", QbzSession.trRev).replace("{}", root.count)
color: root.active ? theme.accentText : theme.textSecondary
font.pixelSize: 13
font.weight: root.active ? theme.weightMedium : theme.weightRegular
anchors.verticalCenter: parent.verticalCenter
}
}
MouseArea {
id: genreArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: root.clicked()
}
}
@@ -0,0 +1,62 @@
// QbzToggleButton — 1:1 port of primitives/ToggleButton.slint: one half of a
// segmented toggle (grid/list) or a standalone toolbar toggle (group-by /
// Hi-Res). Shared by every album-toolbar surface in the Slint (Discover
// Browse, Label Releases, Favorites), so it is shared here too.
//
// Numbers, read off ToggleButton.slint:
// :22 34px square (30px with `sm`) :35 glyph 17px (15px with `sm`)
// :25 active -> surface-hover fill, text-primary glyph
// :30 hover -> surface-elevated fill
// idle -> transparent fill, text-muted glyph
//
// NOT QbzToggle.qml — that one is the on/off SWITCH (checked/toggled(bool)).
//
// LIGHT-THEME CORRECTNESS: icon tints are PRE-BAKED SVG colours
// (assets/icons/<tint>/), and the "primary" bake is literally #ffffff. On a
// light theme the active glyph would paint white on a near-white fill, so the
// bake is chosen from the LIVE token's lightness — the same rule
// QbzIconButton.qml and QbzCircleAction.qml already carry.
import QtQuick
import com.blitzfc.qbz
import "../theme"
Rectangle {
id: root
property string name: ""
property bool active: false
/// Bootstrap-style small variant (ToggleButton `sm`): 30px, not 34px.
property bool sm: false
property bool btnEnabled: true
signal clicked()
QbzTheme { id: theme }
readonly property string tintStrong: theme.textPrimary.hslLightness > 0.5 ? "primary" : "black"
width: sm ? 30 : 34
height: sm ? 30 : 34
radius: 6
opacity: btnEnabled ? 1.0 : 0.35
color: root.active
? theme.surfaceHover
: (tbArea.containsMouse && root.btnEnabled ? theme.surfaceElevated : "transparent")
QbzIcon {
name: root.name
width: root.sm ? 15 : 17
height: root.sm ? 15 : 17
anchors.centerIn: parent
tintName: root.active ? root.tintStrong : "muted"
}
MouseArea {
id: tbArea
anchors.fill: parent
enabled: root.btnEnabled
hoverEnabled: true
cursorShape: root.btnEnabled ? Qt.PointingHandCursor : Qt.ArrowCursor
onClicked: root.clicked()
}
}
@@ -0,0 +1,45 @@
// ViewModeToggle — discover/BrowseHeaderTools.slint:149-173, verbatim: the
// 68x34 grid/list pair, radius 6, surface-elevated, CLIPPED so the segments'
// own corners never poke out.
//
// NOT views/local/LocalSegToggle.qml — that one is 60x30 with 26x24 segments
// (LocalLibraryView.slint's own ViewToggle) and reusing it here would ship a
// browse toolbar 8px short of every other control on the row
// (ui-control-alignment-standard: 34px).
//
// `mode` is the caller's state ("grid" | "list"); the toggle only reports the
// change — the host owns persistence, exactly like the Slint two-way binding.
import QtQuick
import com.blitzfc.qbz
import "../theme"
Rectangle {
id: root
property string mode: "grid"
signal setMode(string value)
QbzTheme { id: theme }
width: 68
height: 34
radius: 6
color: theme.surfaceElevated
clip: true
Row {
anchors.centerIn: parent
spacing: 0
QbzToggleButton {
name: "layout-grid"
active: root.mode !== "list"
onClicked: root.setMode("grid")
}
QbzToggleButton {
name: "list"
active: root.mode === "list"
onClicked: root.setMode("list")
}
}
}