lists: don't open the drawer on UP

SmartTube keeps the focus in place when you press up on a list's first
row — the drawer popping was surprising ("why does the sidebar show up
when I go up"). The upToTopBar wiring that did it is removed everywhere;
the drawer stays reachable via LEFT at any row start, which is the other
half of the rule.
This commit is contained in:
Jeena 2026-10-13 23:37:29 +00:00
parent 64a01d8ca2
commit f0031d25c8
4 changed files with 0 additions and 16 deletions

View file

@ -217,7 +217,6 @@ fun HomeRowsScreen(
restoreToken: Int = 0,
epoch: Int = 0,
onOpenDrawer: () -> Unit = {},
upToTopBar: (() -> Unit)? = null,
viewModel: HomeRowsViewModel = viewModel(key = "home$epoch", factory = HomeRowsViewModel.factory),
) {
val continueRestore = androidx.compose.runtime.remember { androidx.compose.runtime.mutableIntStateOf(-1) }
@ -264,7 +263,6 @@ fun HomeRowsScreen(
onLeftAtStart = onOpenDrawer,
clickedIndex = continueRestore,
restoreToken = restoreToken,
upToTopBar = upToTopBar,
autoFocusOnLoad = true,
autoFocusAllowed = { !userNavigated },
)
@ -336,7 +334,6 @@ fun FocusScrollRow(
onLeftAtStart: () -> Unit,
clickedIndex: androidx.compose.runtime.MutableIntState? = null, // set on card click
restoreToken: Int = 0, // bumped when playback ends
upToTopBar: (() -> Unit)? = null, // first content row only
// Only the FIRST row auto-focuses its first card when items arrive — every other
// row would otherwise steal focus whenever it finishes loading (#3).
autoFocusOnLoad: Boolean = false,
@ -403,7 +400,6 @@ fun FocusScrollRow(
compact = true,
progress = progressOf(video.shortUUID),
onLeftAtStart = if (index == 0) onLeftAtStart else null,
onUpToTopBar = upToTopBar,
onFocused = { focusedIndex = index },
)
afterItem(index, video)

View file

@ -174,7 +174,6 @@ fun HomeScreen(viewModel: AppViewModel = androidx.lifecycle.viewmodel.compose.vi
restoreToken = restoreToken,
epoch = epoch,
onOpenDrawer = { drawerOpen = true },
upToTopBar = { drawerOpen = true },
)
else -> when (destination) {
Destination.Home ->
@ -184,7 +183,6 @@ fun HomeScreen(viewModel: AppViewModel = androidx.lifecycle.viewmodel.compose.vi
epoch = epoch,
onOpenDrawer = { drawerOpen = true },
// UP over the first row opens the drawer.
upToTopBar = { drawerOpen = true },
)
Destination.MyVideos ->
VideoListScreen(
@ -193,7 +191,6 @@ fun HomeScreen(viewModel: AppViewModel = androidx.lifecycle.viewmodel.compose.vi
restoreToken = restoreToken,
epoch = epoch,
onOpenDrawer = { drawerOpen = true },
upToTopBar = { drawerOpen = true },
)
Destination.Channels -> ChannelsScreen(
onOpenChannel = { handle -> channelDetails = handle },
@ -207,7 +204,6 @@ fun HomeScreen(viewModel: AppViewModel = androidx.lifecycle.viewmodel.compose.vi
restoreToken = restoreToken,
epoch = epoch,
onOpenDrawer = { drawerOpen = true },
upToTopBar = { drawerOpen = true },
)
Destination.Subscriptions ->
VideoListScreen(
@ -216,7 +212,6 @@ fun HomeScreen(viewModel: AppViewModel = androidx.lifecycle.viewmodel.compose.vi
restoreToken = restoreToken,
epoch = epoch,
onOpenDrawer = { drawerOpen = true },
upToTopBar = { drawerOpen = true },
)
Destination.History ->
VideoListScreen(
@ -225,7 +220,6 @@ fun HomeScreen(viewModel: AppViewModel = androidx.lifecycle.viewmodel.compose.vi
restoreToken = restoreToken,
epoch = epoch,
onOpenDrawer = { drawerOpen = true },
upToTopBar = { drawerOpen = true },
)
}
}

View file

@ -60,7 +60,6 @@ fun VideoCard(
/** LEFT (only on the row's first card) can open the menu drawer. */
onLeftAtStart: (() -> Unit)? = null,
/** Explicit UP-target for the first content row (focus search misses the top bar). */
onUpToTopBar: (() -> Unit)? = null,
/** Notifies the row wrapper when this card gains focus (for eased scrolling). */
onFocused: (() -> Unit)? = null,
) {
@ -81,9 +80,6 @@ fun VideoCard(
direction == androidx.compose.ui.input.key.Key.DirectionLeft && onLeftAtStart != null -> {
onLeftAtStart(); true
}
direction == androidx.compose.ui.input.key.Key.DirectionUp && onUpToTopBar != null -> {
onUpToTopBar(); true
}
else -> false
}
} else false

View file

@ -51,7 +51,6 @@ fun VideoListScreen(
restoreToken: Int = 0,
epoch: Int = 0,
onOpenDrawer: () -> Unit = {},
upToTopBar: (() -> Unit)? = null,
viewModel: VideoListViewModel = viewModel(
key = "v$epoch:" + sourceKey(source),
factory = VideoListViewModel.factory(source),
@ -169,7 +168,6 @@ fun VideoListScreen(
showPrivacy = source is ListSource.MyVideos,
compact = true,
onLeftAtStart = if (index % cardsPerRow == 0) onOpenDrawer else null,
onUpToTopBar = upToTopBar?.takeIf { index < 4 },
modifier = Modifier
.focusRequester(fr),
)