From 4d7a4312dbddd5e893d2e886ee9d9f7f965d9a77 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Tue, 26 May 2026 19:44:50 -0400 Subject: [PATCH] fix(android): hide Storage prefetch + cache-liked toggles (no-ops) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both were rendering controls that silently did nothing — there's no MetadataPrefetcher on Android, and no pin-on-like flow. A toggle that flips persisted state but has no functional effect makes the app look broken. Removed the two rows from StorageCard; CacheSettings persistence keeps the fields so the controls come back unchanged when the underlying systems land. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../minstrel/settings/ui/StorageCard.kt | 47 +++---------------- 1 file changed, 7 insertions(+), 40 deletions(-) diff --git a/android/app/src/main/java/com/fabledsword/minstrel/settings/ui/StorageCard.kt b/android/app/src/main/java/com/fabledsword/minstrel/settings/ui/StorageCard.kt index 22de2440..f70c9e96 100644 --- a/android/app/src/main/java/com/fabledsword/minstrel/settings/ui/StorageCard.kt +++ b/android/app/src/main/java/com/fabledsword/minstrel/settings/ui/StorageCard.kt @@ -16,7 +16,6 @@ import androidx.compose.material3.DropdownMenuItem import androidx.compose.material3.ElevatedCard import androidx.compose.material3.MaterialTheme import androidx.compose.material3.OutlinedButton -import androidx.compose.material3.Switch import androidx.compose.material3.Text import androidx.compose.material3.TextButton import androidx.compose.runtime.Composable @@ -42,8 +41,6 @@ private val CAP_OPTIONS: List> = listOf( 0L to "Unlimited", ) -private val PREFETCH_OPTIONS: List = listOf(1, 3, 5, 7, 10) - @Composable fun StorageCard(viewModel: StorageViewModel = hiltViewModel()) { val state by viewModel.state.collectAsStateWithLifecycle() @@ -69,15 +66,12 @@ fun StorageCard(viewModel: StorageViewModel = hiltViewModel()) { value = state.settings.rollingCapBytes, onSet = viewModel::setRollingCapBytes, ) - PrefetchDropdown( - value = state.settings.prefetchWindow, - onSet = viewModel::setPrefetchWindow, - ) - SwitchRow( - label = "Cache liked tracks", - value = state.settings.cacheLikedTracks, - onSet = viewModel::setCacheLikedTracks, - ) + // Pre-fetch ahead + Cache-liked-tracks toggles intentionally + // omitted in v1. The underlying systems (MetadataPrefetcher, + // pin-on-like flow) don't exist on Android yet — surfacing + // controls that silently do nothing is worse than hiding + // them. The CacheSettings fields are still persisted so + // the toggles return when the systems land. Text( text = "Cache limits take effect on the next app launch.", style = MaterialTheme.typography.bodySmall, @@ -131,20 +125,9 @@ private fun CapDropdown(label: String, value: Long, onSet: (Long) -> Unit) { ) } -@Composable -private fun PrefetchDropdown(value: Int, onSet: (Int) -> Unit) { - val selected = if (value in PREFETCH_OPTIONS) value else PREFETCH_OPTIONS[2] - LabeledDropdown( - label = "Pre-fetch ahead", - selectedLabel = "$selected tracks", - options = PREFETCH_OPTIONS.map { it to "$it tracks" }, - onSelect = onSet, - ) -} - /** * Label on the left, button-with-current-value on the right that opens - * a DropdownMenu of [options]. Used by both Cap and Prefetch selectors. + * a DropdownMenu of [options]. Used by the cap selectors. */ @Composable private fun LabeledDropdown( @@ -184,22 +167,6 @@ private fun LabeledDropdown( } } -@Composable -private fun SwitchRow(label: String, value: Boolean, onSet: (Boolean) -> Unit) { - Row( - modifier = Modifier.fillMaxWidth(), - verticalAlignment = Alignment.CenterVertically, - ) { - Text( - text = label, - style = MaterialTheme.typography.bodyMedium, - color = MaterialTheme.colorScheme.onSurfaceVariant, - modifier = Modifier.weight(1f), - ) - Switch(checked = value, onCheckedChange = onSet) - } -} - @Composable private fun StorageActions( isSyncing: Boolean,