Welcome Tour: Create your own from the channels step (0.108.49)
The same flow as Settings', then back to the step. In the tour nothing is saved and the phone isn't offered. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -53,7 +53,9 @@ private val HourChoices = listOf(null to "All day", OnHours(18, 0) to "Evenings,
|
||||
@Composable
|
||||
internal fun CreateChannelFlow(maker: ChannelMaker, editing: CustomChannel?, onDone: (String?) -> Unit, modifier: Modifier = Modifier,
|
||||
/** For previews: where to open, and what's been offered and chosen. */
|
||||
opening: CreateStep? = null, offeredAtFirst: List<Suggestion> = emptyList(), chosenAtFirst: List<Suggestion> = emptyList()) {
|
||||
opening: CreateStep? = null, offeredAtFirst: List<Suggestion> = emptyList(), chosenAtFirst: List<Suggestion> = emptyList(),
|
||||
/** Offer the phone: not in the Welcome Tour, where a phone's channel would be saved for real. */
|
||||
phone: Boolean = true) {
|
||||
val scope = rememberCoroutineScope()
|
||||
var step by remember { mutableStateOf(opening ?: if (editing != null) CreateStep.Name else CreateStep.Start) }
|
||||
var name by remember { mutableStateOf(editing?.name.orEmpty()) }
|
||||
@@ -81,7 +83,7 @@ internal fun CreateChannelFlow(maker: ChannelMaker, editing: CustomChannel?, onD
|
||||
CreateStep.Start -> Row(horizontalArrangement = Arrangement.spacedBy(14.dp)) {
|
||||
ChoiceCard("On this TV", listOf("Name it and pick its number", "Add shows, or let the Director's Chair suggest them",
|
||||
"Choose how it plays", "Choose when it's on"), Modifier.weight(1f).focusRequester(first)) { step = CreateStep.Name }
|
||||
PhoneCard(Modifier.weight(1f))
|
||||
if (phone) PhoneCard(Modifier.weight(1f)) else Spacer(Modifier.weight(1f))
|
||||
}
|
||||
CreateStep.Name -> {
|
||||
Text("Your channel goes in Yours, as $number.", color = Muted, fontSize = 13.sp)
|
||||
|
||||
@@ -217,15 +217,26 @@ private fun TourSignedIn(onNext: () -> Unit) {
|
||||
private fun ChannelsStep(onNext: () -> Unit) {
|
||||
var ticked by remember { mutableStateOf(OnboardStartChannels) }
|
||||
val setting = ChannelSetup.wanted.isNotEmpty()
|
||||
// Create your own from here (Paul, 6 November 2026): the same flow as Settings', then back to this step. In the tour
|
||||
// nothing is saved, so its last step only says what would have happened.
|
||||
var creating by remember { mutableStateOf(false) }
|
||||
var made by remember { mutableStateOf<String?>(null) }
|
||||
val maker = PhoneLink.handler?.maker?.let { real -> if (!Onboarding.tour) real else ChannelMaker(real.suggest, real.search,
|
||||
{ c, _ -> "This is a tour, so nothing was saved: ${c.name} would be ready on ${c.number}." }, real.showsOf) }
|
||||
if (!setting && creating && maker != null) {
|
||||
CreateChannelFlow(maker, null, { result -> made = result; creating = false }, Modifier.fillMaxSize(), phone = !Onboarding.tour)
|
||||
return
|
||||
}
|
||||
if (!setting) {
|
||||
val first = remember { FocusRequester() }
|
||||
LaunchedEffect(Unit) { first.requestFocus() }
|
||||
Column(Modifier.fillMaxSize(), verticalArrangement = Arrangement.spacedBy(10.dp)) {
|
||||
Text("Your channels", color = Ink, fontFamily = Anton, fontSize = 30.sp)
|
||||
Text("Orbit's ready-made channels, each matched to your library. The ticked ones suit most libraries; tick any you like. " +
|
||||
"Making your own channels comes next, in Settings.", color = Muted, fontSize = 14.sp)
|
||||
"Or make one of your own with Create your own.", color = Muted, fontSize = 14.sp)
|
||||
made?.let { Text(it, color = themed(Color(0xFF6EDCAA)) { Mint }, fontSize = 14.sp, fontWeight = FontWeight.SemiBold) }
|
||||
LazyVerticalGrid(GridCells.Fixed(5), Modifier.weight(1f), verticalArrangement = Arrangement.spacedBy(6.dp), horizontalArrangement = Arrangement.spacedBy(6.dp)) {
|
||||
items(SmartChannels.sortedBy { it.number }.filter { it.number !in LockedChannels }, key = { it.number }) { programming ->
|
||||
items(SmartChannels.sortedBy { it.number }.filter { it.number !in LockedChannels && it.number !in YOURS_FIRST..YOURS_LAST }, key = { it.number }) { programming ->
|
||||
val on = programming.number in ticked
|
||||
var focused by remember { mutableStateOf(false) }
|
||||
val corner = RoundedCornerShape(8.dp)
|
||||
@@ -243,6 +254,7 @@ private fun ChannelsStep(onNext: () -> Unit) {
|
||||
}
|
||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(16.dp)) {
|
||||
OrbitButton("Set up ${ticked.size} channels", enabled = ticked.isNotEmpty(), onClick = { ChannelSetup.begin(SmartChannels.map { it.number }.filter { it in ticked }) })
|
||||
if (maker != null) OrbitButton("Create your own", onClick = { made = null; creating = true })
|
||||
Text("Change them any time in Settings › Channels.", color = Muted, fontSize = 13.sp)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user