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): isolate multiview planner composition
David Nashash354d28422ca2
diff --git a/app/src/main/java/com/streamvault/app/live/AppLiveMultiViewPlanner.kt b/app/src/main/java/com/streamvault/app/live/AppLiveMultiViewPlanner.ktnew file mode 100644index 00000000..1f2bf75f--- /dev/null+++ b/app/src/main/java/com/streamvault/app/live/AppLiveMultiViewPlanner.kt@@ -0,0 +1,31 @@+package com.streamvault.app.live++import androidx.compose.runtime.Composable+import androidx.compose.runtime.remember+import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel+import com.streamvault.feature.live.api.LiveMultiViewPlannerContent+import com.streamvault.feature.playback.multiview.MultiViewPlannerDialog+import com.streamvault.feature.playback.multiview.MultiViewViewModel++/** App composition adapter for the Playback-owned MultiView planner. */+internal data class AppLiveMultiViewPlannerAdapter(+ val content: LiveMultiViewPlannerContent,+ val isChannelQueued: (Long) -> Boolean,+)++@Composable+internal fun rememberAppLiveMultiViewPlannerContent(+ viewModel: MultiViewViewModel = hiltViewModel(),+): AppLiveMultiViewPlannerAdapter = remember(viewModel) {+ AppLiveMultiViewPlannerAdapter(+ content = { selectedChannel, onDismiss, onConfirmed ->+ MultiViewPlannerDialog(+ pendingChannel = selectedChannel,+ onDismiss = onDismiss,+ onLaunch = onConfirmed,+ viewModel = viewModel,+ )+ },+ isChannelQueued = viewModel::isQueued,+ )+}diff --git a/app/src/main/java/com/streamvault/app/navigation/graph/LiveGraph.kt b/app/src/main/java/com/streamvault/app/navigation/graph/LiveGraph.ktindex 733c5b96..f2673eae 100644--- a/app/src/main/java/com/streamvault/app/navigation/graph/LiveGraph.kt+++ b/app/src/main/java/com/streamvault/app/navigation/graph/LiveGraph.kt@@ -1,16 +1,14 @@package com.streamvault.app.navigation.graphimport androidx.navigation.NavGraphBuilder-import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModelimport com.streamvault.app.navigation.AppRouteCodecimport com.streamvault.app.navigation.AppRoutePatternsimport com.streamvault.app.live.toAppArchivePlayerNavigationRequest+import com.streamvault.app.live.rememberAppLiveMultiViewPlannerContentimport com.streamvault.app.live.toAppPlayerNavigationRequestimport com.streamvault.app.ui.components.shell.AppNavigationChromeimport com.streamvault.app.ui.components.shell.AppScreenScaffoldimport com.streamvault.app.ui.components.dialogs.AddToGroupDialog-import com.streamvault.feature.playback.multiview.MultiViewPlannerDialog-import com.streamvault.feature.playback.multiview.MultiViewViewModelimport com.streamvault.core.navigation.AppDestinationimport com.streamvault.core.navigation.NavigationActionsimport com.streamvault.domain.playback.isArchivePlayable@@ -27,7 +25,7 @@ internal fun NavGraphBuilder.registerLiveGraph() {registerFeatureLiveGraph(liveTvContent = { initialCategoryId, onPlaybackRequested, onNavigate ->- val multiViewViewModel: MultiViewViewModel = hiltViewModel()+ val multiViewPlanner = rememberAppLiveMultiViewPlannerContent()LiveHomeScreen(onChannelClick = { channel, category, provider, combinedProfileId, combinedSourceFilterProviderId ->onPlaybackRequested(@@ -56,14 +54,7 @@ internal fun NavGraphBuilder.registerLiveGraph(content = content,)},- multiViewPlanner = { selectedChannel, onDismiss, onConfirmed ->- MultiViewPlannerDialog(- pendingChannel = selectedChannel,- onDismiss = onDismiss,- onLaunch = onConfirmed,- viewModel = multiViewViewModel,- )- },+ multiViewPlanner = multiViewPlanner.content,addToGroupContent = { request: LiveAddToGroupDialogRequest ->AddToGroupDialog(contentTitle = request.contentTitle,@@ -84,7 +75,7 @@ internal fun NavGraphBuilder.registerLiveGraph(onMoveToSeries = request.onMoveToSeries,)},- isChannelQueuedForMultiView = multiViewViewModel::isQueued,+ isChannelQueuedForMultiView = multiViewPlanner.isChannelQueued,currentRoute = AppRoutePatterns.LIVE_TV,initialCategoryId = initialCategoryId,)diff --git a/docs/superpowers/plans/2026-08-28-live-feature-extraction.md b/docs/superpowers/plans/2026-08-28-live-feature-extraction.mdindex b9051e34..df28f0e0 100644--- a/docs/superpowers/plans/2026-08-28-live-feature-extraction.md+++ b/docs/superpowers/plans/2026-08-28-live-feature-extraction.md@@ -987,7 +987,7 @@ Delegate to the existing `playerNavigationRequest`/`toLivePlayerRequest`helpers so payload behavior stays app-owned. Do not duplicate codec or payloadstorage.-- [ ] **Step 5: Compose the existing MultiView planner in app**+- [x] **Step 5: Compose the existing MultiView planner in app**Implement `rememberAppLiveMultiViewPlannerContent()` as a composable providerthat obtains the existing `MultiViewViewModel` in the destination composition@@ -995,6 +995,10 @@ and renders `MultiViewPlannerDialog(pendingChannel, onDismiss, onLaunch,viewModel)`. The feature supplies the state-clearing callbacks; the app contentonly renders Playback presentation.+`AppLiveMultiViewPlanner.kt` now owns this adapter. It remembers the existing+Playback ViewModel, exposes the planner content and queue predicate, and leaves+all planner state/lifecycle behavior in Playback.+- [x] **Step 6: Wire `AppNavHost` and verify RED-to-GREEN integration**Replace the app graph call with `com.streamvault.feature.live.navigation.registerLiveGraph`, pass `rememberAppDestinationItems(...)`, app player mapping callbacks, `onTopLevelDestinationRequested`, and planner content.@@ -1012,13 +1016,16 @@ Expected: PASS with one production owner for each live destination.The route/mapping/navigation bundle passed on 2026-08-29, including the Liveboundary verifier and app Kotlin compilation.-- [ ] **Step 8: Commit graph ownership**+- [x] **Step 8: Commit graph ownership**```powershellgit add feature/live/src/main/java/com/streamvault/feature/live/navigation feature/live/src/test/java/com/streamvault/feature/live/navigation app/src/main/java/com/streamvault/app/live app/src/test/java/com/streamvault/app/live app/src/main/java/com/streamvault/app/navigationgit commit -m "feat(live): register feature-owned navigation graph"```+The graph contract, app player mapper, and MultiView composition adapter were+committed together in `8a3e8cd1`.+---### Task 9: Remove legacy ownership and run structural/resource gates