Commit Graph

1388 Commits

Author SHA1 Message Date
bvandeusen eb4537c013 fix(android): drop unused navController from ShellScaffold
android / Build + lint + test (push) Successful in 3m35s
android / Build signed release APK (push) Has been skipped
CI on 5c2011e6 caught it: removing the MiniPlayer kebab also removed
the only consumer of ShellScaffold's navController parameter, which
detekt's UnusedParameter rule flagged. Per YAGNI, dropping the param
entirely instead of @Suppress'ing a dead carry; if a future banner
or shell-level affordance needs nav, plumb it back in at that point.

Touches the public signature so all 10+ call sites in MinstrelNavGraph
also lose the `navController = navController` argument.
2026-06-01 08:17:24 -04:00
bvandeusen 487400fab6 fix(android): share playlist play conversion + filter unplayable rows
android / Build + lint + test (push) Failing after 1m30s
android / Build signed release APK (push) Has been skipped
HomeViewModel.playPlaylist (the Home play-button overlay path) and
PlaylistDetailViewModel.play (the detail-screen path) both converted
PlaylistTrackRef -> TrackRef before player.setQueue, but only the
detail-screen path filtered out unplayable rows (missing trackId or
empty streamUrl). Home's path passed them through; Media3 then
silently no-op'd on setUri("") and the queue appeared loaded but
nothing started.

Operator reported "Songs-like playlists queue music that never
plays" via the Home play-overlay 2026-06-01. The same conversion in
two places with different rules is exactly the foot-gun the §1-§3
DRY pass was supposed to head off; this commit adds it as a follow-up
since the playlist-play helper wasn't covered by that sweep.

Extracts `List<PlaylistTrackRef>.toPlayableTrackRefs()` in
playlists/data/PlaylistsRepository.kt. Filters (isAvailable &&
streamUrl non-empty) THEN maps to TrackRef, in one pass. Both call
sites now use it.

The remaining private `toTrackRef()` in PlaylistDetailScreen is kept
for the per-row TrackActionsButton wiring - the actions menu only
needs id+display fields and doesn't queue anything itself.
2026-06-01 08:15:29 -04:00
bvandeusen 5c2011e6f4 fix(android): remove kebab from MiniPlayer to free space for artist line
android / Build + lint + test (push) Failing after 1m27s
android / Build signed release APK (push) Has been skipped
Cover + LikeButton + 3 transport buttons + kebab consumed almost all
of the 360-410dp viewport on typical phones, leaving the title /
artist column with only ~20-80dp - enough for a truncated title but
nothing for the artist line, which was rendering but effectively
unreadable.

Drops TrackActionsButton from MiniRow and the now-unused
onNavigateToAlbum / onNavigateToArtist callbacks from the MiniPlayer
signature + ShellScaffold call site. Full kebab surface still lives
on NowPlayingScreen (one screen swipe away).

Operator request 2026-06-01. Diverges from Flutter's player_bar
which still ships the kebab; parity-map row updated to reflect the
deliberate divergence. ShellScaffold's navController parameter is
kept on the signature for future shell-level navigation needs.
2026-06-01 08:07:48 -04:00
bvandeusen ef8374753a feat(android): denser Most Played tiles - horizontal row matching Flutter
android / Build + lint + test (push) Successful in 4m0s
android / Build signed release APK (push) Has been skipped
Operator device check 2026-06-01: the multi-row grid landed, but the
square 140dp tiles (web-matching) waste vertical space at the per-
tile level. Flutter's CompactTrackCard
(flutter_client/lib/library/widgets/compact_track_card.dart) uses a
horizontal-row pattern - 176dp wide, 56dp tall, 48dp cover thumb +
title/artist column to the right. Much denser; fits ~3x more tiles
in the same screen area.

CompactTrackTile rewritten to that shape:
- Row layout instead of Column
- 48dp square cover (down from 140dp)
- Title + artist column to the right, vertically centered
- 176dp x 56dp outer

MOST_PLAYED_GRID_HEIGHT_DP cut from 600 to 200dp (3 * 56 + 2 * 8
spacing). Skeleton matches the new dimensions.

Diverges from web (which uses square tiles same as Android's prior
shape) - intentional, operator preference. TrackActionsButton from
Flutter's card is omitted for now (would need nav callbacks threaded
through MostPlayedRow); follow-up if kebab-on-tile is wanted.
2026-06-01 08:00:47 -04:00
bvandeusen 7b619152ab fix(android): periodic position polling for smooth seek bar
android / Build + lint + test (push) Successful in 3m41s
android / Build signed release APK (push) Has been skipped
PlayerController only ran the UI-state copy on Media3 Player.Events
callbacks (track change, pause/play, buffer state) - none of which
fire on normal position advancement during playback. The seek bar
appeared to update every 20-30 seconds, whenever a buffer event
happened to fire, instead of ticking smoothly.

Adds a startPositionPolling() coroutine launched on
Dispatchers.Main.immediate after the controller is connected.
Samples controller.currentPosition + bufferedPosition every 500ms
while isPlaying; skips state updates while paused (positionMs stays
at the last value, which is the correct paused-state behavior).
The poll patches only the position fields via .copy() so stale
event-driven snapshots can't clobber the latest state.

Cadence reference: Flutter via just_audio positionStream runs at
~200ms (audio_handler.dart:75); Spotify / Apple Music sit around
250-500ms in-app. 500ms is the battery-friendly middle ground that
still reads as smooth on a slider. Lock-screen / notification
surfaces are driven by Media3's MediaSession separately and don't
need this poll.
2026-06-01 02:21:52 -04:00
bvandeusen 5b050022f1 feat(android): filled heart for liked state, outlined for unliked
android / Build + lint + test (push) Successful in 3m35s
android / Build signed release APK (push) Has been skipped
Liked tracks now render a filled heart (HeartFilled, defined inline
in LikeButton.kt) instead of just recoloring the outlined heart.
Matches the cross-app convention (Spotify, Apple Music, etc.) where
fill is the affordance change rather than tint alone.

Lucide ships outlined-only by design (jar inspection: heart.kt,
heart_crack.kt, heart_off.kt, etc., none filled). Built the filled
variant locally from Lucide's exact path data so the toggle reads as
a fill swap, not a different shape. No new dep - keeps the project's
Lucide-everywhere icon system consistent.

Operator authorized the divergence 2026-06-01 ("changing to material
for this one symbol... is acceptable"); inline ImageVector route
preserves Lucide visual harmony better than mixing material-icons
just for one glyph.
2026-06-01 02:10:21 -04:00
bvandeusen 25c5b80add fix(android): populate streamUrl in CachedTrackEntity to domain mapper
android / Build + lint + test (push) Successful in 3m30s
android / Build signed release APK (push) Has been skipped
CachedTrackEntity.toDomain() was emitting TrackRef.streamUrl="" (the
default). Tracks routed through MetadataProvider (the Home cache
hydration path used by Most Played) inherited the empty string;
player.setQueue() then got a queue of unplayable tracks.

The server's stream_url is deterministic per track id
(internal/api/convert.go:75 streamURL builder), so the cache mapper
can reconstruct it from the row's id without storing it in Room.
TrackWire.toDomain() continues to use the wire-provided value
(identical content).

Operator reported "tap to play wiring in Most Played queues content
that can't play" on 2026-06-01. The Most Played multi-row layout
itself isn't the cause - the same gap affected the single-row
layout - but the denser display made the dead taps more obvious.
2026-06-01 01:55:18 -04:00
bvandeusen 1fdc5b0a1f fix(android): import Arrangement in HomeScreen for Most Played grid
android / Build + lint + test (push) Successful in 3m42s
android / Build signed release APK (push) Has been skipped
CI on 58213779 caught the missing import: the previous code used
Arrangement only inside HorizontalScrollRow (which imports it
internally), but the inline LazyHorizontalGrid for Most Played
now needs it at the HomeScreen.kt scope. ktlint passed because
it doesn't follow type resolution; the kotlinc compile step
flagged it.
2026-06-01 01:43:32 -04:00
bvandeusen 582137790d feat(android): Most Played to 3-row dense layout matching web
android / Build + lint + test (push) Failing after 2m44s
android / Build signed release APK (push) Has been skipped
Web Home (web/src/routes/+page.svelte:196) stacks the 75 most-played
tracks into 3 rows of 25 inside a single horizontal scroller; Android
was rendering them as one long LazyRow which makes the section feel
sparse and forces a lot of horizontal scrolling to reach mid-rank
tracks. Operator request 2026-06-01.

Replaces MostPlayedRow's LazyRow with a LazyHorizontalGrid where
rows=Fixed(MOST_PLAYED_ROWS=3). Cards stay 140dp (matching web's
w-36); density gain comes purely from stacking.

Web is row-major (ranks 0..24 across the top row); LazyHorizontalGrid
fills column-major. To match web's visual order, the input list is
pre-chunked into 3 row-major rows then re-flattened column-by-column
before being handed to the grid. With 75 tracks and 3 rows that's
25 columns, ranks 0/25/50 in column 0, 1/26/51 in column 1, etc.

MOST_PLAYED_GRID_HEIGHT_DP=600 budgets ~188dp per row (140 cover +
8 spacer + 2 lines of text), plus 2 * 8dp inter-row spacing.

Diverges from Flutter (still single-row); intentional, parity-map
updated. Backflow to Flutter not tracked yet because the Flutter
client is being retired.
2026-06-01 01:38:10 -04:00
bvandeusen 54903c4760 fix(recommendation): drop user_id from Rediscover daily hash to preserve sqlc type inference
test-go / test (push) Successful in 28s
test-go / integration (push) Successful in 9m9s
CI on 8b586c2e caught it: the $1::text cast in the md5 ORDER BY made
sqlc infer the parameter as plain string instead of pgtype.UUID,
generating Column1 string instead of UserID pgtype.UUID on the
ListRediscover*ForUserParams structs. go vet flagged both call
sites in internal/recommendation/home.go where the Go code passes
UserID by name.

Fix: hash on album_id (or artist_id) + current_date only. The
eligibility filter already differs per user (different liked sets),
so the daily-rotation goal is preserved; we just lose per-user salt
in the within-day ordering of overlapping items - acceptable.

Applies to both primary queries AND both fallback queries (all four
had the same cast).
2026-06-01 01:03:45 -04:00
bvandeusen 8b586c2e50 feat(recommendation): rework Rediscover - track-derived eligibility + daily rotation + caps
test-go / test (push) Failing after 15s
test-go / integration (push) Failing after 2m16s
User request 2026-06-01: the previous Rediscover only fired on
explicit album/artist likes, so users who only liked at the track
level got an empty Rediscover row. Also no daily rotation - the
section never changed between data updates - and 25 items felt long
for the Home carousel.

SQL (internal/db/queries/recommendation.sql):
- ListRediscoverAlbumsForUser UNIONs the existing explicit album-like
  signal with a new track-derived path: an album qualifies if it has
  >=2 liked tracks where the earliest like is >30 days old.
- ListRediscoverArtistsForUser does the same with threshold 3 (artists
  span more releases, so the bar is higher to avoid one-hit-wonder
  affinities).
- Both ordering switched from longest-since-last-play to a daily-
  stable random hash md5(entity_id || user_id || current_date) so
  the row randomizes but stays consistent within a day.
- Fallback queries also switched to the daily-stable hash so the
  fallback rows don't reshuffle on every refresh.

Go (internal/recommendation/home.go):
- HomeRediscoverLimit dropped from 25 to 10 (carousel-sized).
- rediscoverInnerLimit (30) is the per-query cap; gives headroom so
  the Go-layer filters don't undershoot.
- applyRediscoverAlbumFilters does cross-section dedup vs Most Played
  (no point surfacing albums the user is actively spinning) plus a
  diversity cap of max 2 albums per artist (prevents one liked-but-
  forgotten artist dominating the row).
- applyRediscoverArtistFilters does cross-section dedup vs Most
  Played's artist set; no diversity cap needed (one row per artist).

Tests (internal/recommendation/home_integration_test.go):
- TrackDerived path: 2 liked tracks >30d old + no recent plays = album
  appears in Rediscover.
- Threshold guard: 1 liked track = album does NOT appear.
- Diversity cap: 4 explicit album-likes from same artist = 2 in output.
- Dedup vs MostPlayed: eligible album whose track is in MostPlayed
  gets filtered out.
- Existing FallbackWhenSparse test preserved (semantics unchanged for
  recent likes that miss the >30d primary filter).

Clients unchanged - they render whatever /api/home/index returns. No
parity-map row needed (this is a server-internal recommendation
change, not a layout divergence).
2026-06-01 00:57:40 -04:00
bvandeusen bf61d6cfa3 feat(android): surface secondary system playlists on Home + drop dead todays_mix label
android / Build + lint + test (push) Successful in 3m45s
android / Build signed release APK (push) Has been skipped
Server's playlists registry has 8 system kinds (internal/playlists/
system.go:281-290) but Flutter Home only ever showed 5 slots:
For You + Discover + 3 Songs-like. Operator request 2026-06-01: have
the Android Home view also surface the 5 secondary kinds so the
user can find them without digging into the Library > Playlists list.

Android buildPlaylistsRow now appends deep_cuts, rediscover,
new_for_you, on_this_day, first_listens in server-registry order
after the existing Songs-like slots, when those playlists actually
exist. No placeholders for the new 5 since they depend on library
shape (deep albums for Deep cuts, prior history for On this day,
etc.) and an empty placeholder would imply they're still building
when they may just have no candidates.

PlaylistCard.kt systemLabelFor gains explicit labels for the new
kinds and drops the dead "todays_mix" branch (no such variant in
the server registry).

This diverges from Flutter Home which never surfaces the secondary
kinds; web UI catch-up tracked as task #53. Naming note: the
"Rediscover" playlist tile and the unrelated "Rediscover"
recommendations section on the same Home both read "Rediscover" -
operator follow-up to disambiguate.
2026-06-01 00:39:51 -04:00
bvandeusen 741ce1fa07 fix(android): extract PlaylistCardCover to clear detekt LongMethod
android / Build + lint + test (push) Successful in 3m32s
android / Build signed release APK (push) Has been skipped
Adding the play-button overlay in the previous commit pushed
PlaylistCard from 49 to 62 lines, two over detekt's 60-line cap.
Splitting the cover stack into its own private composable
(PlaylistCardCover) brings the outer function back under the limit
while keeping the call site readable.

Behavior identical to f17610ec; pure refactor for lint compliance.
2026-05-31 23:51:59 -04:00
bvandeusen f17610ecd5 feat(android): port play-button overlay to Home tiles
android / Build + lint + test (push) Failing after 1m34s
android / Build signed release APK (push) Has been skipped
Mirrors Flutter's PlayCircleButton (library/widgets/play_circle_button.dart)
on the Home AlbumCard / ArtistCard / PlaylistCard surfaces. 44dp accent
disc bottom-right of the cover, parchment Play icon, self-managed
spinner during the fetch-and-queue setup, drop shadow.

New: shared/widgets/PlayCircleButton.kt. Cards gain an opt-in
onPlay: (suspend () -> Unit)? parameter; when null the overlay is
omitted, preserving the Library / Discover / Search / detail surfaces
unchanged. HomeScreen wires three new HomeViewModel suspend methods:

  playAlbum         GET /api/albums/{id}, play tracks from 0
  playArtistShuffled GET /api/artists/{id}/tracks, FY shuffle, play 0
  playPlaylist      systemShuffle for refreshable system playlists,
                    refreshDetail otherwise, 8s timeout

PlaylistsApi gains systemShuffle for the rotation-aware shuffle path
(GET /api/playlists/system/{kind}/shuffle, mirrors playlists.dart).

PlaylistCard play is disabled offline + refreshable (server endpoint
unreachable) and for empty playlists. Album / artist errors surface
via the existing transientMessages snackbar channel, matching the
ArtistDetailViewModel improvement over Flutter's silent fail.

Scope: Home tiles only this slice. Flutter applies the overlay to
the cards everywhere they render; revisit Library / Discover / Search
/ detail surfaces in a follow-up.
2026-05-31 23:45:48 -04:00
bvandeusen 5a502c12c9 chore: untrack CLAUDE.md, gitignore AI-tool instruction files
Project-level AI-tool instruction files (CLAUDE.md, AGENTS.md,
GEMINI.md, .cursorrules, .windsurfrules, .aider.conf.yml) are
operator-scoped working notes, not project artifacts. Other
contributors don't need them, and committing them conflates
operator preferences with shared project conventions.

CLAUDE.md remains on the local disk (untracked) so Claude Code
keeps loading it for this checkout; new clones simply won't have
it, which is the desired state.
2026-05-31 23:31:48 -04:00
bvandeusen f482d0d2fa ci(android): switch upload-artifact to actions/v4 + retire flutter.yml
android / Build + lint + test (push) Successful in 3m44s
android / Build signed release APK (push) Has been skipped
Last push failed both android and flutter jobs at workflow-setup time
because the runner couldn't resolve forgejo/upload-artifact@v3
(github.com/forgejo/upload-artifact does not exist; the Forgejo
project hosts on Codeberg and our Gitea runner falls through to
github by default). The canonical Gitea Actions form is
actions/upload-artifact@v4, which act_runner resolves cleanly.

Flutter pipeline is being retired in favor of the native Android
client, so flutter.yml is deleted outright rather than fixed. The
container-image build's release-asset polling (release.yml) will now
graceful-degrade when chasing the legacy minstrel-<TAG>.apk name,
which the comment in ci-requirements.md already documents as
acceptable. Renaming the native APK to drop the -android- infix is
deferred to a follow-up so the cutover is reviewable in isolation.
2026-05-31 23:18:31 -04:00
bvandeusen 3cf829752b chore(ci): migrate workflows to gitea + consolidate keystore secret
flutter / analyze-test-build (push) Failing after 2s
test-go / test (push) Successful in 33s
android / Build + lint + test (push) Failing after 41s
test-web / test (push) Successful in 41s
android / Build signed release APK (push) Has been skipped
test-go / integration (push) Successful in 11m16s
- rename .forgejo/workflows/ to .gitea/workflows/ (git mv preserves
  history); Gitea Actions reads either path, but the directory now
  matches the active platform
- collapse ANDROID_STORE_PASSWORD + ANDROID_KEY_PASSWORD into a
  single ANDROID_KEYSTORE_PASSWORD secret (PKCS12 keystores require
  the two passwords to be identical, so the duplication carried no
  information); build.gradle.kts still reads two env vars to stay
  format-agnostic, both now sourced from the same secret in CI
- ignore android/*.keystore, android/*.keystore.*, android/*.jks,
  android/keystore.properties so the regenerated signing material
  never reaches a remote on accident
- update prose references from Forgejo to Gitea in CLAUDE.md and
  the docs; the historical "migrated from Forgejo" note in CLAUDE.md
  is kept intentionally; forgejo/upload-artifact@v3 action refs are
  left untouched (canonical artifact action, resolves cleanly under
  Gitea Actions)

Operator side: ANDROID_KEY_ALIAS, ANDROID_KEYSTORE_PASSWORD, and
ANDROID_KEYSTORE_B64 secrets registered in Gitea before this lands.
2026-05-31 23:05:03 -04:00
bvandeusen 96caac2f06 fix(android): suppress MatchingDeclarationName on PlaylistsListScreen (VM colocated) 2026-05-30 22:59:50 -04:00
bvandeusen fa90d6d6c5 refactor(android): extract asCacheFirstStateFlow helper (DRY 3d)
Five cache-first ViewModels all ended their flow pipeline with:

    .catch { e -> emit(UiState.Error(ErrorCopy.fromThrowable(e))) }
    .stateIn(viewModelScope,
             SharingStarted.WhileSubscribed(SHARE_STOP_TIMEOUT_MS),
             UiState.Loading)

plus a per-file private const for the 5_000L share-stop timeout.

Extract to a single Flow<UiState<T>> -> StateFlow<UiState<T>> extension
in shared/CacheFirstStateFlow.kt; migrate Library, PlaylistsList,
LikedTab, AddToPlaylist, and Home VMs. Each VM drops the catch +
stateIn + ErrorCopy + SharingStarted imports + the local constant.

AddToPlaylistVM keeps its onStart { refresh; emit Loading } block
in front of the helper -- that re-emit is intentional UX for sheet
re-opens past the 5s subscriber timeout.
2026-05-30 22:56:22 -04:00
bvandeusen 453f8a387b fix(android): remove duplicate TrackActions snackbar wiring (DRY 3c)
ShellScaffold already collects TrackActionsViewModel.transientMessages
into its own SnackbarHost. Per-route, the shell's hiltViewModel<
TrackActionsViewModel>() and the screen's hiltViewModel<TrackActions
ViewModel>() resolve to the same NavBackStackEntry-scoped instance,
so any kebab action fires the snackbar twice today (once in the
screen's own SnackbarHost, once in the shell's).

Strip the per-screen wiring from the four shell-wrapped screens that
had it (Library, Search, AlbumDetail, PlaylistDetail): VM param,
SnackbarHostState, LaunchedEffect, and the Scaffold's snackbarHost.
The shell now owns the snackbar exclusively.

NowPlayingScreen is intentionally left untouched -- it's outside the
shell (full-screen route), so its own snackbar wiring is the only
surface that shows the message.
2026-05-30 22:38:48 -04:00
bvandeusen 02a6c45958 refactor(android): extract MinstrelTopAppBar (DRY 3b)
Ten screens duplicated the same TopAppBar + Text(title) +
optional-back-arrow + MainAppBarActions sandwich. Extract into
MinstrelTopAppBar(title, navController, currentRouteName, onBack,
actions) at shared/widgets/. Library's tab row still composes
above it inside a Column; Library's Shuffle button slots into the
extra actions trailing-lambda; drill-down screens pass onBack for
the back arrow; root tabs leave onBack null.

Net: -48 lines across 10 screens, +50 lines for the helper.

SearchScreen keeps its own TopAppBar (title is a SearchField
composable, not a string).

Per-screen TrackActionsViewModel snackbar wiring (Library/Search/
detail screens) was intentionally NOT consolidated here: each
hiltViewModel() returns a different VM instance than the shell-
scoped one already in ShellScaffold, so dedup belongs in 3c
(shell-scope the VM via CompositionLocal) rather than freezing the
current duplicate into a helper.
2026-05-30 16:00:21 -04:00
bvandeusen 2b17a4ed69 fix(android): AddToPlaylist routes empty list through UiState.Empty
The original AddToPlaylistUiState only had Loading/Success/Error, with
the empty-list message branched inside Success. After migrating to
shared UiState<T> (which adds Empty), the sheet's when over the state
was non-exhaustive. Route empty through UiState.Empty at the VM, drop
the inner branch in the sheet, and add the explicit Empty arm in the
when block to satisfy the compiler.
2026-05-30 14:29:50 -04:00
bvandeusen a52fdc7d5d fix(android): rename LibraryUiState.kt to LibraryData.kt (detekt MatchingDeclarationName) 2026-05-30 14:06:21 -04:00
bvandeusen 810e3126c2 refactor(android): migrate 8 per-screen UiStates to shared UiState<T>
History/Hidden/Requests/PlaylistsList/AddToPlaylist/Home/Liked/Library
each had its own sealed interface with Loading/Empty/Success(payload)/
Error variants. Collapsed to the generic shared/UiState<T> introduced
in the prior commit. Library carries two lists (artists + albums) so
its payload is wrapped in a new LibraryData record; the test was
updated to assert against UiState.Success<LibraryData>.

The 3 detail screens (Artist/Album/Playlist Detail) keep their own
sealed interfaces for now since they include a Loading(seed: ...)
variant that does not fit UiState<T>.
2026-05-30 14:03:39 -04:00
bvandeusen 587baf4a79 refactor(android): add generic shared/UiState<T> sealed type 2026-05-30 11:33:42 -04:00
bvandeusen 730176b1ed fix(android): restore Alignment import in ArtistCard (Column horizontalAlignment) 2026-05-30 10:50:52 -04:00
bvandeusen b71f9c239e fix(android): NowPlaying action row above the scrubber for Flutter parity
Flutter's _SecondaryControls (like, shuffle, repeat, queue, kebab) sit just above the seek bar (now_playing_screen.dart:464); Android had them at the bottom under the transport row. Reorder the NowPlayingBody column so it reads cover -> title -> actions -> scrubber -> transport, matching Flutter.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-30 02:32:25 -04:00
bvandeusen ee6305f525 refactor(android): extract shared CoverTile from Album/Artist/Playlist cards
The three cards shared an identical Box + clip + background + ServerImage + fallback structure around their cover (only size, shape, fallback icon, and overlay differ). Extract a single CoverTile composable; each card now passes its own size, shape, background, fallback icon, and optional BoxScope overlay (used by PlaylistCard for the VariantPill). Pure DRY consolidation; no behavior change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-30 02:31:32 -04:00
bvandeusen 37887107ee fix(android): pin Slider inactiveTrackColor to surfaceVariant (parity)
Material3 changed the Slider's default inactiveTrackColor to colorScheme.secondaryContainer, which MinstrelTheme does not override -- so M3's baseline purple leaked into both the mini scrubber and the NowPlaying ScrubberRow. Flutter explicitly sets inactiveColor = fs.slate; mirror that by pinning inactiveTrackColor to surfaceVariant (which the theme already maps to slate).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-30 02:31:16 -04:00
bvandeusen 5c7e659116 refactor(android): hoist resolveServerImageUrl to shared/ServerUrls.kt as resolveServerUrl
It was never image-specific -- it resolves any /api/* relative URL to the placeholder.invalid form that BaseUrlInterceptor rewrites. Both covers (ServerImage) and stream URLs (PlayerController) call it. Move the helper to shared/ServerUrls.kt with the right name; ServerImage and PlayerController import from there. Pure rename + relocate, no behavior change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-30 01:09:07 -04:00
bvandeusen c720dff310 fix(android): resolve relative stream_url before handing to Media3
Server emits stream_url as a relative path (/api/tracks/{id}/stream, internal/api/convert.go:75). PlayerController.toMediaItem passed it raw to setUri, so OkHttpDataSource saw a host-less URI and silently failed -- queue UI loaded but no audio played. Route streamUrl through the same resolver used for covers (resolveServerImageUrl), which prepends the placeholder.invalid host that BaseUrlInterceptor rewrites to the live server with the auth cookie. The setCustomCacheKey(id) still keys the SimpleCache by trackId, so cache residency is unaffected by the URL form.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-30 00:59:07 -04:00
bvandeusen 6967d62c09 fix(android): reconcile playlist cache to prune stale system-playlist UUIDs
Tapping certain playlists showed 'That playlist no longer exists' because the server's BuildSystemPlaylists rotates system-playlist UUIDs every rebuild, and the LIST refresh only upserted -- stale UUIDs lingered in the cache, tapping them triggered a 404. Mirrors playlists_provider.dart: PlaylistsRepository.refreshList now deletes the user's cached rows not in the fresh owned set (catches both deleted user playlists AND old system UUIDs since system playlists are user-scoped) before upserting the fresh all, atomically via a new replaceList @Transaction on the DAO. Also deletes the cached row when refreshDetail 404s so a stale tap self-heals the list. Inject AuthController for the current user id.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-30 00:02:20 -04:00
bvandeusen 7bed0c226b refactor(android): migrate AlbumDetail TrackRow to shared TrackRow 2026-05-29 22:48:06 -04:00
bvandeusen 6582d7699e refactor(android): migrate History/Liked/Search/Playlist rows to shared TrackRow 2026-05-29 22:44:09 -04:00
bvandeusen bbd483603d refactor(android): add shared slot-based TrackRow 2026-05-29 21:40:38 -04:00
bvandeusen dfb7245db8 refactor(android): route remaining covers (TrackCoverThumb, mini, now-playing) through ServerImage 2026-05-29 21:36:41 -04:00
bvandeusen 3e35127284 refactor(android): use shared formatDuration + ms/sec conversions 2026-05-29 15:46:56 -04:00
bvandeusen cf0ccd1f90 refactor(android): route all cover getters through albumCoverPath 2026-05-29 15:33:32 -04:00
bvandeusen 0741ba31b3 refactor(android): add shared albumCoverPath cover-URL builder 2026-05-29 14:39:31 -04:00
bvandeusen 4015fb145d refactor(android): add shared formatDuration + ms/sec conversion helpers 2026-05-29 14:38:52 -04:00
bvandeusen d7dda2fcef fix(android): derive artist tile cover from first cached album
Library + Home artist tiles were blank: cached_artists stores no cover and the sync payload (SyncArtistWire) carries none. Mirror Flutter's artistTileProvider JOIN — ArtistRef gains coverAlbumId + a displayCoverUrl getter; LibraryRepository.observeArtists and MetadataProvider.observeArtist combine artists with albums to supply the first album (by sort title) as the cover source. ArtistCard renders displayCoverUrl through ServerImage. Updated LibraryRepositoryTest to stub albumDao.observeAll so combine emits.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-29 12:35:09 -04:00
bvandeusen 1b243347cb fix(android): resolve relative server cover URLs via shared ServerImage
The server returns relative cover_url (/api/albums/{id}/cover, /api/playlists/{id}/cover). Android only resolved the empty-fallback placeholder trick, so any non-empty relative URL from a fresh fetch went to Coil host-less and silently failed (album detail, artist-detail album grid, playlist cards, artist avatars). Add a shared ServerImage composable + resolveServerImageUrl that prefixes the placeholder host (rewritten by BaseUrlInterceptor) for relative paths, passes http(s) through, and falls back when blank. Route AlbumCard, PlaylistCard, AlbumDetail header, and ArtistAvatar through it. Mirrors Flutter's ServerImage._resolve.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-29 12:30:21 -04:00
bvandeusen 85af93c63f fix(android): place shell banners below the status bar
ShellScaffold's banner column did not consume the status-bar inset while each screen's app bar did, so the update/connection banners drew under the status bar. Consume the inset once at the shell (statusBarsPadding) so banners sit below it; descendant screen app bars see the consumed inset and stop re-padding, matching Flutter's SafeArea(bottom:false).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-29 12:11:19 -04:00
bvandeusen 01b05f37c3 feat(android): per-tile skeleton reveal on Home via reactive section flows 2026-05-28 19:42:09 -04:00
bvandeusen 4eb225914c feat(android): add HomeArtistPrewarmer (top-8 artists, session-deduped) 2026-05-28 18:58:29 -04:00
bvandeusen b2512fff4b feat(android): bound MetadataProvider on-miss fetches to 4 concurrent 2026-05-28 18:26:13 -04:00
bvandeusen 5b5bff767a feat(android): add HomeTile model for per-tile hydration 2026-05-28 18:12:57 -04:00
bvandeusen 68891f1df9 fix(android): hold previous NowPlaying gradient color across track change
rememberDominantColor was keyed on coverUrl, so each track change reset the extracted color to Transparent and the gradient dipped toward the fallback before tweening to the new color. Drop the key so the held color stays on the previous track's dominant until the new palette resolves -- the gradient now tweens directly to the new color. Combined with CoverPrefetcher warming the next cover, this matches Flutter's preload-then-atomic-swap UX (no flash on track change) via native Compose mechanisms rather than a literal preload pipeline.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 15:12:33 -04:00
bvandeusen 61cf07a3cf feat(android): soft "update available" shell banner (#25)
Ports Flutter's UpdateBanner. UpdateBannerController polls
/api/client/version at launch + every 24h, compares the bundled APK
against this build via isVersionNewer, and exposes the available
UpdateInfo (minus in-memory per-version dismissals). The shell banner
nudges "Update Minstrel · {version} available" with Install (reusing
ApkInstaller's download + system-install handoff, routing to the
install-permission settings first when needed) and a dismiss X. Uses an
understated surfaceVariant tone, distinct from the error-colored
VersionTooOldBanner hard gate.

Divergence noted: ApkInstaller exposes no byte progress, so the
downloading state shows an indeterminate bar rather than Flutter's
determinate one.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 14:15:59 -04:00
bvandeusen 1ef5cd5b7a feat(android): swipe-up-to-expand gesture on MiniPlayer (#34)
Ports player_bar.dart's onVerticalDragEnd — an upward flick anywhere on
the bar expands into NowPlaying, alongside the existing tap-to-expand. A
vertical draggable claims only vertical-dominant drags, so the inline
seek slider keeps its horizontal scrub gesture. The 200 px/s Flutter
threshold is expressed in dp and density-converted so the flick feels
the same across screen densities.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 13:33:43 -04:00