From 43d436573c99317c9fc829e32660d7d54dc9931a Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Mon, 25 May 2026 00:25:29 -0400 Subject: [PATCH] fix(android): drop AvatarShape enum (detekt MatchingDeclarationName) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DiscoverTiles.kt held only one non-composable top-level decl (`enum class AvatarShape`), so detekt wanted the file renamed. The enum had two variants discriminating circle vs. rounded; a Boolean `circular` arg is the same information with no extra cost — collapses the `when` into a one-line `if`. Two call sites updated. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../minstrel/discover/ui/DiscoverTiles.kt | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/android/app/src/main/java/com/fabledsword/minstrel/discover/ui/DiscoverTiles.kt b/android/app/src/main/java/com/fabledsword/minstrel/discover/ui/DiscoverTiles.kt index 441f8062..613c7bae 100644 --- a/android/app/src/main/java/com/fabledsword/minstrel/discover/ui/DiscoverTiles.kt +++ b/android/app/src/main/java/com/fabledsword/minstrel/discover/ui/DiscoverTiles.kt @@ -30,8 +30,6 @@ import com.composables.icons.lucide.User import com.fabledsword.minstrel.models.ArtistSuggestionRef import com.fabledsword.minstrel.models.LidarrSearchResultRef -internal enum class AvatarShape { CIRCLE, ROUNDED } - @Composable internal fun SuggestionTile(s: ArtistSuggestionRef, onRequest: () -> Unit) { Row( @@ -41,7 +39,7 @@ internal fun SuggestionTile(s: ArtistSuggestionRef, onRequest: () -> Unit) { verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp), ) { - Avatar(imageUrl = s.imageUrl, fallback = Lucide.User, shape = AvatarShape.CIRCLE) + Avatar(imageUrl = s.imageUrl, fallback = Lucide.User, circular = true) Column(modifier = Modifier.weight(1f)) { Text( text = s.name, @@ -78,7 +76,7 @@ internal fun ResultTile( verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp), ) { - Avatar(imageUrl = row.imageUrl, fallback = Lucide.Disc3, shape = AvatarShape.ROUNDED) + Avatar(imageUrl = row.imageUrl, fallback = Lucide.Disc3, circular = false) Column(modifier = Modifier.weight(1f)) { Text( text = row.name, @@ -107,11 +105,8 @@ internal fun ResultTile( } @Composable -private fun Avatar(imageUrl: String, fallback: ImageVector, shape: AvatarShape) { - val clip = when (shape) { - AvatarShape.CIRCLE -> CircleShape - AvatarShape.ROUNDED -> RoundedCornerShape(6.dp) - } +private fun Avatar(imageUrl: String, fallback: ImageVector, circular: Boolean) { + val clip = if (circular) CircleShape else RoundedCornerShape(6.dp) Box( modifier = Modifier .size(56.dp)