Release v2.23.1 (#453)
Release — F-Droid repo + Gitea/Codeberg release + Play / detect (push) Successful in 8s
Renovate / renovate (push) Successful in 2m2s
Release — F-Droid repo + Gitea/Codeberg release + Play / release (push) Successful in 17m11s
Release — F-Droid repo + Gitea/Codeberg release + Play / play (push) Successful in 1m37s

Follow-up to the #142 feedback in the split month view:

- With a day selected, the filter chip now stands in for the day's header, so the date isn't shown twice. Tapping the chip opens the Day view; its ✕ clears the filter.
- The day headers in the agenda pane below the grid use less vertical space.
- Event dots no longer drop on days that show a "+N".

Closes #142

Co-authored-by: Jean-Luc Makiola <business@jeanlucmakiola.de>
Reviewed-on: https://codeberg.org/jlmakiola/calendula/pulls/453
This commit is contained in:
Jean-Luc Makiolaandmakiolaj committed 2026-10-28 20:11:10 +01:00
1 parent dbd5ce6700
commit a5c4a73de1
22 files changed
+105 -22

No files matched your search

@@ -59,11 +59,16 @@ import java.util.Locale
// split style can list a day with exactly the same visual language instead of
// growing a parallel set of event rows.
/**
* A day's header; tapping it opens the Day view. [compact] trims the padding for
* the month view's split pane, where vertical space is short (#142).
*/
@Composable
internal fun AgendaDayHeader(
date: LocalDate,
today: LocalDate,
onOpenDay: (LocalDate) -> Unit,
compact: Boolean = false,
) {
Surface(
color = MaterialTheme.colorScheme.surface,
@@ -79,7 +84,12 @@ internal fun AgendaDayHeader(
} else {
MaterialTheme.colorScheme.onSurfaceVariant
},
modifier = Modifier.padding(start = 28.dp, end = 28.dp, top = 16.dp, bottom = 8.dp),
modifier = Modifier.padding(
start = 28.dp,
end = 28.dp,
top = if (compact) 8.dp else 16.dp,
bottom = if (compact) 4.dp else 8.dp,
),
)
}
}
@@ -220,10 +230,11 @@ internal fun LazyListScope.agendaDays(
dimmed: (EventInstance, LocalDate) -> Boolean,
onOpenDay: (LocalDate) -> Unit,
onEventClick: (EventInstance) -> Unit,
compact: Boolean = false,
) {
days.forEach { day ->
stickyHeader(key = "header-${day.date}") {
AgendaDayHeader(date = day.date, today = today, onOpenDay = onOpenDay)
AgendaDayHeader(date = day.date, today = today, onOpenDay = onOpenDay, compact = compact)
}
if (day.events.isEmpty()) {
item(key = "placeholder-${day.date}") {
@@ -251,6 +262,6 @@ internal fun LazyListScope.agendaDays(
)
}
}
item(key = "gap-${day.date}") { Spacer(Modifier.height(8.dp)) }
item(key = "gap-${day.date}") { Spacer(Modifier.height(if (compact) 4.dp else 8.dp)) }
}
}
@@ -63,6 +63,7 @@ import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.itemsIndexed
@@ -157,10 +158,9 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle
import de.jeanlucmakiola.calendula.R
import de.jeanlucmakiola.calendula.domain.EventInstance
import de.jeanlucmakiola.calendula.domain.hasEnded
import de.jeanlucmakiola.calendula.ui.agenda.AgendaDayHeader
import de.jeanlucmakiola.calendula.ui.agenda.agendaDayLabel
import de.jeanlucmakiola.calendula.ui.agenda.AgendaEmptyDayRow
import de.jeanlucmakiola.calendula.ui.agenda.AgendaEventRow
import de.jeanlucmakiola.calendula.ui.agenda.agendaDayLabel
import de.jeanlucmakiola.calendula.ui.common.formatCalendarTitle
import de.jeanlucmakiola.calendula.ui.common.AppBarSpacing
import de.jeanlucmakiola.calendula.ui.common.CalendarFailure
@@ -1423,24 +1423,13 @@ private fun SplitMonthCollapsed(
.then(paneModifier)
.then(rememberSplitPaneSwipe(onPaneSwipeNext, onPaneSwipePrev)),
) {
InputChip(
selected = true,
onClick = onClearSelection,
label = { Text(agendaDayLabel(selected, state.today)) },
trailingIcon = {
Icon(
Icons.Default.Close,
contentDescription = stringResource(R.string.month_split_clear_filter),
)
},
modifier = Modifier.padding(start = 16.dp),
)
SplitDayPane(
date = selected,
today = state.today,
events = state.instancesByDay[selected],
zone = state.zone,
onOpenDay = onOpenDay,
onClearSelection = onClearSelection,
onEventClick = onEventClick,
onCreateEvent = onCreateEvent,
modifier = Modifier.weight(1f).fillMaxWidth(),
@@ -1814,7 +1803,10 @@ private fun SplitDots(
if (events.isEmpty()) return
val soften = LocalSoftenColors.current
val dimCutoff = LocalDimCutoff.current
// Held to the dots' height so a "+N" doesn't grow the row and push the dots
// down; the label overflows it evenly instead (#142).
Row(
modifier = Modifier.height(SPLIT_DOT_SIZE),
horizontalArrangement = Arrangement.spacedBy(2.dp),
verticalAlignment = Alignment.CenterVertically,
) {
@@ -1849,6 +1841,7 @@ private fun SplitDots(
style = MaterialTheme.typography.labelSmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier
.wrapContentHeight(unbounded = true)
.morphBounds(MonthMorphKey.Overflow(date))
.alpha(if (allEnded(hidden, date, dimCutoff)) EventDimAlpha else 1f),
)
@@ -1872,7 +1865,7 @@ private fun SplitMonthAgendaPane(
.sorted()
val dimCutoff = LocalDimCutoff.current
val listState = key(state.month) { rememberLazyListState() }
LazyColumn(state = listState, contentPadding = PaddingValues(top = 8.dp, bottom = 96.dp)) {
LazyColumn(state = listState, contentPadding = PaddingValues(top = 4.dp, bottom = 96.dp)) {
agendaDays(
days = days.map { AgendaDay(it, state.instancesByDay[it].orEmpty()) },
today = state.today,
@@ -1882,6 +1875,7 @@ private fun SplitMonthAgendaPane(
dimmed = { event, day -> dimCutoff != null && event.isPastOn(day, dimCutoff) },
onOpenDay = onOpenDay,
onEventClick = onEventClick,
compact = true,
)
}
}
@@ -1889,7 +1883,8 @@ private fun SplitMonthAgendaPane(
/**
* The selected day's events, in the agenda's own row vocabulary so the two
* surfaces read as one app. The date header opens the full Day view, matching
* the Week and Agenda headers (#37).
* the Week and Agenda headers (#37). It is shown as the filter chip itself,
* whose ✕ clears the day filter back to the whole month (#142).
*/
@Composable
internal fun SplitDayPane(
@@ -1899,6 +1894,7 @@ internal fun SplitDayPane(
events: List<EventInstance>?,
zone: TimeZone,
onOpenDay: (LocalDate) -> Unit,
onClearSelection: () -> Unit,
onEventClick: (EventInstance) -> Unit,
onCreateEvent: (LocalDate) -> Unit,
modifier: Modifier = Modifier,
@@ -1910,7 +1906,23 @@ internal fun SplitDayPane(
val enter = itemEnter()
val fadeSpec = rememberCalendarFadeSpec()
Column(modifier = modifier) {
AgendaDayHeader(date = date, today = today, onOpenDay = onOpenDay)
InputChip(
selected = true,
onClick = { onOpenDay(date) },
label = {
Text(agendaDayLabel(date, today), style = MaterialTheme.typography.titleSmall)
},
trailingIcon = {
Icon(
Icons.Default.Close,
contentDescription = stringResource(R.string.month_split_clear_filter),
modifier = Modifier
.clip(CircleShape)
.clickable(onClick = onClearSelection),
)
},
modifier = Modifier.padding(start = 16.dp),
)
AnimatedContent(
targetState = date to events,
modifier = Modifier.weight(1f).fillMaxWidth(),
@@ -83,6 +83,7 @@ internal fun MonthStylePreview(
events = sample.month.instancesByDay[today].orEmpty(),
zone = zone,
onOpenDay = {},
onClearSelection = {},
onEventClick = {},
onCreateEvent = {},
modifier = Modifier.fillMaxWidth().height(SPLIT_PANE_HEIGHT),