fix(android): name Library tab indices (detekt MagicNumber)

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) <noreply@anthropic.com>
This commit is contained in:
2026-05-24 20:59:30 -04:00
parent 6062233c63
commit df9ae2db77
@@ -91,19 +91,19 @@ fun LibraryScreen(
) { inner -> ) { inner ->
Box(modifier = Modifier.fillMaxSize().padding(inner)) { Box(modifier = Modifier.fillMaxSize().padding(inner)) {
when (selectedTab) { when (selectedTab) {
0 -> ArtistsTab(viewModel = viewModel, navController = navController) TAB_ARTISTS -> ArtistsTab(viewModel = viewModel, navController = navController)
1 -> AlbumsTab(viewModel = viewModel, navController = navController) TAB_ALBUMS -> AlbumsTab(viewModel = viewModel, navController = navController)
2 -> ComingSoonTab( TAB_HISTORY -> ComingSoonTab(
title = "History", title = "History",
body = "Recent plays will appear here once /api/me/history " + body = "Recent plays will appear here once /api/me/history " +
"wiring lands in Phase 9.", "wiring lands in Phase 9.",
) )
3 -> ComingSoonTab( TAB_LIKED -> ComingSoonTab(
title = "Liked", title = "Liked",
body = "Liked artists, albums, and tracks will appear here " + body = "Liked artists, albums, and tracks will appear here " +
"once the like-write path lands in Phase 8.", "once the like-write path lands in Phase 8.",
) )
4 -> ComingSoonTab( TAB_HIDDEN -> ComingSoonTab(
title = "Hidden", title = "Hidden",
body = "Tracks you've flagged as bad rips, wrong tags, or " + body = "Tracks you've flagged as bad rips, wrong tags, or " +
"duplicates will appear here in Phase 10.", "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") private val LIBRARY_TABS = listOf("Artists", "Albums", "History", "Liked", "Hidden")
@Composable @Composable