Commit Graph
14 Commits
Author SHA1 Message Date
vicrodh 5e6daf0e81 feat(qt): Open containing album on cortinilla track rows
CortRow gains an albumId — the Qobuz album id for catalog tracks, the
album group key for local ones (both are what crate::open_album routes),
empty elsewhere. The track menu gates its new entry on the field, the
action funnels through cortinillaMenuAction like its siblings, and the
new msgid ships in the seven non-English locales.

cc
2026-08-31 11:26:17 -06:00
vicrodh 712a0d1903 feat(qt): focus-driven cortinilla lifetime
Drop the Slint-inherited 4.5s/30s idle auto-close (and its hover-latch
machinery): while the header search field keeps focus the dropdown stays
open, like a combobox. What closes it is explicit — the click-outside
scrims (which now also hand the keyboard to the shell root, the same
duck-walk Escape uses), Escape, activating a row, or a page change. One
timer fewer, per the repaint-pulse doctrine.

cc
2026-08-31 11:25:57 -06:00
vicrodh fdc77b0c93 style(qbz-qt): improve search quality legibility
cx
2026-08-26 01:50:20 -06:00
vicrodh d45e7d9430 feat(qbz-qt): enrich search curtain results
cx
2026-08-26 00:56:24 -06:00
vicrodh c2944db973 feat(qt): source-aware playback, session persistence and loading affordances
One batch, committed together because the changes interleave in main.rs and
splitting them after the fact would be a fiction.

Playback routing: a track now carries its source, so a local or Plex row played
from Discover stops being resolved against Qobuz first (the 404s and the long
silent wait before audio). Jellyfin and Navidrome land on the same seam.
Plex tracks stream through the player instead of downloading whole files first;
the feeder moved into qbz-player so both frontends can reach it.

Session persistence, both levels the port was missing:
  - The startup-page preference is finally read. It had been rendering and
    persisting a value nothing consumed. `last_view` is written in the SHARED
    ui_prefs vocabulary, not this port's route ids -- four of the six differ,
    and writing the raw ids would have silently broken the other frontend's
    restore. `on_session_entered` recorded "home" unconditionally, which also
    rewrote last_view on every boot, so the setting could not survive its own
    startup.
  - Queue and active track survive a restart. session_persist was tied to a
    frontend by exactly one type alias, so it moved to qbz-app generic over the
    adapter rather than being copied. Verified end to end: the snapshot restored
    here had been written by the Slint binary, and the exit flush keeps an
    un-consumed resume position instead of overwriting it with the engine's
    idle 0.

Loading affordances: the transport shows a spinner from the moment a play is
dispatched, and the restored session explicitly takes it back down -- a
restored track has no dispatch behind it and no audio ahead of it, so nothing
would ever have cleared it. Cortinilla results now navigate at album and artist
level.

Verified by the offscreen smoke gate and by driving a restore/quit cycle over
MPRIS.

cc
2026-08-13 23:10:32 -06:00
vicrodh b38b0b3d57 feat(qt): instant cached cortinilla paint (default on, ui_prefs opt-out)
The reference shows a skeleton while loading and never paints cached rows
first, and its comments present that as the design. It is not: the instant
paint existed during development and was removed because it GLITCHED -
results visibly jumped between the cached paint and the fresh one. The
owner's reading is that the glitch was a Slint rendering problem rather than
something inherent to stale-while-revalidate, so it comes back here as a
reversible experiment: DEFAULT ON, with a ui_prefs opt-out
(cortinilla_instant_paint) that needs no rebuild to flip. The skeleton path
stays fully implemented as both the opt-out target and the cold-miss path.

What is cached is the FINISHED payload, not the API response. Reviving the
existing CAPA A result cache would have left the expensive half on the table:
a cortinilla payload is the response AFTER ranking, truncation, i18n titles,
the top-result pick and - the part no API cache can shortcut - the local
library query and its derived grouping.

qbz-app gains a generic PayloadCache<T>. The store never inspects T, which is
what lets both frontends share it despite their payload types having diverged
(one raw artwork_url vs an art_url/art_path pair). In-memory only: process
lifetime IS the TTL, because a payload embeds local rows and resolved artwork
paths and a persisted entry would resurrect albums the user has deleted.

Four properties are what should keep it from glitching, and each is a real
constraint rather than a hope:

  - Same shape in both paints. The entry is written AFTER the local sections
    are appended, so there is no mid-apply reflow left to see.
  - Equality-gated replacement. CortinillaData derives PartialEq, so an
    unchanged repeat query produces ZERO second paint.
  - The selection survives - the publish path never writes selectedIndex.
  - The scroll survives - C5's contentY latch. Without it the second paint
    yanks the user to the top, which is the glitch by another name.

There are exactly TWO write points, and the placement is load-bearing: after
pass-1 artwork resolution, and again at the pass-2 republish once downloaded
covers land. Writing earlier caches rows with empty art_path, and since the
QML draws art_path only, a hit would paint cover-less rows AND the gate would
fire on every hit - the exact repaint this exists to avoid.

Invalidation: bound per session, dropped on logout, and cleared from
reload_browse - the single chokepoint every local-library mutation passes
through, since there is no library-changed signal to subscribe to.

Also fixes the immersive skeleton's scope bug, which is the twin of the one
C4b fixed on the desktop and which I missed there: a Timer derives from
QtObject, which has no parent property, so the unqualified parent resolved
out of the block entirely - the timer ran forever, pulse never changed, and
the skeleton never pulsed. Found by qmllint, not by reading. It picks up the
reduceMotion tick with the fix.

Contract: qbz-nix-docs/qt-frontend/2026-08-03-cortinilla-parity, commit C11
(section 5.c, rulings R1/R6, R7-10).

Gate: build clean, 258/258 tests + 2 new in qbz-app, both QML audits OK,
qmllint clean on both cortinillas, offscreen smoke 0 complaints + home
published.

cc
2026-08-03 18:09:04 -06:00
vicrodh 06e8b4ba4d fix(qt): pass the cortinilla row's block padding in instead of reading parent
The row width read parent.leftPadding / parent.rightPadding. It works at
runtime - the parent is always a Column that has them - but `parent` is typed
QQuickItem, which does not, so qmllint cannot verify it and a wrong mount
would fail silently at runtime instead of loudly in the audit. Parent-chain
bindings are a documented trap in this port for exactly that reason.

The padding is now a property each mount site sets. Cortinilla.qml is
qmllint-clean.

Found by running qmllint over the files this branch touched, after two
identifiers were written before being verified against the source - a
Flickable forceLayout() that does not exist, caught by the smoke, and a
tracksQuery property that does not exist, caught by reading. Neither the
resolution audit nor the singleton xref can see this class of error: they
check component types and BRIDGE members, not view-local properties. qmllint
does, and it is now part of the gate.

cc
2026-08-03 17:42:04 -06:00
vicrodh 263b82a694 fix(qt): cortinilla robustness - scroll latch, hover, hasTop, index guard
Six defects, plus one owner-requested behaviour change.

  - The document is now applied imperatively instead of bound. cortinillaJson
    is republished wholesale when the artwork pass lands, about 1.5s after
    the rows, and a bound Repeater model made that a full model reset: every
    delegate destroyed and rebuilt, contentHeight momentarily 0, and
    StopAtBounds clamping contentY to 0. The user was yanked back to the top
    mid-read. The offset is latched and restored via Qt.callLater - NOT
    forceLayout(), which is a QQuickItemView method and does not exist on a
    plain Flickable; calling it threw a TypeError and clamped against a stale
    contentHeight.

  - panelHovered could latch true forever: if the panel went invisible while
    the pointer was over it, the hover source never reported false again.

  - Hover detection moved from a MouseArea to a HoverHandler. The MouseArea
    was declared first, so the Flickable and every row's MouseArea sat on top
    of it and took the hover events - containsMouse stayed false across most
    of the panel, which is why hovering did not hold the dropdown open. A
    plain MouseArea stays behind it purely to swallow background clicks.

  - hasTop tested the top row's id for emptiness. Local ARTIST rows carry an
    intentionally empty id - routing is by name - so the top-result block
    would have vanished for them once the local sections land. It now trusts
    the Option the payload already models.

  - The row click passed flatIndex raw across the i32 boundary, where
    undefined coerces to 0 - the top result's index - so a malformed row
    would activate the wrong thing rather than nothing. The highlight already
    guarded; the action now does too.

  - The nested Repeaters both used an unqualified modelData. It resolves
    correctly today, but one added `required` on the inner delegate would
    silently flip every row to render its section. Both are named now.

  - LAST_CORT's locks no longer unwrap(). row_clicked and move_selection are
    invokable bodies, i.e. Qt GUI thread, so a poisoned lock there would take
    the UI down over a snapshot that is stale at worst.

OWNER DIVERGENCE (2026-08-03, unplanned): hovering the panel no longer
pauses the idle timer indefinitely - it stretches it to 30s. The reference
pauses outright, which means a cursor left over the panel by accident holds
it open forever. 30s satisfies both halves of the owner's ask: reading is
never interrupted at 4.5s, and a forgotten cursor still lets it go.

Contract: qbz-nix-docs/qt-frontend/2026-08-03-cortinilla-parity, commit C5
(D-BUG-6/9/10/11/12/13).

Gate: build clean, 258/258 tests, both QML audits OK, offscreen smoke
0 complaints + home published.

cc
2026-08-03 17:07:17 -06:00
vicrodh 4e1703c436 feat(qt): reduceMotion seam and a coarse skeleton tick
The owner ruled 3-C: build the seam here so the kiosk port consumes it
instead of having to invent it. The earlier plan was to wait for kiosk to
define it, but kiosk is not implemented - it is a contract - so "wait for
kiosk" meant waiting on a date that does not exist.

The shape is no longer a guess, which was the only objection to building it
early. Two independent sources fix it: the kiosk contract mandates "FORCED
reduce-motion while in kiosk", and the reference computes the flag as
kiosk_profile || !use_gpu_renderer.

QbzShell.reduceMotion is derived, never a preference - do not add a Settings
row for it. The existing play-indicator toggle is a preference and a
different thing; binding them would make "animate the play indicator" change
this dropdown's pulse rate.

Only the kiosk half is wired, and the omission is deliberate rather than
partial: the renderer tier has no honest source here. It is a QML-side fact,
this port runs on the GPU in every real session, and the one place a probe
would report software is the offscreen smoke, which forces it by definition.
Wiring it would turn reduce-motion on exactly where it means nothing. The
kiosk literal is a named const with a pointer to their contract; flipping it
is one line on their side.

The cortinilla skeleton is the ONE consumer: its single host Timer drops
from 700ms to 2000ms. No new timer, no per-delegate animation - the
reference's own note records that this pulse was the main cost of opening
the cortinilla on weak GPUs.

Giving that Column an id also fixes a real scope bug on the way past. The
Timer read an unqualified `parent`, and Timer derives from QtObject, which
has no parent property - so it resolved up the scope chain, out of the block
entirely. The sibling rectangles' parent.parent[.parent] chains are now
explicit too.

EqualizerBars.qml and the immersive contract's D11 both recorded that Qt had
no reduce-motion twin. Both are corrected: the seam exists, those surfaces
are simply not consumers yet, and wiring each is its own one-liner.

Contract: qbz-nix-docs/qt-frontend/2026-08-03-cortinilla-parity, commit C4b
(section 5.g G1-G5, ruling R10; D-BUG-1 folded in).

Gate: build clean, 258/258 tests, both QML audits OK, offscreen smoke
0 complaints + home published. AC-39: exactly one behavioural consumer.

cc
2026-08-03 16:48:07 -06:00
vicrodh 033b838b98 fix(qt): cortinilla geometry - NPB-aware cap, scrim inset, row width, scroll base
Five geometry defects, all latent while the Qobuz-only panel held at most 14
rows and never scrolled, and all reachable the moment the local sections land.

  - The height cap hardcoded 42 for the now-playing bar in every mode. The
    bar is 42 only in NPB mode 2; everywhere else it is 112, so the panel
    could run up to 70px into it. The cap is now mode-aware, reading the same
    theme tokens AppShell uses. The header height literals in the scrims and
    the panel anchor became theme.headerHeight at the same time.

  - The click-outside scrims left a gap for the search field computed without
    the 60px the field gives up when the section nav sits in the header, so
    with nav-in-header there was a 30px dead strip on each side of the field
    that neither dismissed the panel nor reached the input. The scrim now
    tracks HeaderBar's own width rule exactly.

  - Rows were 12px wider than their block: a QML Column's padding does not
    size its children, and parent.width ignored it. clip hid the overflow,
    but the highlight ran flush to the right edge while staying inset 6px on
    the left.

  - flat_index_content_y started at 6.0, mirroring the panel's 6px top
    padding - which is a Flickable VIEWPORT margin, not content space. Every
    row was reported 6px low, so scroll-into-view over-scrolled going down
    and clipped the row's top going up. The immersive twin, written later
    against the same layout, already started at 0.0.

    Two unit tests now pin the arithmetic. There were none for the desktop
    arm, which is why the 6.0 survived; the immersive arm had its equivalent
    and was correct.

  - The scrollbar used the primitive's default 14px gutter where the
    reference overrides it to 10.

Plus the "Enter" affordance glyph (U+23CE + one space -> U+21B5 + two, as in
the reference) and the panel drop shadow, which reuses the immersive twin's
idiom - a mirror rectangle blurred by MultiEffect, skipped when there are no
shaders - rather than introducing a second shadow mechanism. NavFlyout still
has none and says so; that is its own parity pass.

AppShell's comment claiming the cortinilla is the "LAST child so it renders
above every surface" is corrected: four siblings are declared after it, and
that is fine.

Contract: qbz-nix-docs/qt-frontend/2026-08-03-cortinilla-parity, commit C4
(D-BUG-3/4/5/7, rows A5/A7/A10/A12/A13/A19/A28/A2, UT-1).

Gate: build clean, 258/258 tests (2 new), both QML audits OK, offscreen
smoke 0 complaints + home published.

cc
2026-08-03 16:38:00 -06:00
vicrodh 5a194d2499 fix(qt): move the cortinilla debounce from QML into Rust
The 220ms debounce wrapped the WHOLE searchLive invokable in QML, so live()
- which opens the dropdown and raises the skeleton - only ran 220ms after
the LAST keystroke. Continuous typing therefore showed nothing at all. The
reference opens the panel and raises the skeleton on the FIRST keystroke of
2+ characters and debounces only the LOAD.

live() is now two halves. The synchronous half runs on the first poll of the
spawned task, i.e. at the keystroke: gates, selection reset, open, query,
version bump, loading flag. Then it sleeps 220ms and re-checks the version,
so a superseded task exits without touching the network. This is the shape
the immersive arm already uses (imm_live), which is the precedent in both
respects: raise synchronously, debounce the load.

cortinillaLoading gets exactly one owner in the synchronous half and is
written once more at the publish - never in both halves for the same
keystroke.

Two consequences ride along:

  - dismiss() becomes a real cancellation point. It only flipped the open
    flag, so an in-flight load survived Esc, published into a closed
    dropdown and rewrote LAST_CORT. It now bumps the version too. This
    matters more now that the version bumps per keystroke.
  - the idle-close timer restarts on the QUERY rather than the payload. A
    burst of typing publishes one payload but many queries, and the
    reference restarts per keystroke.

HeaderBar.qml's header claimed the cortinilla and live-search were "out of
scope" in the file that wires the whole input path. Corrected here, beside
the code that falsifies it, rather than in a later docs sweep.

Contract: qbz-nix-docs/qt-frontend/2026-08-03-cortinilla-parity, commit C3
(H1/H2/H3/H8, D-BUG-8, R7-4).

Gate: build clean, 256/256 tests, both QML audits OK, offscreen smoke
0 complaints + home published.

cc
2026-08-03 16:23:06 -06:00
vicrodh dae6c3bb4f fix(qt): publish the live cortinilla query synchronously
Enter and "View more" submitted the PREVIOUS query. With the dropdown open
and nothing selected, HeaderBar calls clearSearch() - which wipes the input -
and then cortinillaSearchAll(), passing no text; search_all_action and
view_more then took the query from LAST_CORT, i.e. the last SUCCESSFULLY
LOADED payload. Type "beatl", let it land, keep typing "beatles", press
Enter while the fetch is in flight: the results page loads for "beatl".

The reference is immune because it publishes the query synchronously per
keystroke (SearchState.cortinilla-query, set before its debounce starts) and
reads that. This does the same: a cortinillaQuery property plus a Rust-side
CORT_QUERY mirror so the two async consumers can read it without a Qt round
trip, both written by one function so they cannot diverge - the discipline
CORT_OPEN already documents for cortinillaOpen.

Two more sites move onto the live query with it:

  - the overlay's visible gate now requires >= 2 characters, matching the
    controller's own gate, so a 1-char query cannot flash a half-empty panel;
  - the "No results for X" line quotes the live query instead of the
    payload's echo, so the empty state stops naming the previous search
    while the user is reading it.

One window stays open and closes in C3: the debounce still lives in QML, so
the query is published when the 220ms timer fires, not on the keystroke
itself. Enter pressed INSIDE that window still carries the previous text.
C3 moves the debounce into Rust, which is what makes the publish truly
per-keystroke.

Contract: qbz-nix-docs/qt-frontend/2026-08-03-cortinilla-parity, commit C2
(D-BUG-2, rows B3/A3/E6/G9/G15).

Gate: build clean, 256/256 tests, both QML audits OK, offscreen smoke
0 complaints + home published.

cc
2026-08-03 16:13:02 -06:00
vicrodh fa433d465b refactor(qt): extract search_bridge.rs from the QbzBridge god-object
QbzBridge carried five domains (Settings, Search, Playlist, Genre filter,
Discover config); its own boot() comment called the split "TEMP (phase 23)".
TRACK-RULES section 2 requires one cxx-qt bridge per domain. This moves the
Search domain out verbatim, ahead of the cortinilla parity work, so the
refactor and the behaviour change stay separately reviewable.

QbzSearch (search_bridge.rs) takes 7 properties and 11 invokables. Two
deliberate changes ride the move:

  - selected_index -> cortinilla_selected_index. It is cortinilla-only
    state and the bare name on an app-wide singleton is a collision hazard.
  - cortinilla_scroll_y f32 -> f64, unifying with the immersive twin in
    immersive_bridge.rs, which was already f64.

cortinilla_query is declared here but not yet wired; C2 wires it, which is
what makes Enter carry the text the user actually typed instead of the last
successfully loaded payload's query.

Every Rust writer of a moving property was re-pointed BY HAND, never by
regex over the multi-line ui() closures: the seven crate::ui( sites in
search_qt.rs plus two that live outside it and that the QML-only xref audit
cannot see - settings_qt.rs (the live Settings > Appearance path) and
main.rs toggle_intelligent_search. All 48 QML consumer sites across
Cortinilla.qml, HeaderBar.qml and SearchView.qml were updated, including the
one Connections block, whose onSelectedIndexChanged handler was renamed with
its property.

A stale 6.0 base in flat_index_content_y is left in place and annotated: it
mirrors a Flickable viewport margin rather than content space, so every row
reports 6px low. C4 corrects it with its unit test; this commit is a move.

Contract: qbz-nix-docs/qt-frontend/2026-08-03-cortinilla-parity, commit C0.

Gate: build clean (no new warnings), 256/256 tests, qml_resolution_audit
214 files, qml_singleton_xref 28 bridges with QbzSearch resolving, offscreen
smoke 0 complaints + home published.

cc
2026-08-03 15:24:25 -06:00
vicrodh 9a4fec6b70 refactor(qbz-qt): phase 23 part 1 — QML module layout + first five domain bridges
Two fronts of the modularization, both gated green before this commit.

QML leaves the flat qml/ directory for seven modules: cards, controls,
rows, settings, shell, theme, views. Only Main.qml and LoginScreen.qml
stay at the root. build.rs matches the tree exactly (55 files), relative
imports and asset paths were re-anchored for the new depth.

The QbzBridge God-object starts breaking up: QbzSession, QbzShell,
QbzPlayer, QbzQueue and QbzHome are now their own #[cxx_qt::bridge]
singletons, each with its own OnceLock<CxxQtThread> and ui() hop, booted
in order from Main.qml. Bridge files stay directly under src/ because
cxx-qt-build only accepts rust_files from one directory (QTBUG-93443).

bridge.rs keeps 5.5 domains (library, album/artist, settings,
integrations, search, playlist) and dies once they are split out.

cc
2026-07-28 11:08:20 -06:00