Skip to content

StreamVault is a TV-first free IPTV player for Android TV built with Kotlin, Jetpack Compose, Room, Hilt, and Media3.

refactor(live): extract m3u organizer dialog

David Nashash64118c53486a
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.kt
index e5b68fdc..01e917b6 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
@@ -14,7 +14,6 @@ import com.streamvault.feature.live.home.HomeViewModel
import com.streamvault.app.navigation.Routes
import com.streamvault.app.ui.components.dialogs.AddToGroupDialog
import com.streamvault.core.ui.components.dialogs.PinDialog
-import com.streamvault.app.ui.components.dialogs.M3uCategoryOrganizerDialog
import com.streamvault.app.ui.components.dialogs.M3uCategorySeriesAssignmentDialog
import com.streamvault.app.ui.components.dialogs.M3uSeriesAssignmentDialog
import com.streamvault.feature.playback.multiview.MultiViewPlannerDialog
@@ -27,6 +26,8 @@ import com.streamvault.feature.live.home.LiveDeleteGroupDialog
import com.streamvault.feature.live.home.LiveDeleteGroupDialogLabels
import com.streamvault.feature.live.home.LiveRenameGroupDialog
import com.streamvault.feature.live.home.LiveRenameGroupDialogLabels
+import com.streamvault.feature.live.home.LiveM3uCategoryOrganizerDialog
+import com.streamvault.feature.live.home.LiveM3uCategoryOrganizerLabels
import com.streamvault.domain.model.ActiveLiveSource
import com.streamvault.domain.model.Category
import com.streamvault.domain.model.Channel
@@ -301,8 +302,15 @@ internal fun HomeDialogsHost(
}
pendingM3uCategory?.let { category ->
- M3uCategoryOrganizerDialog(
+ LiveM3uCategoryOrganizerDialog(
categoryName = category.name,
+ labels = LiveM3uCategoryOrganizerLabels(
+ subtitle = stringResource(R.string.m3u_category_rule_subtitle),
+ moveToMovies = stringResource(R.string.m3u_move_to_movies),
+ moveToSeries = stringResource(R.string.m3u_move_to_series),
+ keepLive = stringResource(R.string.m3u_keep_live),
+ cancel = stringResource(R.string.category_options_cancel)
+ ),
onDismiss = { pendingM3uCategory = null },
onTargetSelected = { target ->
if (target == M3uClassificationTarget.SERIES) {
diff --git a/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md b/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md
index b04c8d02..81cb280f 100644
--- a/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md
+++ b/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md
@@ -134,8 +134,8 @@ EPG guide-now ticker/provider, EPG search field/row, Home reorder top bar, and
Home channel row surface, Home channel-results header, Home category sidebar
header, channel-content state host, channel-list host, and category-list host
and hidden category/channel dialogs, the category options dialog, the
-quick-filter add dialog, delete-group dialog, and rename-group dialog are now
-feature-owned
+quick-filter add dialog, delete-group dialog, rename-group dialog, and the M3U
+category organizer dialog are now feature-owned
while the Home and EPG
screen/dialog composition remains in `:app` for the remaining app-specific
dialogs.
@@ -144,6 +144,7 @@ composition boundary. Live-owned
presentation primitives, `HomeUiState`, `HomePreviewUiState`, Guide
mode/density/reminder presentation models, hidden collection dialogs, the
category options dialog, the quick-filter add dialog, the delete-group dialog,
-and the rename-group dialog are independent of app code;
+and the rename-group dialog and M3U category organizer dialog are independent
+of app code;
screen/resource moves, golden/runtime/performance gates, and legacy app cleanup
remain 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.md
index dae9ea4e..f35750fb 100644
--- a/docs/superpowers/plans/2026-08-28-live-feature-extraction.md
+++ b/docs/superpowers/plans/2026-08-28-live-feature-extraction.md
@@ -24,8 +24,8 @@ EPG guide-now ticker/provider, EPG search field/row, Home reorder top bar,
Home channel row surface, Home channel-results header, Home category sidebar
header, channel-content state host, channel-list host, and category-list host
and hidden category/channel dialogs, the category options dialog, the
-quick-filter add dialog, delete-group dialog, and rename-group dialog are now
-feature-owned
+quick-filter add dialog, delete-group dialog, rename-group dialog, and the M3U
+category organizer dialog are now feature-owned
and their feature checks are green. Home screen/dialog composition, the
remaining live cards/rows, complete locale resource migration, and acceptance
gates remain open.
@@ -687,6 +687,8 @@ delete-group dialog owns its interaction guard and presentation while the app
supplies the already formatted group-specific copy and ViewModel callbacks.
The rename-group dialog owns draft text, focus, and device sizing while the app
supplies validation text and rename/cancel callbacks.
+The M3U category organizer likewise receives explicit labels and reports only
+the selected classification target to the app.
quick-filter key/selection rules are covered by `LiveQuickFiltersTest`. The
remaining app-owned live cards and shell/dialog composition still require
compatibility seams before the full Home move.
diff --git a/feature/live/src/main/java/com/streamvault/feature/live/home/LiveM3uCategoryOrganizerDialog.kt b/feature/live/src/main/java/com/streamvault/feature/live/home/LiveM3uCategoryOrganizerDialog.kt
new file mode 100644
index 00000000..76ec8afb
--- /dev/null
+++ b/feature/live/src/main/java/com/streamvault/feature/live/home/LiveM3uCategoryOrganizerDialog.kt
@@ -0,0 +1,96 @@
+package com.streamvault.feature.live.home
+
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.window.Dialog
+import androidx.compose.ui.window.DialogProperties
+import androidx.tv.material3.Button
+import androidx.tv.material3.ButtonDefaults
+import androidx.tv.material3.MaterialTheme
+import androidx.tv.material3.Surface
+import androidx.tv.material3.SurfaceDefaults
+import androidx.tv.material3.Text
+import com.streamvault.core.ui.theme.OnSurface
+import com.streamvault.core.ui.theme.SurfaceElevated
+import com.streamvault.domain.repository.M3uClassificationTarget
+
+data class LiveM3uCategoryOrganizerLabels(
+ val subtitle: String,
+ val moveToMovies: String,
+ val moveToSeries: String,
+ val keepLive: String,
+ val cancel: String
+)
+
+@Composable
+fun LiveM3uCategoryOrganizerDialog(
+ categoryName: String,
+ labels: LiveM3uCategoryOrganizerLabels,
+ onDismiss: () -> Unit,
+ onTargetSelected: (M3uClassificationTarget) -> Unit
+) {
+ Dialog(
+ onDismissRequest = onDismiss,
+ properties = DialogProperties(usePlatformDefaultWidth = false)
+ ) {
+ Surface(
+ modifier = Modifier.fillMaxWidth(0.55f),
+ colors = SurfaceDefaults.colors(containerColor = SurfaceElevated)
+ ) {
+ Column(
+ modifier = Modifier.padding(28.dp),
+ verticalArrangement = Arrangement.spacedBy(12.dp)
+ ) {
+ Text(categoryName, style = MaterialTheme.typography.headlineSmall, color = OnSurface)
+ Text(labels.subtitle, color = OnSurface.copy(alpha = 0.75f))
+ LiveM3uOrganizerAction(
+ label = labels.moveToMovies,
+ containerColor = MaterialTheme.colorScheme.primary,
+ onClick = { onTargetSelected(M3uClassificationTarget.MOVIE) }
+ )
+ LiveM3uOrganizerAction(
+ label = labels.moveToSeries,
+ containerColor = MaterialTheme.colorScheme.secondary,
+ onClick = { onTargetSelected(M3uClassificationTarget.SERIES) }
+ )
+ LiveM3uOrganizerAction(
+ label = labels.keepLive,
+ containerColor = Color.White.copy(alpha = 0.08f),
+ contentColor = OnSurface,
+ onClick = { onTargetSelected(M3uClassificationTarget.LIVE) }
+ )
+ LiveM3uOrganizerAction(
+ label = labels.cancel,
+ containerColor = Color.White.copy(alpha = 0.08f),
+ contentColor = OnSurface,
+ onClick = onDismiss
+ )
+ }
+ }
+ }
+}
+
+@Composable
+private fun LiveM3uOrganizerAction(
+ label: String,
+ containerColor: Color,
+ contentColor: Color = Color.Black,
+ onClick: () -> Unit
+) {
+ Button(
+ onClick = onClick,
+ modifier = Modifier.fillMaxWidth(),
+ colors = ButtonDefaults.colors(
+ containerColor = containerColor,
+ contentColor = contentColor
+ )
+ ) {
+ Text(label)
+ }
+}