From df9ae2db77909fbbfb1bd8f263686e92f8850b10 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Sun, 24 May 2026 20:59:30 -0400 Subject: [PATCH] fix(android): name Library tab indices (detekt MagicNumber) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit detekt flagged the `3` and `4` branch labels in the `when (selectedTab)` block. Promoted all five indices to TAB_ARTISTS … TAB_HIDDEN constants — same shape detekt would have suggested. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../minstrel/library/ui/LibraryScreen.kt | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/android/app/src/main/java/com/fabledsword/minstrel/library/ui/LibraryScreen.kt b/android/app/src/main/java/com/fabledsword/minstrel/library/ui/LibraryScreen.kt index c6f758e2..2d897a4a 100644 --- a/android/app/src/main/java/com/fabledsword/minstrel/library/ui/LibraryScreen.kt +++ b/android/app/src/main/java/com/fabledsword/minstrel/library/ui/LibraryScreen.kt @@ -91,19 +91,19 @@ fun LibraryScreen( ) { inner -> Box(modifier = Modifier.fillMaxSize().padding(inner)) { when (selectedTab) { - 0 -> ArtistsTab(viewModel = viewModel, navController = navController) - 1 -> AlbumsTab(viewModel = viewModel, navController = navController) - 2 -> ComingSoonTab( + TAB_ARTISTS -> ArtistsTab(viewModel = viewModel, navController = navController) + TAB_ALBUMS -> AlbumsTab(viewModel = viewModel, navController = navController) + TAB_HISTORY -> ComingSoonTab( title = "History", body = "Recent plays will appear here once /api/me/history " + "wiring lands in Phase 9.", ) - 3 -> ComingSoonTab( + TAB_LIKED -> ComingSoonTab( title = "Liked", body = "Liked artists, albums, and tracks will appear here " + "once the like-write path lands in Phase 8.", ) - 4 -> ComingSoonTab( + TAB_HIDDEN -> ComingSoonTab( title = "Hidden", body = "Tracks you've flagged as bad rips, wrong tags, or " + "duplicates will appear here in Phase 10.", @@ -113,6 +113,12 @@ fun LibraryScreen( } } +private const val TAB_ARTISTS = 0 +private const val TAB_ALBUMS = 1 +private const val TAB_HISTORY = 2 +private const val TAB_LIKED = 3 +private const val TAB_HIDDEN = 4 + private val LIBRARY_TABS = listOf("Artists", "Albums", "History", "Liked", "Hidden") @Composable