refactor(agenda): put range header and pill on one bar
All checks were successful
Translations / check (pull_request) Successful in 6s
CI / ci (pull_request) Successful in 9m46s

Move the session range pill from the bottom-left corner onto the same top
bar as the "Showing all upcoming events for …" header — header on the left,
pill on the right, each still independently toggleable.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-27 16:22:33 +02:00
parent f8a2569831
commit 6471c48528

View File

@@ -149,15 +149,39 @@ fun AgendaScreen(
) )
}, },
) { innerPadding -> ) { innerPadding ->
Box(modifier = Modifier.fillMaxSize()) {
Column( Column(
modifier = Modifier modifier = Modifier
.fillMaxSize() .fillMaxSize()
.padding(innerPadding), .padding(innerPadding),
) { ) {
// A header naming the concrete window currently shown. // One bar at the top: the "showing …" header on the left and the
successState?.takeIf { it.showRangeBanner }?.let { s -> // session range pill on the right (each toggleable independently).
AgendaRangeBanner(range = s.range, start = s.anchor, end = s.rangeEnd) val s = successState
if (s != null && (s.showRangeBanner || s.showRangePill)) {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier
.fillMaxWidth()
.padding(start = 28.dp, end = 16.dp, top = 8.dp, bottom = 8.dp),
) {
if (s.showRangeBanner) {
AgendaRangeBanner(
range = s.range,
start = s.anchor,
end = s.rangeEnd,
modifier = Modifier.weight(1f),
)
} else {
Spacer(Modifier.weight(1f))
}
if (s.showRangePill) {
AgendaRangePill(
range = s.range,
isOverride = s.rangeIsOverride,
onClick = { showRangePicker = true },
)
}
}
} }
AgendaContent( AgendaContent(
state = state, state = state,
@@ -168,20 +192,6 @@ fun AgendaScreen(
.fillMaxWidth(), .fillMaxWidth(),
) )
} }
// A bottom-left pill to peek at a different range for this
// session, mirroring the FAB column on the right.
successState?.takeIf { it.showRangePill }?.let { s ->
AgendaRangePill(
range = s.range,
isOverride = s.rangeIsOverride,
onClick = { showRangePicker = true },
modifier = Modifier
.align(Alignment.BottomStart)
.padding(innerPadding)
.padding(16.dp),
)
}
}
} }
} }
@@ -255,7 +265,7 @@ private fun AgendaRangeBanner(
) { ) {
val locale = currentLocale() val locale = currentLocale()
val window = agendaRangeWindowSummary(range, start, end, locale) val window = agendaRangeWindowSummary(range, start, end, locale)
Column(modifier = modifier.padding(horizontal = 28.dp, vertical = 8.dp)) { Column(modifier = modifier) {
Text( Text(
text = stringResource(R.string.agenda_range_showing_label), text = stringResource(R.string.agenda_range_showing_label),
style = MaterialTheme.typography.labelMedium, style = MaterialTheme.typography.labelMedium,