Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ sealed interface Destination {
/** Settings → Workspace → Tasks & Routines. */
data object Routines : Destination

/** Home → the routine calendar (MOCA-191). */
data object Calendar : Destination

/** Settings → Workspace → Connected Apps. */
data object ConnectedApps : Destination

Expand Down Expand Up @@ -143,6 +146,7 @@ class CompanionNavigator(initial: List<Destination> = listOf(Destination.Roster)
private const val ROSTER = "roster"
private const val SETTINGS = "settings"
private const val ROUTINES = "routines"
private const val CALENDAR = "calendar"
private const val CONNECTED_APPS = "connected-apps"
private const val THREAD = "thread:"
private const val COMPUTER = "computer:"
Expand All @@ -156,6 +160,7 @@ class CompanionNavigator(initial: List<Destination> = listOf(Destination.Roster)
Destination.Roster -> ROSTER
Destination.Settings -> SETTINGS
Destination.Routines -> ROUTINES
Destination.Calendar -> CALENDAR
Destination.ConnectedApps -> CONNECTED_APPS
is Destination.Thread -> THREAD + it.threadId
is Destination.Computer -> COMPUTER + it.botId
Expand All @@ -173,6 +178,7 @@ class CompanionNavigator(initial: List<Destination> = listOf(Destination.Roster)
it == ROSTER -> Destination.Roster
it == SETTINGS -> Destination.Settings
it == ROUTINES -> Destination.Routines
it == CALENDAR -> Destination.Calendar
it == CONNECTED_APPS -> Destination.ConnectedApps
it.startsWith(THREAD) -> Destination.Thread(it.removePrefix(THREAD))
it.startsWith(COMPUTER) -> Destination.Computer(it.removePrefix(COMPUTER))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,11 @@ private fun PairedScreen(
// iOS appends it to the same navigation path.
onOpenChat = navigator::open,
)
Destination.Calendar -> RoutineCalendarScreen(
onBack = navigator::pop,
// A run opens the chat its results went to, above the calendar.
onOpenChat = navigator::open,
)
Destination.ConnectedApps -> ConnectedAppsScreen(onBack = navigator::pop)
// One branch for both shapes of chat address, so a notification's thread
// becoming an addressed chat re-reads the same screen instead of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import androidx.compose.material.icons.filled.Create
import androidx.compose.material.icons.filled.Notifications
import androidx.compose.material.icons.filled.Person
import androidx.compose.material.icons.filled.Search
import androidx.compose.material.icons.filled.DateRange
import androidx.compose.material.icons.filled.Settings
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.ExperimentalMaterial3Api
Expand Down Expand Up @@ -299,6 +300,7 @@ fun RosterScreen(navigator: CompanionNavigator) {
name = connection?.name,
status = status,
onSettings = { navigator.push(Destination.Settings) },
onCalendar = { navigator.push(Destination.Calendar) },
)
StatusBanner()

Expand Down Expand Up @@ -624,7 +626,7 @@ private val StringSetSaver = listSaver<Set<String>, String>(
* they live in the bar at the bottom and at the end of the groups strip.
*/
@Composable
private fun RosterHeader(name: String?, status: Session.Status, onSettings: () -> Unit) {
private fun RosterHeader(name: String?, status: Session.Status, onSettings: () -> Unit, onCalendar: () -> Unit) {
Row(
modifier = Modifier
.fillMaxWidth()
Expand Down Expand Up @@ -659,6 +661,14 @@ private fun RosterHeader(name: String?, status: Session.Status, onSettings: () -
)
}

// Routines on a calendar, a tap from Home rather than buried in
// Settings (MOCA-191).
ChromeButton(
icon = Icons.Filled.DateRange,
contentDescription = stringResource(R.string.mobile_calendar_open),
onClick = onCalendar,
modifier = Modifier.testTag("open-calendar"),
)
ChromeButton(
icon = Icons.Filled.Settings,
contentDescription = stringResource(R.string.mobile_settings_c7f73bb5),
Expand Down
Loading
Loading