feat(qt): collapsible rows in the My QBZ detail, and ephemeral leaves no trace
**The accordion the owner asked for.** Each expandable row gets a chevron; clicking it opens THAT row's tracks inline and nothing else. Verified by driving the real app: in list mode every row is collapsed with the chevron pointing right, clicking row 3 — a PLEX row, so the hybrid path — flips its chevron, renders its three tracks with durations and quality badges, and leaves rows 1, 2, 4 and 5 untouched. This is a DELIBERATE divergence from both references, decided by the owner with the facts in hand: neither Slint nor Tauri has a per-row accordion. Both render inline tracks only as a view MODE, for every row at once, and both say "no chevron" in their own comments (MixtapeDetailView.slint:1139, MixtapeCollectionDetailView.svelte:124-127). The owner first believed Tauri had it, asked for the code to be checked rather than the comment, and on the evidence chose the accordion anyway. Do not "restore parity" by removing it. Built additively on machinery that already existed: the document already carried `canExpand` / `inlineTracks` / `expandLoading` / `tracksLoaded`. What was added is per-row OPEN state in Rust, a toggle invokable, and lazy per-row fetching — opening a row fetches only its tracks, once. The "expanded" view mode survives and now means "open all", sharing ONE notion of open rather than a second parallel state. Also here: - `body`'s `anchors.bottomMargin: 100` shrank the list VIEWPORT; in the .slint that 100px is padding INSIDE the Flickable, i.e. scroll runway. Measured on screen before the fix: the last row clipped mid-height with ~85px of dead band under it. - `apply_resolved` cloned and serialised the WHOLE document per resolved item (34 serialize→parse→patch cycles for one collection, 200 for a big one, on the GUI thread), and `patch_expanded` did the same while the document carried every loaded item's inline tracks — O(n²). - The DEAD affordances the audit filed against the modals and the grids. **Ephemeral honours its name** (owner rule): an ephemeral folder plays and queues, and writes nothing durable. Recently Played and Most Played are now guarded — an ephemeral album played through would previously have outranked real albums in Most Played, one row per track start. The Slint reference does NOT have this exemption; that is a gap in both frontends, not a Qt regression, and this does not restore parity by removing it. Two stores were deliberately NOT changed and need the owner's word: the scrobblers and Discord presence. Neither is "las bibliotecas" — nothing is stored on our side — but both publish the track to a third party, so if "ni now playing ni nada" is meant literally they belong in the same decision. The one-line fix location is in the lane report. cc
This commit is contained in:
10 files changed
+912
-101
No files matched your search
@@ -346,11 +346,18 @@ Item {
|
||||
ListView {
|
||||
id: pickList
|
||||
visible: !root.loading && root.rows.length > 0
|
||||
// The .slint's `padding: 8` on the list layout, on all
|
||||
// FOUR sides. The horizontal half is an ANCHOR margin on
|
||||
// the view, never an `x` on the delegate: a vertical
|
||||
// ListView writes its delegates' `x`, so a literal `x: 8`
|
||||
// there is silently clobbered to 0 and the rows sat flush
|
||||
// against the card's left border with a 16px gap opening
|
||||
// on the right (the hover fill and the zebra band touched
|
||||
// the border on one side only). The vertical half stays a
|
||||
// Flickable content margin.
|
||||
anchors.fill: parent
|
||||
// The .slint's `padding: 8` on the list layout. The
|
||||
// horizontal half is on the DELEGATE, not as a Flickable
|
||||
// margin: a vertical ListView's leftMargin moves the
|
||||
// content origin, it does not inset the rows.
|
||||
anchors.leftMargin: 8
|
||||
anchors.rightMargin: 8
|
||||
topMargin: 8
|
||||
bottomMargin: 8
|
||||
spacing: 2
|
||||
@@ -363,8 +370,7 @@ Item {
|
||||
delegate: AddPickRow {
|
||||
required property var modelData
|
||||
required property int index
|
||||
x: 8
|
||||
width: Math.max(0, pickList.width - 16)
|
||||
width: pickList.width
|
||||
rowData: modelData
|
||||
rowIndex: index
|
||||
}
|
||||
@@ -417,6 +423,25 @@ Item {
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
clip: true
|
||||
selectByMouse: true
|
||||
// LOAD-BEARING, and the exact shape `searchInput`
|
||||
// above uses (:242 + its Binding). With ONLY the
|
||||
// focus-gated Binding below, a re-entered create
|
||||
// panel kept the previously typed name on screen
|
||||
// while `createName` had already been reset to ""
|
||||
// — the field never re-seeds because it keeps
|
||||
// activeFocus across the hide/show (the panel is
|
||||
// only `visible: false` for a frame, focus comes
|
||||
// straight back), so the `when:` guard never
|
||||
// fires. `canCreate` was then false with a name
|
||||
// visibly in the box: "Create & Add" sat at 50 %
|
||||
// with a dead MouseArea and Enter did nothing.
|
||||
// Repros: chip -> type -> Back -> chip; and
|
||||
// type -> close -> reopen into the create panel.
|
||||
// A declarative `text:` survives user editing (the
|
||||
// edit does not break the binding), and
|
||||
// `onTextEdited` writes the same value straight
|
||||
// back, so typing is unaffected.
|
||||
text: root.createName
|
||||
onTextEdited: root.createName = text
|
||||
onAccepted: {
|
||||
if (root.canCreate)
|
||||
|
||||
@@ -315,7 +315,14 @@ Item {
|
||||
QbzTextArea {
|
||||
visible: editPanel.isDescription
|
||||
width: parent.width
|
||||
height: visible ? 96 : 0
|
||||
// A FLAT 96, never `visible ? 96 : 0`: a Column does not
|
||||
// position invisible children, so the hidden arm already
|
||||
// costs no layout height, while a 0-height text area
|
||||
// hands its inner Flickable height = 0 - 8 - 8 = -16 —
|
||||
// the silent negative-size trap QbzLineEdit.qml:166-167
|
||||
// documents. The sibling QbzLineEdit is single-line and
|
||||
// lands at a clean 0, so it keeps its ternary.
|
||||
height: 96
|
||||
wrapMode: TextEdit.WordWrap
|
||||
text: editPanel.draftDescription
|
||||
onEdited: function (v) { editPanel.draftDescription = v }
|
||||
|
||||
Reference in new issue
Block a user