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 hidden collection dialogs

David Nashash394ff376e7a3
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/home/HomeScreen.kt b/app/src/main/java/com/streamvault/app/ui/screens/home/HomeScreen.kt
index e7b1444d..aaee7340 100644
--- a/app/src/main/java/com/streamvault/app/ui/screens/home/HomeScreen.kt
+++ b/app/src/main/java/com/streamvault/app/ui/screens/home/HomeScreen.kt
@@ -44,11 +44,11 @@ import com.streamvault.feature.live.home.LiveCategorySidebarHeader
import com.streamvault.feature.live.home.LiveCategoryListHost
import com.streamvault.feature.live.home.LiveChannelContentHost
import com.streamvault.feature.live.home.LiveChannelListHost
+import com.streamvault.feature.live.home.LiveHiddenCategoriesDialog
+import com.streamvault.feature.live.home.LiveHiddenChannelsDialog
import com.streamvault.feature.live.presentation.components.LiveChannelRowSurface
import com.streamvault.core.ui.components.TvEmptyState
import com.streamvault.app.ui.components.dialogs.CategoryOptionsDialog
-import com.streamvault.app.ui.components.dialogs.HiddenCategoriesDialog
-import com.streamvault.app.ui.components.dialogs.HiddenChannelsDialog
import com.streamvault.core.ui.components.dialogs.PinDialog
import com.streamvault.core.ui.components.dialogs.PremiumDialog
import com.streamvault.core.ui.components.dialogs.PremiumDialogActionButton
@@ -247,8 +247,12 @@ fun HomeScreen(
}
if (showHiddenCategoriesDialog) {
- HiddenCategoriesDialog(
+ LiveHiddenCategoriesDialog(
hiddenCategories = uiState.hiddenLiveCategories,
+ title = stringResource(R.string.hidden_categories_dialog_title),
+ subtitle = stringResource(R.string.hidden_categories_dialog_subtitle),
+ unhideAllLabel = stringResource(R.string.hidden_categories_dialog_unhide_all),
+ closeLabel = stringResource(R.string.hidden_categories_dialog_close),
onUnhide = { viewModel.unhideCategory(it) },
onUnhideAll = {
viewModel.unhideAllLiveCategories()
@@ -267,8 +271,12 @@ fun HomeScreen(
}
if (showHiddenChannelsDialog) {
- HiddenChannelsDialog(
+ LiveHiddenChannelsDialog(
hiddenChannels = hiddenChannelsLiveTv,
+ title = stringResource(R.string.hidden_channels_dialog_title),
+ subtitle = stringResource(R.string.hidden_channels_dialog_subtitle),
+ unhideAllLabel = stringResource(R.string.hidden_channels_dialog_unhide_all),
+ closeLabel = stringResource(R.string.hidden_channels_dialog_close),
onUnhide = { viewModel.unhideChannel(it) },
onUnhideAll = {
viewModel.unhideAllChannels()
diff --git a/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md b/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md
index cdd8bc46..6898293d 100644
--- a/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md
+++ b/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md
@@ -133,12 +133,14 @@ quick-filter panel/chip row, the reusable EPG guide shortcut chip, the shared
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
-are now feature-owned
+and hidden category/channel dialogs are now feature-owned
while the Home and EPG
-screen/dialog composition remains in `:app`.
+screen/dialog composition remains in `:app` for the remaining app-specific
+dialogs.
The source switcher receives localized labels from the app at the current
composition boundary. Live-owned
-presentation primitives, `HomeUiState`, `HomePreviewUiState`, and Guide
-mode/density/reminder presentation models are independent of app code;
+presentation primitives, `HomeUiState`, `HomePreviewUiState`, Guide
+mode/density/reminder presentation models, and hidden collection dialogs 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 48418aa3..00de62c4 100644
--- a/docs/superpowers/plans/2026-08-28-live-feature-extraction.md
+++ b/docs/superpowers/plans/2026-08-28-live-feature-extraction.md
@@ -23,7 +23,7 @@ quick-filter panel/chip row, the reusable EPG guide shortcut chip, the shared
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
-are now feature-owned
+and hidden category/channel dialogs 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.
@@ -674,6 +674,9 @@ auto-scroll while the app retains row presentation and channel actions. The
category sidebar now calls `LiveCategoryListHost`, which owns category list
container/key/content-type mechanics while the app retains category policy,
focus transitions, and callbacks. The
+hidden category/channel dialogs now also live in `:feature:live`; `HomeScreen`
+supplies app-localized labels and retains the ViewModel callbacks while other
+app-specific dialogs remain in the composition root. The
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/LiveHiddenCollectionsDialogs.kt b/feature/live/src/main/java/com/streamvault/feature/live/home/LiveHiddenCollectionsDialogs.kt
new file mode 100644
index 00000000..084bddbd
--- /dev/null
+++ b/feature/live/src/main/java/com/streamvault/feature/live/home/LiveHiddenCollectionsDialogs.kt
@@ -0,0 +1,237 @@
+package com.streamvault.feature.live.home
+
+import androidx.compose.foundation.BorderStroke
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.shape.RoundedCornerShape
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.key
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.dp
+import androidx.tv.material3.Border
+import androidx.tv.material3.ClickableSurfaceDefaults
+import androidx.tv.material3.MaterialTheme
+import androidx.tv.material3.Text
+import com.streamvault.core.ui.components.dialogs.PremiumDialog
+import com.streamvault.core.ui.components.dialogs.PremiumDialogFooterButton
+import com.streamvault.core.ui.interaction.TvClickableSurface
+import com.streamvault.core.ui.theme.OnSurface
+import com.streamvault.core.ui.theme.OnSurfaceDim
+import com.streamvault.core.ui.theme.Primary
+import com.streamvault.core.ui.theme.PrimaryLight
+import com.streamvault.core.ui.theme.SurfaceElevated
+import com.streamvault.core.ui.theme.SurfaceHighlight
+import com.streamvault.domain.model.Category
+import com.streamvault.domain.model.Channel
+
+@Composable
+fun LiveHiddenCategoriesDialog(
+ hiddenCategories: List<Category>,
+ title: String,
+ subtitle: String,
+ unhideAllLabel: String,
+ closeLabel: String,
+ onUnhide: (Category) -> Unit,
+ onUnhideAll: () -> Unit,
+ onDismiss: () -> Unit
+) {
+ PremiumDialog(
+ title = title,
+ subtitle = subtitle,
+ onDismissRequest = onDismiss,
+ widthFraction = 0.55f,
+ heightFraction = 0.95f,
+ bodyHeightFraction = 0.85f,
+ content = {
+ TvClickableSurface(
+ onClick = onUnhideAll,
+ enabled = hiddenCategories.isNotEmpty(),
+ modifier = Modifier.fillMaxWidth(),
+ shape = ClickableSurfaceDefaults.shape(RoundedCornerShape(10.dp)),
+ colors = ClickableSurfaceDefaults.colors(
+ containerColor = SurfaceElevated,
+ focusedContainerColor = SurfaceHighlight
+ ),
+ border = ClickableSurfaceDefaults.border(
+ focusedBorder = Border(
+ border = BorderStroke(2.dp, PrimaryLight),
+ shape = RoundedCornerShape(10.dp)
+ )
+ ),
+ scale = ClickableSurfaceDefaults.scale(focusedScale = 1f)
+ ) {
+ Box(
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(horizontal = 12.dp, vertical = 8.dp),
+ contentAlignment = Alignment.Center
+ ) {
+ Text(
+ text = unhideAllLabel,
+ style = MaterialTheme.typography.labelMedium,
+ color = Primary
+ )
+ }
+ }
+ hiddenCategories.forEach { category ->
+ key(category.id) {
+ LiveHiddenCategoryRow(
+ category = category,
+ onUnhide = { onUnhide(category) }
+ )
+ }
+ }
+ },
+ footer = {
+ PremiumDialogFooterButton(label = closeLabel, onClick = onDismiss)
+ }
+ )
+}
+
+@Composable
+private fun LiveHiddenCategoryRow(
+ category: Category,
+ onUnhide: () -> Unit
+) {
+ TvClickableSurface(
+ onClick = onUnhide,
+ modifier = Modifier.fillMaxWidth(),
+ shape = ClickableSurfaceDefaults.shape(RoundedCornerShape(8.dp)),
+ colors = ClickableSurfaceDefaults.colors(
+ containerColor = SurfaceElevated.copy(alpha = 0.4f),
+ focusedContainerColor = SurfaceHighlight
+ ),
+ border = ClickableSurfaceDefaults.border(
+ focusedBorder = Border(
+ border = BorderStroke(2.dp, PrimaryLight),
+ shape = RoundedCornerShape(8.dp)
+ )
+ ),
+ scale = ClickableSurfaceDefaults.scale(focusedScale = 1f)
+ ) {
+ Row(
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(horizontal = 14.dp, vertical = 8.dp),
+ verticalAlignment = Alignment.CenterVertically
+ ) {
+ Text(
+ text = category.name,
+ style = MaterialTheme.typography.bodySmall,
+ color = OnSurface,
+ modifier = Modifier.weight(1f).padding(end = 12.dp)
+ )
+ if (category.count > 0) {
+ Text(
+ text = category.count.toString(),
+ style = MaterialTheme.typography.labelSmall,
+ color = OnSurfaceDim
+ )
+ }
+ }
+ }
+}
+
+@Composable
+fun LiveHiddenChannelsDialog(
+ hiddenChannels: List<Channel>,
+ title: String,
+ subtitle: String,
+ unhideAllLabel: String,
+ closeLabel: String,
+ onUnhide: (Channel) -> Unit,
+ onUnhideAll: () -> Unit,
+ onDismiss: () -> Unit
+) {
+ PremiumDialog(
+ title = title,
+ subtitle = subtitle,
+ onDismissRequest = onDismiss,
+ widthFraction = 0.55f,
+ heightFraction = 0.95f,
+ bodyHeightFraction = 0.85f,
+ content = {
+ TvClickableSurface(
+ onClick = onUnhideAll,
+ enabled = hiddenChannels.isNotEmpty(),
+ modifier = Modifier.fillMaxWidth(),
+ shape = ClickableSurfaceDefaults.shape(RoundedCornerShape(10.dp)),
+ colors = ClickableSurfaceDefaults.colors(
+ containerColor = SurfaceElevated,
+ focusedContainerColor = SurfaceHighlight
+ ),
+ border = ClickableSurfaceDefaults.border(
+ focusedBorder = Border(
+ border = BorderStroke(2.dp, PrimaryLight),
+ shape = RoundedCornerShape(10.dp)
+ )
+ ),
+ scale = ClickableSurfaceDefaults.scale(focusedScale = 1f)
+ ) {
+ Box(
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(horizontal = 12.dp, vertical = 8.dp),
+ contentAlignment = Alignment.Center
+ ) {
+ Text(
+ text = unhideAllLabel,
+ style = MaterialTheme.typography.labelMedium,
+ color = Primary
+ )
+ }
+ }
+ hiddenChannels.forEach { channel ->
+ key(channel.id) {
+ LiveHiddenChannelRow(
+ channel = channel,
+ onUnhide = { onUnhide(channel) }
+ )
+ }
+ }
+ },
+ footer = {
+ PremiumDialogFooterButton(label = closeLabel, onClick = onDismiss)
+ }
+ )
+}
+
+@Composable
+private fun LiveHiddenChannelRow(
+ channel: Channel,
+ onUnhide: () -> Unit
+) {
+ TvClickableSurface(
+ onClick = onUnhide,
+ modifier = Modifier.fillMaxWidth(),
+ shape = ClickableSurfaceDefaults.shape(RoundedCornerShape(8.dp)),
+ colors = ClickableSurfaceDefaults.colors(
+ containerColor = SurfaceElevated.copy(alpha = 0.4f),
+ focusedContainerColor = SurfaceHighlight
+ ),
+ border = ClickableSurfaceDefaults.border(
+ focusedBorder = Border(
+ border = BorderStroke(2.dp, PrimaryLight),
+ shape = RoundedCornerShape(8.dp)
+ )
+ ),
+ scale = ClickableSurfaceDefaults.scale(focusedScale = 1f)
+ ) {
+ Row(
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(horizontal = 14.dp, vertical = 8.dp),
+ verticalAlignment = Alignment.CenterVertically
+ ) {
+ Text(
+ text = channel.name,
+ style = MaterialTheme.typography.bodySmall,
+ color = OnSurface,
+ modifier = Modifier.weight(1f).padding(end = 12.dp)
+ )
+ }
+ }
+}