StreamVault is a TV-first free IPTV player for Android TV built with Kotlin, Jetpack Compose, Room, Hilt, and Media3.
Kotlin iptv-player
refactor(live): extract delete group dialog
David Nashashdb2c6b9f791a
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/home/HomeScreenDialogs.kt b/app/src/main/java/com/streamvault/app/ui/screens/home/HomeScreenDialogs.ktindex 7c9f6c5c..b6fcd981 100644--- a/app/src/main/java/com/streamvault/app/ui/screens/home/HomeScreenDialogs.kt+++ b/app/src/main/java/com/streamvault/app/ui/screens/home/HomeScreenDialogs.kt@@ -1,7 +1,6 @@package com.streamvault.app.ui.screens.homeimport androidx.compose.runtime.Composable-import androidx.compose.runtime.LaunchedEffectimport androidx.compose.runtime.getValueimport androidx.compose.runtime.mutableStateOfimport androidx.compose.runtime.remember@@ -15,8 +14,6 @@ import com.streamvault.feature.live.home.HomeViewModelimport com.streamvault.app.navigation.Routesimport com.streamvault.app.ui.components.dialogs.AddToGroupDialogimport com.streamvault.core.ui.components.dialogs.PinDialog-import com.streamvault.core.ui.components.dialogs.PremiumDialog-import com.streamvault.core.ui.components.dialogs.PremiumDialogFooterButtonimport com.streamvault.app.ui.components.dialogs.RenameGroupDialogimport com.streamvault.app.ui.components.dialogs.M3uCategoryOrganizerDialogimport com.streamvault.app.ui.components.dialogs.M3uCategorySeriesAssignmentDialog@@ -27,6 +24,8 @@ import com.streamvault.feature.live.home.LiveCategoryOptionsDialogimport com.streamvault.feature.live.home.LiveCategoryOptionsDialogLabelsimport com.streamvault.feature.live.home.LiveAddQuickFilterDialogimport com.streamvault.feature.live.home.LiveAddQuickFilterDialogLabels+import com.streamvault.feature.live.home.LiveDeleteGroupDialog+import com.streamvault.feature.live.home.LiveDeleteGroupDialogLabelsimport com.streamvault.domain.model.ActiveLiveSourceimport com.streamvault.domain.model.Categoryimport com.streamvault.domain.model.Channel@@ -38,7 +37,6 @@ import com.streamvault.domain.model.ProviderTypeimport com.streamvault.domain.repository.M3uCategoryItemimport com.streamvault.domain.repository.M3uClassificationTargetimport kotlinx.coroutines.CoroutineScope-import kotlinx.coroutines.delayimport kotlinx.coroutines.launch@Composable@@ -367,33 +365,15 @@ internal fun HomeDialogsHost(val groupToDelete = uiState.groupToDeleteif (uiState.showDeleteGroupDialog && groupToDelete != null) {val group = groupToDelete- var canInteract by remember { mutableStateOf(false) }- LaunchedEffect(Unit) {- delay(500)- canInteract = true- }-- val safeDismiss = {- if (canInteract) viewModel.cancelDeleteGroup()- }-- PremiumDialog(- title = stringResource(R.string.home_delete_group_title),- subtitle = stringResource(R.string.home_delete_group_body, group.name),- onDismissRequest = safeDismiss,- widthFraction = 0.36f,- content = {},- footer = {- PremiumDialogFooterButton(- label = stringResource(R.string.home_delete_group_cancel),- onClick = safeDismiss- )- PremiumDialogFooterButton(- label = stringResource(R.string.home_delete_group_confirm),- onClick = { if (canInteract) viewModel.confirmDeleteGroup() },- destructive = true- )- }+ LiveDeleteGroupDialog(+ labels = LiveDeleteGroupDialogLabels(+ title = stringResource(R.string.home_delete_group_title),+ body = stringResource(R.string.home_delete_group_body, group.name),+ cancel = stringResource(R.string.home_delete_group_cancel),+ confirm = stringResource(R.string.home_delete_group_confirm)+ ),+ onDismiss = viewModel::cancelDeleteGroup,+ onConfirm = viewModel::confirmDeleteGroup)}}diff --git a/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md b/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.mdindex 7a72945e..3688cc72 100644--- a/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md+++ b/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md@@ -133,8 +133,8 @@ quick-filter panel/chip row, the reusable EPG guide shortcut chip, the sharedEPG guide-now ticker/provider, EPG search field/row, Home reorder top bar, andHome channel row surface, Home channel-results header, Home category sidebarheader, channel-content state host, channel-list host, and category-list host-and hidden category/channel dialogs, the category options dialog, and the-quick-filter add dialog are now feature-owned+and hidden category/channel dialogs, the category options dialog, the+quick-filter add dialog, and the delete-group dialog are now feature-ownedwhile the Home and EPGscreen/dialog composition remains in `:app` for the remaining app-specificdialogs.@@ -142,7 +142,7 @@ The source switcher receives localized labels from the app at the currentcomposition boundary. Live-ownedpresentation primitives, `HomeUiState`, `HomePreviewUiState`, Guidemode/density/reminder presentation models, hidden collection dialogs, the-category options dialog, and the quick-filter add dialog are independent of-app code;+category options dialog, the quick-filter add dialog, and the delete-group+dialog are independent of app code;screen/resource moves, golden/runtime/performance gates, and legacy app cleanupremain open, so no live slice acceptance gate is claimed yet.diff --git a/docs/superpowers/plans/2026-08-28-live-feature-extraction.md b/docs/superpowers/plans/2026-08-28-live-feature-extraction.mdindex 68a86989..f0541126 100644--- a/docs/superpowers/plans/2026-08-28-live-feature-extraction.md+++ b/docs/superpowers/plans/2026-08-28-live-feature-extraction.md@@ -23,8 +23,8 @@ quick-filter panel/chip row, the reusable EPG guide shortcut chip, the sharedEPG guide-now ticker/provider, EPG search field/row, Home reorder top bar,Home channel row surface, Home channel-results header, Home category sidebarheader, channel-content state host, channel-list host, and category-list host-and hidden category/channel dialogs, the category options dialog, and the-quick-filter add dialog are now feature-owned+and hidden category/channel dialogs, the category options dialog, the+quick-filter add dialog, and the delete-group dialog are now feature-ownedand their feature checks are green. Home screen/dialog composition, theremaining live cards/rows, complete locale resource migration, and acceptancegates remain open.@@ -682,6 +682,8 @@ dialog follows the same contract: feature-owned UI receives a label bundle andthe app retains policy/callback wiring. Thequick-filter add dialog also owns its draft text and duplicate check while theapp supplies the saved-filter snapshot and mutation callback. The+delete-group dialog owns its interaction guard and presentation while the app+supplies the already formatted group-specific copy and ViewModel callbacks.quick-filter key/selection rules are covered by `LiveQuickFiltersTest`. Theremaining app-owned live cards and shell/dialog composition still requirecompatibility seams before the full Home move.diff --git a/feature/live/src/main/java/com/streamvault/feature/live/home/LiveDeleteGroupDialog.kt b/feature/live/src/main/java/com/streamvault/feature/live/home/LiveDeleteGroupDialog.ktnew file mode 100644index 00000000..25c17f00--- /dev/null+++ b/feature/live/src/main/java/com/streamvault/feature/live/home/LiveDeleteGroupDialog.kt@@ -0,0 +1,54 @@+package com.streamvault.feature.live.home++import androidx.compose.runtime.Composable+import androidx.compose.runtime.LaunchedEffect+import androidx.compose.runtime.getValue+import androidx.compose.runtime.mutableStateOf+import androidx.compose.runtime.remember+import androidx.compose.runtime.setValue+import com.streamvault.core.ui.components.dialogs.PremiumDialog+import com.streamvault.core.ui.components.dialogs.PremiumDialogFooterButton+import kotlinx.coroutines.delay++data class LiveDeleteGroupDialogLabels(+ val title: String,+ val body: String,+ val cancel: String,+ val confirm: String+)++@Composable+fun LiveDeleteGroupDialog(+ labels: LiveDeleteGroupDialogLabels,+ onDismiss: () -> Unit,+ onConfirm: () -> Unit+) {+ var canInteract by remember { mutableStateOf(false) }+ LaunchedEffect(Unit) {+ delay(500)+ canInteract = true+ }++ val safeDismiss = {+ if (canInteract) onDismiss()+ }++ PremiumDialog(+ title = labels.title,+ subtitle = labels.body,+ onDismissRequest = safeDismiss,+ widthFraction = 0.36f,+ content = {},+ footer = {+ PremiumDialogFooterButton(+ label = labels.cancel,+ onClick = safeDismiss+ )+ PremiumDialogFooterButton(+ label = labels.confirm,+ onClick = { if (canInteract) onConfirm() },+ destructive = true+ )+ }+ )+}