From d3e38285b8f441864d25f74200aed04af1d83e92 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Mon, 28 Sep 2026 16:36:59 -0400 Subject: [PATCH] fix(calendar): the calendar filter scrolls with the lenses instead of hiding one "All calendars" was pinned beside the scrolling lens chips and took its width out of them. Once "Friends going" joined the lenses, the row outgrew an 800px tablet and "Day" sat half-hidden under the pinned chip, with nothing to say the row scrolls. The filter now sits at the end of the same scrolling row, so every lens shows whole and the chip cut by the screen edge is the scroll cue. Checked on the tablet. Co-Authored-By: Claude Opus 5.5 --- .../loggedIn/calendars/CalendarsTopBar.kt | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/calendars/CalendarsTopBar.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/calendars/CalendarsTopBar.kt index 3ad0fc5182..99c31d4e52 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/calendars/CalendarsTopBar.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/calendars/CalendarsTopBar.kt @@ -33,6 +33,7 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.remember +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle @@ -84,17 +85,12 @@ fun CalendarsTopBar( ) } - Row( + CalendarsViewModeTabs( + current = viewMode, + onChange = onViewModeChange, + trailing = trailing, modifier = Modifier.fillMaxWidth().padding(horizontal = 8.dp), - verticalAlignment = androidx.compose.ui.Alignment.CenterVertically, - ) { - CalendarsViewModeTabs( - current = viewMode, - onChange = onViewModeChange, - modifier = Modifier.weight(1f), - ) - trailing?.invoke() - } + ) } } @@ -120,13 +116,19 @@ private fun CalendarsTopNavFilterBar( private fun CalendarsViewModeTabs( current: CalendarsViewMode, onChange: (CalendarsViewMode) -> Unit, + trailing: (@Composable () -> Unit)?, modifier: Modifier = Modifier, ) { + // The trailing control scrolls with the lenses instead of being pinned beside them: pinned, + // it took its width out of the scrolling part, and once the lenses outgrew what was left + // (on an 800px tablet, after "Friends going" joined them) the last lens sat half-hidden + // against it with nothing to say the row scrolls. A chip cut by the screen edge does. Row( modifier = modifier .horizontalScroll(rememberScrollState()) .padding(vertical = 4.dp), + verticalAlignment = Alignment.CenterVertically, ) { CalendarsViewMode.entries.forEach { mode -> FilterChip( @@ -143,5 +145,6 @@ private fun CalendarsViewModeTabs( shape = MaterialTheme.shapes.small, ) } + trailing?.invoke() } }