Merge remote-tracking branch 'origin/main' into fm/tv-spacing-b7

This commit is contained in:
justinzeus 2026-11-06 13:17:37 +01:00
commit b9ea593735
4 changed files with 133 additions and 5 deletions

View file

@ -11,7 +11,7 @@ data class ShellPerson(val key: String, val name: String, val initial: String, v
/** The shell owns keys; the integration owns navigation and authenticated user changes. */
sealed interface ShellAction {
data class Destination(val route: String) : ShellAction
data class Destination(val route: String, val preservePushed: Boolean = false) : ShellAction
data class Person(val person: ShellPerson) : ShellAction
data class HandOff(val group: String) : ShellAction
data object Pop : ShellAction
@ -59,8 +59,14 @@ class ShellState(
people = value
if (selected != null) person = selected
pickerIndex = people.indexOf(person).coerceAtLeast(0)
val removedRoot = rootRoute !in tabs
if (removedRoot) {
if (route == rootRoute) route = "home"
rootRoute = "home"
}
preparePersonMemory()
navIndex = if (avatarFocused) tabs.size else tabs.indexOf(focusedTab).takeIf { it >= 0 } ?: currentTab
if (removedRoot) onAction(ShellAction.Destination("home", preservePushed = true))
}
var person by mutableStateOf(people.firstOrNull { it.key == initialPerson } ?: people.first())
private set