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): inject Home shell adapter

David Nashashd27fff055203
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.kt
index 1248afe7..a84169a7 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
@@ -7,6 +7,8 @@ import com.streamvault.app.navigation.playerNavigationRequest
import com.streamvault.app.navigation.toLivePlayerRequest
import com.streamvault.app.ui.screens.epg.FullEpgScreen
import com.streamvault.app.ui.screens.home.HomeScreen
+import com.streamvault.app.ui.components.shell.AppNavigationChrome
+import com.streamvault.app.ui.components.shell.AppScreenScaffold
import com.streamvault.core.navigation.AppDestination
import com.streamvault.core.navigation.NavigationActions
import com.streamvault.domain.playback.isArchivePlayable
@@ -36,6 +38,18 @@ internal fun NavGraphBuilder.registerLiveGraph(
},
onOpenMultiView = { onNavigate(AppRoutePatterns.MULTI_VIEW) },
onNavigate = onNavigate,
+ scaffold = { route, title, subtitle, content ->
+ AppScreenScaffold(
+ currentRoute = route,
+ onNavigate = onNavigate,
+ title = title,
+ subtitle = subtitle,
+ navigationChrome = AppNavigationChrome.TopBar,
+ compactHeader = true,
+ showScreenHeader = false,
+ content = content,
+ )
+ },
currentRoute = AppRoutePatterns.LIVE_TV,
initialCategoryId = initialCategoryId,
)
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 1d30ca64..ba59c79c 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
@@ -58,8 +58,6 @@ import com.streamvault.feature.live.presentation.components.LiveReorderTopBar
import com.streamvault.feature.live.presentation.home.liveHomeLayoutMetrics
import com.streamvault.feature.live.presentation.home.isLiveHomeCategoryLocked
import com.streamvault.feature.live.presentation.home.isLiveHomeChannelLocked
-import com.streamvault.app.ui.components.shell.AppNavigationChrome
-import com.streamvault.app.ui.components.shell.AppScreenScaffold
import com.streamvault.core.ui.design.FocusRestoreHost
import com.streamvault.core.ui.design.requestFocusSafely
import androidx.activity.compose.BackHandler
@@ -82,6 +80,7 @@ import com.streamvault.domain.model.RemoteShortcutProfile
import com.streamvault.feature.live.presentation.remote.LiveBrowseRemoteShortcutHandler
import com.streamvault.feature.live.presentation.remote.dispatchLiveBrowseRemoteShortcut
import com.streamvault.feature.live.presentation.remote.remoteColorButtonForKeyCode
+import com.streamvault.feature.live.api.LiveHomeScaffoldContent
private enum class FocusRestoreTarget {
CATEGORY,
@@ -105,6 +104,7 @@ fun HomeScreen(
onChannelClick: (Channel, Category?, Provider?, Long?, Long?) -> Unit,
onNavigate: (String) -> Unit,
onOpenMultiView: () -> Unit,
+ scaffold: LiveHomeScaffoldContent,
currentRoute: String,
initialCategoryId: Long? = null,
viewModel: HomeViewModel = hiltViewModel(),
@@ -271,14 +271,10 @@ fun HomeScreen(
}
Box(modifier = Modifier.fillMaxSize()) {
- AppScreenScaffold(
- currentRoute = currentRoute,
- onNavigate = onNavigate,
- title = stringResource(R.string.nav_live_tv),
- subtitle = uiState.activeLiveSourceTitle.ifBlank { uiState.provider?.name },
- navigationChrome = AppNavigationChrome.TopBar,
- compactHeader = true,
- showScreenHeader = false
+ scaffold(
+ currentRoute,
+ stringResource(R.string.nav_live_tv),
+ uiState.activeLiveSourceTitle.ifBlank { uiState.provider?.name },
) {
if (isReorderMode) {
LiveReorderTopBar(
diff --git a/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md b/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md
index 7e607126..4826d131 100644
--- a/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md
+++ b/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md
@@ -173,3 +173,8 @@ Home route composition is also app-independent at the screen boundary: Guide
uses `LiveRoutePatterns.EPG`, and MultiView is exposed through an injected
callback. The app graph remains the sole owner of the concrete MultiView
destination string.
+
+The Home screen consumes `LiveHomeScaffoldContent`; the app graph supplies the
+existing `AppScreenScaffold` adapter with the same top-bar, compact-header,
+and hidden-screen-header configuration. Shell ownership remains in `:app`,
+but the Live presentation no longer imports that app shell directly.
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 ac653329..738e89cf 100644
--- a/docs/superpowers/plans/2026-08-28-live-feature-extraction.md
+++ b/docs/superpowers/plans/2026-08-28-live-feature-extraction.md
@@ -47,6 +47,11 @@ feature-owned `LiveRoutePatterns.EPG`, while MultiView navigation is supplied
as an app composition callback. Dialog composition therefore carries no
MultiView route constant and remains behaviorally unchanged.
+The Home screen also consumes the `LiveHomeScaffoldContent` port. The app
+graph supplies the existing top-bar `AppScreenScaffold` adapter, leaving shell
+layout and destination configuration in the composition root while the Live
+surface moves toward feature ownership.
+
Route patterns were subsequently moved behind `LiveRoutePatterns`; the app
codec still owns encode/decode compatibility and no route behavior changed.
The feature-owned `registerLiveGraph` now owns Live destination argument
diff --git a/feature/live/src/main/java/com/streamvault/feature/live/api/LiveFeatureContracts.kt b/feature/live/src/main/java/com/streamvault/feature/live/api/LiveFeatureContracts.kt
index c96cc767..353d46ae 100644
--- a/feature/live/src/main/java/com/streamvault/feature/live/api/LiveFeatureContracts.kt
+++ b/feature/live/src/main/java/com/streamvault/feature/live/api/LiveFeatureContracts.kt
@@ -1,6 +1,7 @@
package com.streamvault.feature.live.api
import androidx.compose.runtime.Composable
+import androidx.compose.foundation.layout.ColumnScope
import com.streamvault.domain.model.Channel
import com.streamvault.domain.model.Program
import com.streamvault.domain.model.Result
@@ -95,6 +96,14 @@ typealias LiveMultiViewPlannerContent = @Composable (
onConfirmed: () -> Unit,
) -> Unit
+/** App-shell adapter used while the Live surface moves out of the composition root. */
+typealias LiveHomeScaffoldContent = @Composable (
+ currentRoute: String,
+ title: String,
+ subtitle: String?,
+ content: @Composable ColumnScope.() -> Unit,
+) -> Unit
+
/** Home content injected by the composition root into the feature-owned route. */
typealias LiveTvContent = @Composable (
initialCategoryId: Long?,