Commit Graph
758 Commits
Author SHA1 Message Date
austinried 63279dec50 scroll the artist detail background and match its bar to the hero
The artist background used a static gradient and a scroll-0 bar colour. It now scrolls with
the grid (fading to a dark single colour) and the bar colour comes from heroBarColor at the
real scroll, like the album/playlist hero. The gradient's scroll origin is the hero image
bottom, since the image is full-width and covers the top.
2026-10-04 00:29:59 +00:00
austinried dcdcf553e2 show the starred indicator on artist album cells too 2026-10-04 00:29:59 +00:00
austinried 525ab87c9e add a starred indicator and drop the album from the now playing subtitle
A small primary star shows next to the title on album/playlist detail song rows, the queue
and the artists tab, and in the corner of the album grid. The now playing track info stays
centred.
2026-10-04 00:29:59 +00:00
austinried d703b8ec5b index the album, artist and playlist list sorts 2026-10-04 00:29:59 +00:00
austinried f05a1c79a8 address review: save the selected tab by name and drop the dead songIds query 2026-10-04 00:29:59 +00:00
austinried e3af5ed0ac drop the songs tab and the whole-library song queue 2026-10-04 00:29:59 +00:00
austinried 9cf2c99fb5 suppress the restricted NavController.currentBackStack in navigateDetail
currentBackStack is @RestrictTo(LIBRARY_GROUP), which CI's Android Lint rejected. There is
no public API that matches a back-stack entry by its arguments, so keep it and suppress the
check rather than fall back to argument-blind popBackStack(route).
2026-10-04 00:29:59 +00:00
austinried 7fe6637436 give the FAB options sheet a top margin and drop the rule under the search row 2026-10-04 00:29:59 +00:00
austinried a43f9f3412 keep the menu icons on their content colour so they are not black
Color.Unspecified disables Icon's colour filter, which fell back to the vector's black; only
the filled star should be the primary colour.
2026-10-04 00:29:59 +00:00
austinried da1c6f37d8 tint the filled star with the primary colour 2026-10-04 00:29:59 +00:00
austinried ccdeca563f address review: cancellation-safe star, one star handler, focus logic tested
- setStar no longer treats cancellation as a rejection: rethrow CancellationException
  instead of toasting/rolling back, and roll back under NonCancellable on a real failure
- serialise setStar so overlapping toggles cannot clobber each other's rollback
- the menu star item reverts its label when the request fails (setStar now returns the
  result), so the open menu cannot drift from the row
- ContextMenuHost.dismiss clears the actions so a popped screen's ViewModel is released
- one shared setStar from the app shell instead of five per-ViewModel copies
- extract the nav-focus decision into focusPops and unit-test it
2026-10-04 00:29:59 +00:00
austinried 38679c4959 address feedback: focus detail screens anywhere in the stack, brighter sheet
- navigateDetail scans the whole back stack and pops back to a matching album/artist/
  playlist, not just the top, so artist -> album -> now playing -> view artist focuses the
  existing artist instead of pushing a second one
- raise the sheet container to surfaceContainerHigh so it reads against the background
  behind it
2026-10-04 00:29:59 +00:00
austinried 5aea1d6b4e address feedback: immediate navigation, now-playing fade, stack focus, sheet polish
- menu actions run before the sheet collapses, so tapping an album/artist navigates
  immediately instead of waiting for the dismiss; the sheet still animates closed
- host the sheet in the app shell so it survives the navigation it triggers
- now playing fades out (rather than sliding) when its menu navigates to an album/artist,
  and navigates first
- navigating to a detail screen already on top of the stack focuses it instead of pushing
  a duplicate
- drop the drag handle from both sheets, even the menu header's left/top margins, and add
  a bottom margin
2026-10-04 00:29:59 +00:00
austinried c28271590e address feedback: optimistic star and menu polish
- star/unstar updates the local row immediately and rolls back with a toast if the server
  rejects it, instead of waiting on the response
- the menu collapses with an animation on dismiss
- star/unstar keeps the menu open and toggles its item in place
- the album/artist rows show the target's name instead of "View album"/"View artist"
- the menu header shows the cover art thumbnail
2026-10-04 00:29:59 +00:00
austinried d9e9a6b865 add item menus to the detail screens and now playing
Album, artist and playlist detail screens get a more button plus long-press on their song
and album rows; now playing gets a more button for the current song. Song menus can reach
the album and artist and star; the now-playing song is read from Room so its star state is
current.
2026-10-04 00:29:59 +00:00
austinried fb9e985680 add star/unstar and long-press item menus to the library lists
Star is a new write path: MusicSource.setStar posts star.view/unstar.view and
LibraryRepository updates the local row on success (toast on failure). Long-press an
album, artist, song or playlist in the library to open a bottom sheet with play/shuffle,
star/unstar and view-album/view-artist.
2026-10-04 00:29:59 +00:00
austinried ed7a2e7390 stop the now playing title flickering on every track change
The title effect was keyed on both the queue context and the per-track fallback
(album name), so advancing a track reset the resolved playlist/album name to the
album fallback until the async lookup returned. Key only on the queue context;
`remember(queueContext)` already resets it synchronously when the context changes.
2026-10-04 00:29:59 +00:00
austinried da71bccb58 fix queue overlay, focus and artwork loading glitches
- scope QueueViewModel to the queue overlay so its rows are released on close
  and a reopened queue cannot show two overlapping lists; key open() on the
  overlay visibility so a fast reopen still rescans and refocuses
- reuse row ids by song identity when a window (re)loads so Compose does not
  cross-fade the old rows out while the new ones fade in
- fade the artist name scrim in and key its busy check on the thumbnail, the
  same ref the theme already uses, so a cached seed shows it immediately
- start detail gradients from the neutral base artwork until the seed resolves
  instead of inheriting the now playing theme and snapping to the artist colours
- fade the now playing and detail status bar scrims by putting the graphicsLayer
  before statusBarScrim(), which otherwise drew the background outside the layer
- decode full-size and hero covers with FilterQuality.High to stop the moire
  during overscroll stretch
2026-10-04 00:29:59 +00:00
austinried 5fb38a7c9b rebase onto main: move the rank-column drop to 13 to 14 and drop the rank fixture 2026-10-04 00:29:59 +00:00
austinried 0fb2ce2918 address review: drop the dead disc query, pin the fetch bound, cover multi-page disc prune 2026-10-04 00:29:59 +00:00
austinried 34f15176d7 harden sync for large libraries: bounded prune, concurrent fetches, higher page cap 2026-10-04 00:29:59 +00:00
austinried af38f34ecd probe whenever the active source changes
Track the active source id and probe when it changes, instead of a remembered probed id.
The behaviour is the same for switching sources, but the intent is now explicit: switch
source, probe it.
2026-10-04 00:29:59 +00:00
austinried 9c97f64381 address review: probe the active source so media falls back too
An existing token-auth source with an already-synced library would fail playback before
any API call ran: stream and cover-art URLs are built by uri() and fetched by
ExoPlayer/Coil, outside stream(). Probe the active source once when it uses token auth so
the 41 flips and persists before any URL is built.

Also base the retry on the flag the request actually used (concurrent requests no longer
lose their retry), report the fallback from ping() so Add Source flips the toggle instead
of reporting success and saving token auth on, and make the callback non-null.
2026-10-04 00:29:59 +00:00
austinried 59706f28c1 fall back to password auth when the server rejects the token scheme
Navidrome refuses the Subsonic token scheme for LDAP users with error code 41. Catch it
once in SubsonicClient: flip that client to the password scheme, tell SourceRepository to
persist the change for the source and show a toast, then retry the request. Only 41 is
retried, the flip is idempotent, and a client never retries more than once.
2026-10-04 00:29:59 +00:00
austinried 90171468cc address review: keep one unbounded cover axis undefined instead of forcing a square 2026-10-04 00:29:59 +00:00
austinried 43f39300ce decode covers at their display size and bucket the memory cache by size 2026-10-04 00:29:58 +00:00
austinried 11c0276929 store artwork seeds without read-time writes and prune periodically 2026-10-04 00:29:58 +00:00
austinried a97a5e0687 bound artwork seeds and size the now-playing prefetch 2026-10-04 00:29:58 +00:00
austinried ca87a38276 address review: cover tab re-entry and the paused position ticker 2026-10-04 00:29:58 +00:00
austinried 0b5946e09b invalidate the library cache before publishing the sync result 2026-10-04 00:29:58 +00:00
austinried 8429a4529f collect only the visible tab and split the position ticker from playback state 2026-10-04 00:29:58 +00:00
austinried 97ca4230da address review: offload artwork decode, drop the redundant metadata override, cancel the loader 2026-10-04 00:29:58 +00:00
austinried 4095d038a9 load notification artwork through Coil by cover-art identity 2026-10-04 00:29:58 +00:00
austinried d11bd45fe7 document that the library is mirrored offline in full
Spell out the sync contract: browsing, filtering and sorting never touch the network,
only media bytes and images are on-demand, and a server-derived sort key has to land in a
local column at sync time rather than being requested lazily.
2026-10-04 00:29:58 +00:00
austinried e50332bfff rephrase the test bar for clarity 2026-10-04 00:29:58 +00:00
austinried 54db1d7544 document the bar for a test being worth having 2026-10-04 00:29:58 +00:00
austinried a356226e48 address the review: keep the stored seed on a failed decode, one cache, static bar colour
- resolve() no longer discards a stored seed when the bitmap cannot be decoded (it used to
  return null, dropping the theme for pre-v12 rows); it falls back to the stored pair
- fold the busy flag into the seed cache value so eviction is atomic (a busy entry could be
  evicted from the separate flag LRU while its seed stayed, silently disabling the scrim)
- the artist top bar samples heroBarColor at scroll 0 to match the static HeroGradient, and
  drops the wrong scroll estimate and per-pixel recomposition
- rememberOverlaidNameBusy keys its state so the cached flag is read on key change, not only
  the first composition; bottomBandBusy bails out on an empty bitmap
2026-10-04 00:29:58 +00:00
austinried f4ca0fd6d4 compute and persist the artist name busy flag with the artwork seed
- ArtworkSeedStore now carries the flag; artwork_seeds gains a nullable nameBusy column
  (DB v12, migration 11->12) so it survives cold starts with no decode
- resolve() computes the flag from the same bitmap it extracts the colour seed from, so
  there is no second decode, and persists it alongside the seed
- overlaidNameBusy reuses the seed job and reads the cached flag synchronously, so the
  scrim is known before the art shows; drop the fade
- bottomBandBusy now uses perceptual (gamma-space) luma, edge density and a bright
  fraction, which catches busy art on dark backgrounds (issue #40) that mean/variance missed
2026-10-04 00:29:58 +00:00
austinried 658b7f9452 fade the artist name scrim in instead of popping it in
The busy check can only resolve after the art's first decode, so the scrim appeared in a
single frame. Animate it over 180ms so it eases in behind the name.
2026-10-04 00:29:58 +00:00
austinried 6081a5c009 keep the theme wrapper stable so the layout doesn't remount when artwork arrives
ArtworkTheme swapped between a bare content() and a MaterialTheme wrapper depending on
whether a scheme existed. When the first track's artwork (or a screen's) resolved, that
branch change remounted the whole subtree, reloading images, resetting scroll and
restarting the mini player. Always provide a MaterialTheme, falling back to the ambient
scheme when there is no artwork, and cover it with a test.
2026-10-04 00:29:58 +00:00
austinried 2ba87114da align the artist top bar with the themed screens and scrim a busy name
- the artist top bar now uses the default app-bar title style and the art-derived
  heroBarColor instead of a hardcoded headline/black/white, so it follows the artist theme
- add a bottom scrim behind the overlaid artist name only when the art under it is bright
  or noisy, measured from the seed bitmap (so no extra decode)
2026-10-04 00:29:58 +00:00
austinried 8b43de25f7 address final review: coalesce sync requests, fix page-cap edge
- SyncManager now uses a conflated request channel instead of tryLock, so a
  request that arrives during a sync (e.g. add-source switching the active
  server) is queued and runs afterwards against the then-active source
  instead of being dropped.
- Paged loops count raw server rows, not accepted entities, so an empty-id
  row on an otherwise full page no longer ends the scan early and prunes
  the unseen tail.
- The cap now fails when the page just past it is non-empty, not only when
  it is full, matching the bound the error message reports.
- fetchRank rethrows the cap instead of downgrading an over-cap album scan
  to empty ranks.
- Docs: the mutex lives in SyncManager, and the prune still holds the
  existing-id set.
2026-10-04 00:29:58 +00:00
austinried 7b06b23860 confirm the end of a full last page before failing the page cap
A full page at the cap is not proof of truncation, so a library whose
size is an exact multiple of the page size failed for no reason. Each
paged loop now keeps going one page past the cap and only throws when
that page comes back non-empty; a library up to the cap syncs normally.
Add a boundary test for the exact-cap case.

Also note the accepted per-batch observer invalidation churn in the sync
code and the architecture doc.
2026-10-04 00:29:58 +00:00
austinried c48ec670d8 address arch review: guard the page cap, coalesce syncs, tighten buffers
- Paged loops now throw when they hit maxPages with a full last page, so a
  truncated enumeration aborts the entity's collect and skips its prune
  instead of deleting rows the sync never saw. The cap is injectable for
  tests.
- Move sync serialization into SyncManager (tryLock coalesces duplicate
  requests) and construct SyncService there; SourceRepository only exposes
  the active MusicSource. Removes the repo <-> sync import cycle.
- Re-throw CancellationException instead of reporting a cancelled sync as
  failed.
- Add buffer(1) to the outer albums/songs/playlistSongs flows so their
  flowOn channel cannot hold 64 batches.
- Rank prefetch is best-effort (missing frequent/recent no longer aborts
  the album sync).
- Skip playlist entries without an id, keeping positions contiguous.
- Chunk stale-disc deletes like the other prunes.
- Update the implementation plan line that still described the old
  single-transaction sync.
2026-10-04 00:29:58 +00:00
austinried 3c941ef0f2 document the streaming sync in the architecture doc
The Sync section still described fetching the whole library and writing
it in one transaction, and the stack table still said DOM parsing.
2026-10-04 00:29:58 +00:00
austinried be6bcd11dc address review: serialize syncs, classify parse errors, widen coverage
- SourceRepository now holds a Mutex around sync(), so overlapping
  requestSync() calls can no longer interleave per-batch writes and
  stale-set prunes. The per-call SyncService lock could never do this.
- parse() wraps SAXParseException/IOException as SubsonicException, so a
  truncated or malformed response is a clean sync failure instead of a
  raw parser exception escaping the empty-search fallback.
- A response with no status attribute is accepted again, matching the
  old DOM behaviour (only status="failed" fails).
- Simplify the SAX handler (drop sawRoot and StatusHandler), make the
  entity mappers internal, and drop an unreachable guard in write().

Tests: pagination and empty-search caching for songs, album pagination,
empty-id filtering, cancellation, SAX error paths and structural edge
cases, cross-source prune isolation, emptied playlists, disc-set shrink,
multi-chunk deletes, change detection via total_changes, playlist id
filtering, and SyncManager cache invalidation on failure.
2026-10-04 00:29:58 +00:00
austinried b171b0b33c stream sync with SAX and write the library per batch
The DOM-based sync materialised the whole library in memory before
writing: SubsonicSource accumulated every paged response into one list
and SubsonicClient built a full DOM per response, so peak memory grew
with the library size (hundreds of MB for large libraries).

Replace it with a streaming pipeline:

- SubsonicXml is now a SAX reader that maps entities straight from the
  stream. Album disc titles are accumulated from child elements and
  attached when the album closes.
- SubsonicClient exposes stream()/check() instead of returning a DOM.
- MusicSource returns batches as Flow<List<T>>; SubsonicSource emits one
  batch per response page with backpressure so only one batch is held.
- SyncService syncs each entity sequentially, commits one transaction
  per batch, and prunes with an existing-minus-seen stale set. Playlist
  song tails are pruned once the whole flow has been counted, and
  orphaned playlist_songs rows are removed with a single delete.

Sync is no longer atomic: on failure the committed batches remain and
the queue's library cache is now invalidated on failure too.
2026-10-04 00:29:58 +00:00
austinried bce074ecdc address the review: blank source name, synchronous title reset, shared scrim
- QueueRepository.sourceName returns null for a blank album/playlist name so the now
  playing title fallback applies instead of rendering empty
- resolve the now playing source title with remember + LaunchedEffect instead of
  produceState so it resets synchronously when the queue context changes
- extract the repeated status bar scrim into Modifier.statusBarScrim() and use it in
  AppRoot, LibraryScreen and HeroDetailScaffold
2026-10-04 00:29:58 +00:00
austinried b16fe0f8d6 nudge the playlists tab glyph so it reads the same size as the neighbours
The PlaylistPlay glyph sits smaller and left in its viewport; scale it up slightly and
shift it right, like the download glyph's vertical nudge.
2026-10-04 00:29:58 +00:00
austinried d28c6c77dd re-register the overlay back callback when the overlay state changes
On the library no navigation happens, so ours was registered before the NavHost's and
lost; keying the DisposableEffect on the overlay flags re-adds it last as soon as the
overlay opens.
2026-10-04 00:29:58 +00:00