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 category list host

David Nashash9fa29dec87c6
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 a4855f11..e7b1444d 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
@@ -41,6 +41,7 @@ import com.streamvault.feature.live.home.HomeLoadingPane
import com.streamvault.feature.live.home.HomePreviewHost
import com.streamvault.feature.live.home.LiveChannelResultsHeader
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.presentation.components.LiveChannelRowSurface
@@ -711,18 +712,11 @@ fun HomeScreen(
onSavedFilterSelected = viewModel::applySavedCategoryFilter
)
- LazyColumn(
- modifier = Modifier.fillMaxWidth(),
- contentPadding = PaddingValues(bottom = 16.dp)
- ) {
-
- items(
- items = visibleCategories,
- key = { it.id },
- contentType = { "live_category" }
- ) { category ->
+ LiveCategoryListHost(
+ categories = visibleCategories,
+ categoryFocusRequesters = categoryFocusRequesters,
+ itemContent = { category, categoryFocusRequester ->
val isLocked = isCategoryLocked(category)
- val categoryFocusRequester = categoryFocusRequesters.getOrPut(category.id) { FocusRequester() }
CategoryItem(
category = category,
@@ -779,9 +773,9 @@ fun HomeScreen(
}
}
)
- }
+ }
+ )
}
- }
// Content - Channel Grid / Pro Preview
Row(
diff --git a/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md b/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md
index 67c63eb7..cdd8bc46 100644
--- a/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md
+++ b/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md
@@ -132,7 +132,8 @@ the loading/preview host supporting composables, the live source switcher, Home
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, and channel-list host are now feature-owned
+header, channel-content state host, channel-list host, and category-list host
+are now feature-owned
while the Home and EPG
screen/dialog composition remains in `:app`.
The source switcher receives localized labels from the app at the current
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 497d422d..48418aa3 100644
--- a/docs/superpowers/plans/2026-08-28-live-feature-extraction.md
+++ b/docs/superpowers/plans/2026-08-28-live-feature-extraction.md
@@ -22,7 +22,8 @@ loading/preview host supporting composables, the live source switcher, Home
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, and channel-list host are now feature-owned
+header, channel-content state host, channel-list host, and category-list host
+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.
@@ -670,6 +671,9 @@ locked-empty, and no-channel presentation while keeping the channel-list slot
in the app. The list mechanics now call `LiveChannelListHost` for lazy-list
state, visible-window/load-more reporting, reorder key handling, and drag
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
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/LiveCategoryListHost.kt b/feature/live/src/main/java/com/streamvault/feature/live/home/LiveCategoryListHost.kt
new file mode 100644
index 00000000..6827991f
--- /dev/null
+++ b/feature/live/src/main/java/com/streamvault/feature/live/home/LiveCategoryListHost.kt
@@ -0,0 +1,33 @@
+package com.streamvault.feature.live.home
+
+import androidx.compose.foundation.layout.PaddingValues
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.lazy.LazyColumn
+import androidx.compose.foundation.lazy.items
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.focus.FocusRequester
+import androidx.compose.ui.unit.dp
+import com.streamvault.domain.model.Category
+
+@Composable
+fun LiveCategoryListHost(
+ categories: List<Category>,
+ categoryFocusRequesters: MutableMap<Long, FocusRequester>,
+ itemContent: @Composable (category: Category, focusRequester: FocusRequester) -> Unit,
+ modifier: Modifier = Modifier
+) {
+ LazyColumn(
+ modifier = modifier.fillMaxWidth(),
+ contentPadding = PaddingValues(bottom = 16.dp)
+ ) {
+ items(
+ items = categories,
+ key = { it.id },
+ contentType = { "live_category" }
+ ) { category ->
+ val focusRequester = categoryFocusRequesters.getOrPut(category.id) { FocusRequester() }
+ itemContent(category, focusRequester)
+ }
+ }
+}