refactor: one cover fallback icon on Android, one paged-query type on the web
release / web (push) Successful in 1m19s
release / go (push) Successful in 1m45s
release / govulncheck (push) Successful in 19s
release / integration (push) Successful in 3m56s
release / android (push) Successful in 4m34s
release / Build signed APK (push) Successful in 5m3s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 25s
release / Verify release artifacts (tag releases only) (push) Skipped
release / web (push) Successful in 1m19s
release / go (push) Successful in 1m45s
release / govulncheck (push) Successful in 19s
release / integration (push) Successful in 3m56s
release / android (push) Successful in 4m34s
release / Build signed APK (push) Successful in 5m3s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 25s
release / Verify release artifacts (tag releases only) (push) Skipped
Ten Android covers wrote out the same muted icon for missing artwork; they now call CoverFallbackIcon beside CoverTile, and ShelfPlaylistCards' NoArtIcon wrapper is gone. AlbumDrillDown and AlphaLibrary each declared the infinite-query shape they read; both now take PagedQuery<T> from api/types. Folds the two small copies the M664 DRY close-out found (#8006). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -49,6 +49,7 @@ import com.fabledsword.minstrel.nav.AlbumDetail
|
||||
import com.fabledsword.minstrel.nav.ArtistDetail
|
||||
import com.fabledsword.minstrel.shared.formatDuration
|
||||
import com.fabledsword.minstrel.shared.plural
|
||||
import com.fabledsword.minstrel.shared.widgets.CoverFallbackIcon
|
||||
import com.fabledsword.minstrel.shared.widgets.CoverTile
|
||||
import com.fabledsword.minstrel.shared.widgets.ShellContentWindowInsets
|
||||
import com.fabledsword.minstrel.shared.widgets.TrackRow
|
||||
@@ -269,14 +270,7 @@ private fun AlbumCover(album: AlbumRef) {
|
||||
contentDescription = album.title,
|
||||
size = 120.dp,
|
||||
background = MaterialTheme.colorScheme.surfaceVariant,
|
||||
fallback = {
|
||||
Icon(
|
||||
imageVector = Lucide.Disc3,
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.size(56.dp),
|
||||
)
|
||||
},
|
||||
fallback = { CoverFallbackIcon(Lucide.Disc3) },
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ import com.fabledsword.minstrel.nav.AlbumDetail
|
||||
import com.fabledsword.minstrel.nav.ArtistDetail
|
||||
import com.fabledsword.minstrel.shared.formatDuration
|
||||
import com.fabledsword.minstrel.shared.plural
|
||||
import com.fabledsword.minstrel.shared.widgets.CoverFallbackIcon
|
||||
import com.fabledsword.minstrel.shared.widgets.ShellContentWindowInsets
|
||||
import com.fabledsword.minstrel.shared.widgets.ErrorRetry
|
||||
import com.fabledsword.minstrel.shared.widgets.HorizontalScrollRow
|
||||
@@ -330,14 +331,7 @@ private fun ArtistAvatar(artist: ArtistRef, fallbackAlbumId: String? = null) {
|
||||
url = model,
|
||||
contentDescription = artist.name,
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Lucide.User,
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.size(40.dp),
|
||||
)
|
||||
}
|
||||
) { CoverFallbackIcon(Lucide.User, size = 40.dp) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.composables.icons.lucide.Disc3
|
||||
import com.composables.icons.lucide.Lucide
|
||||
import androidx.compose.material3.Icon
|
||||
import com.fabledsword.minstrel.models.AlbumRef
|
||||
import com.fabledsword.minstrel.nav.LocalDetailSeedCache
|
||||
import com.fabledsword.minstrel.shared.widgets.CoverFallbackIcon
|
||||
import com.fabledsword.minstrel.shared.widgets.CoverTile
|
||||
import com.fabledsword.minstrel.shared.widgets.PlayCircleButton
|
||||
import androidx.compose.ui.Alignment
|
||||
@@ -63,14 +63,7 @@ fun AlbumCard(
|
||||
contentDescription = album.title,
|
||||
size = artSize,
|
||||
background = MaterialTheme.colorScheme.surfaceVariant,
|
||||
fallback = {
|
||||
Icon(
|
||||
imageVector = Lucide.Disc3,
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.size(56.dp),
|
||||
)
|
||||
},
|
||||
fallback = { CoverFallbackIcon(Lucide.Disc3) },
|
||||
overlay = {
|
||||
if (onPlay != null) {
|
||||
PlayCircleButton(
|
||||
|
||||
@@ -8,7 +8,6 @@ import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
@@ -24,6 +23,7 @@ import com.composables.icons.lucide.Lucide
|
||||
import com.composables.icons.lucide.User
|
||||
import com.fabledsword.minstrel.models.ArtistRef
|
||||
import com.fabledsword.minstrel.nav.LocalDetailSeedCache
|
||||
import com.fabledsword.minstrel.shared.widgets.CoverFallbackIcon
|
||||
import com.fabledsword.minstrel.shared.widgets.CoverTile
|
||||
import com.fabledsword.minstrel.shared.widgets.PlayCircleButton
|
||||
|
||||
@@ -67,14 +67,7 @@ fun ArtistCard(
|
||||
contentDescription = artist.name,
|
||||
size = artSize,
|
||||
shape = CircleShape,
|
||||
fallback = {
|
||||
Icon(
|
||||
imageVector = Lucide.User,
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.size(56.dp),
|
||||
)
|
||||
},
|
||||
fallback = { CoverFallbackIcon(Lucide.User) },
|
||||
overlay = {
|
||||
if (onPlay != null) {
|
||||
PlayCircleButton(
|
||||
|
||||
@@ -16,7 +16,6 @@ import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.foundation.layout.fillMaxHeight
|
||||
import androidx.compose.material3.Surface
|
||||
@@ -36,6 +35,7 @@ import com.composables.icons.lucide.Music
|
||||
import com.composables.icons.lucide.SkipBack
|
||||
import com.composables.icons.lucide.SkipForward
|
||||
import com.fabledsword.minstrel.models.TrackRef
|
||||
import com.fabledsword.minstrel.shared.widgets.CoverFallbackIcon
|
||||
import com.fabledsword.minstrel.shared.widgets.LikeButton
|
||||
import com.fabledsword.minstrel.shared.widgets.ServerImage
|
||||
import com.fabledsword.minstrel.shared.widgets.trackactions.TrackActionsViewModel
|
||||
@@ -67,13 +67,7 @@ private fun MiniCover(coverUrl: String, contentDescription: String) {
|
||||
url = url,
|
||||
contentDescription = contentDescription,
|
||||
modifier = Modifier.size(COVER_SIZE_DP.dp),
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Lucide.Music,
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
}
|
||||
) { CoverFallbackIcon(Lucide.Music, size = 24.dp) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,6 +87,7 @@ import com.fabledsword.minstrel.player.output.OutputPickerSheet
|
||||
import com.fabledsword.minstrel.player.output.OutputPickerViewModel
|
||||
import com.fabledsword.minstrel.player.output.OutputRoute
|
||||
import com.fabledsword.minstrel.player.output.RouteSnapshot
|
||||
import com.fabledsword.minstrel.shared.widgets.CoverFallbackIcon
|
||||
import kotlinx.coroutines.launch
|
||||
import com.fabledsword.minstrel.nav.AlbumDetail
|
||||
import com.fabledsword.minstrel.nav.ArtistDetail
|
||||
@@ -547,14 +548,7 @@ private fun NowPlayingCover(coverUrl: String, contentDescription: String) {
|
||||
url = coverUrl,
|
||||
contentDescription = contentDescription,
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Lucide.Music,
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.size(96.dp),
|
||||
)
|
||||
}
|
||||
) { CoverFallbackIcon(Lucide.Music, size = 96.dp) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-8
@@ -86,6 +86,7 @@ import com.fabledsword.minstrel.playlists.data.withoutEntry
|
||||
import com.fabledsword.minstrel.shared.formatDuration
|
||||
import com.fabledsword.minstrel.shared.plural
|
||||
import com.fabledsword.minstrel.shared.widgets.ConfirmDestructiveDialog
|
||||
import com.fabledsword.minstrel.shared.widgets.CoverFallbackIcon
|
||||
import com.fabledsword.minstrel.shared.widgets.CoverTile
|
||||
import com.fabledsword.minstrel.shared.widgets.NameDialog
|
||||
import com.fabledsword.minstrel.shared.widgets.ReorderHandles
|
||||
@@ -679,14 +680,7 @@ private fun PlaylistCover(playlist: PlaylistRef) {
|
||||
contentDescription = playlist.name,
|
||||
size = 120.dp,
|
||||
background = MaterialTheme.colorScheme.surfaceVariant,
|
||||
fallback = {
|
||||
Icon(
|
||||
imageVector = Lucide.ListMusic,
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.size(56.dp),
|
||||
)
|
||||
},
|
||||
fallback = { CoverFallbackIcon(Lucide.ListMusic) },
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
+2
-9
@@ -8,7 +8,6 @@ import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
@@ -24,6 +23,7 @@ import com.composables.icons.lucide.Lucide
|
||||
import com.fabledsword.minstrel.models.PlaylistRef
|
||||
import com.fabledsword.minstrel.nav.LocalDetailSeedCache
|
||||
import com.fabledsword.minstrel.shared.plural
|
||||
import com.fabledsword.minstrel.shared.widgets.CoverFallbackIcon
|
||||
import com.fabledsword.minstrel.shared.widgets.CoverTile
|
||||
import com.fabledsword.minstrel.shared.widgets.PlayCircleButton
|
||||
import com.fabledsword.minstrel.theme.FabledSwordFlatTokens
|
||||
@@ -106,14 +106,7 @@ private fun PlaylistCardCover(
|
||||
url = playlist.coverUrl,
|
||||
contentDescription = playlist.name,
|
||||
size = 144.dp,
|
||||
fallback = {
|
||||
Icon(
|
||||
imageVector = Lucide.ListMusic,
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.size(56.dp),
|
||||
)
|
||||
},
|
||||
fallback = { CoverFallbackIcon(Lucide.ListMusic) },
|
||||
overlay = {
|
||||
if (playlist.isSystem) {
|
||||
VariantPill(
|
||||
|
||||
+4
-13
@@ -16,7 +16,6 @@ import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.layout.widthIn
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
@@ -46,6 +45,7 @@ import com.fabledsword.minstrel.playlists.Rgb
|
||||
import com.fabledsword.minstrel.playlists.songsLikeArtist
|
||||
import com.fabledsword.minstrel.playlists.washTone
|
||||
import com.fabledsword.minstrel.shared.plural
|
||||
import com.fabledsword.minstrel.shared.widgets.CoverFallbackIcon
|
||||
import com.fabledsword.minstrel.shared.widgets.CoverTile
|
||||
import com.fabledsword.minstrel.shared.widgets.PlayCircleButton
|
||||
import com.fabledsword.minstrel.shared.widgets.ServerImage
|
||||
@@ -145,7 +145,7 @@ fun SongsLikeCard(
|
||||
size = ROUND_SIZE,
|
||||
shape = CircleShape,
|
||||
background = MaterialTheme.colorScheme.surfaceVariant,
|
||||
fallback = { NoArtIcon() },
|
||||
fallback = { CoverFallbackIcon(Lucide.ListMusic, size = NO_ART_ICON_SIZE) },
|
||||
overlay = {
|
||||
PlayCircleButton(
|
||||
onPlay = onPlay,
|
||||
@@ -267,21 +267,11 @@ internal fun LeadArt(url: String?, modifier: Modifier) {
|
||||
url = url,
|
||||
contentDescription = null,
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
fallback = { NoArtIcon() },
|
||||
fallback = { CoverFallbackIcon(Lucide.ListMusic, size = NO_ART_ICON_SIZE) },
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun NoArtIcon() {
|
||||
Icon(
|
||||
imageVector = Lucide.ListMusic,
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.size(40.dp),
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun Modifier.stashingClick(playlist: PlaylistRef, onClick: () -> Unit): Modifier {
|
||||
val seedCache = LocalDetailSeedCache.current
|
||||
@@ -354,6 +344,7 @@ private val ROUND_WIDTH = 136.dp
|
||||
private val ROUND_SIZE = 120.dp
|
||||
internal val CARD_RADIUS = 12.dp
|
||||
private val FAN_COVER = 95.dp
|
||||
private val NO_ART_ICON_SIZE = 40.dp
|
||||
private val MICRO_LABEL_TRACKING = 0.9.sp
|
||||
|
||||
private const val FAN_SPAN = 0.8f
|
||||
|
||||
@@ -6,13 +6,17 @@ import androidx.compose.foundation.layout.BoxScope
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.Shape
|
||||
import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.fabledsword.minstrel.theme.FabledSwordFlatTokens
|
||||
|
||||
/**
|
||||
@@ -63,3 +67,19 @@ fun CoverTile(
|
||||
overlay()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* What a cover shows when it has no artwork, or its artwork fails to load:
|
||||
* the kind of thing it is (an album's disc, an artist's figure, a
|
||||
* playlist's list) drawn in the muted on-surface colour. 56dp suits the
|
||||
* library's cards; smaller and larger covers pass their own [size].
|
||||
*/
|
||||
@Composable
|
||||
fun CoverFallbackIcon(icon: ImageVector, size: Dp = 56.dp) {
|
||||
Icon(
|
||||
imageVector = icon,
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.size(size),
|
||||
)
|
||||
}
|
||||
|
||||
+1
-9
@@ -5,7 +5,6 @@ import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
@@ -47,14 +46,7 @@ fun TrackCoverThumb(
|
||||
url = coverUrl,
|
||||
contentDescription = contentDescription,
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Lucide.Music,
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.size(size / 2),
|
||||
)
|
||||
}
|
||||
) { CoverFallbackIcon(Lucide.Music, size = size / 2) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user