From 26737825453dc310cc2f74b5c5396e96f67ea64f Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Thu, 8 Oct 2026 17:11:39 +0200 Subject: [PATCH] Tidy wording in comments and changelog (#367) --- CHANGELOG.md | 2 +- .../calendula/ui/CalendarHost.kt | 4 ++-- .../calendula/ui/agenda/AgendaScreen.kt | 18 +++++++++--------- .../calendula/ui/month/MonthScreen.kt | 2 +- .../calendula/ui/week/WeekScreen.kt | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a6391af..9eac8dc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added -- **Scroll back to earlier days in the agenda.** Scroll up past today to see the events of the days before, a month at a time. Past days follow the past-events setting: dimmed with Dim, and not shown at all with Hide ([#367]). +- **Scroll back to earlier days in the agenda.** Scroll up past today to see earlier days' events, loaded a month at a time. Past days follow the past-events setting: Dim fades them, and with Hide the agenda still starts at today ([#367]). ### Fixed - **The agenda always starts today.** Coming from the month or day view, the agenda used to start at the day you had open there, so "Next 30 days" could show the 1st to the 30th of the month. It now opens on today with your chosen range. Backing out of a day you opened from the agenda still returns you to where you were ([#367]). diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/CalendarHost.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/CalendarHost.kt index 709c087d..a18abae0 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/CalendarHost.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/CalendarHost.kt @@ -146,8 +146,8 @@ fun CalendarHost( mutableStateOf(listOf(defaultView)) } var navigationVersion by remember { mutableIntStateOf(0) } - // Whether the view on show was reached by backing out of a day drilled into - // from it, so the agenda returns to where it was instead of today (#367). + // True after backing out of a day opened from the view now shown, so the + // agenda returns to where it was instead of today (#367). var returnedFromDay by remember { mutableStateOf(false) } val view = viewStack.last() // The date every view opens on and carries along (#184); tapping a day diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/agenda/AgendaScreen.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/agenda/AgendaScreen.kt index 11b1580d..adbcddc2 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/agenda/AgendaScreen.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/agenda/AgendaScreen.kt @@ -93,9 +93,9 @@ fun AgendaScreen( restorePosition: Boolean = false, viewModel: AgendaViewModel = hiltViewModel(), ) { - // Opens on today rather than the day another view was on (#367), unless - // backing out of a day opened from here or recreated, which land on the day - // last at the top. Still hands the top day back to the shared focus. + // Opens on today, not on the day another view was on (#367). Backing out of + // a day opened from here, or a recreated screen, returns to the day last at + // the top. The top day still goes back to the shared focus. val focus = LocalViewFocus.current val opened = rememberSaveable { mutableStateOf(false) } val restoreTop = remember(viewModel) { @@ -126,8 +126,8 @@ fun AgendaScreen( // list scroll, not an anchor change — "today" has to bring the list back to // the top as well, and stay offered while it is scrolled away (#305). val listState = rememberLazyListState() - // Past days load above the anchor (#367), so "at the start" is the anchor's - // row rather than the top of the list. + // Past days load above the anchor (#367), so the anchor's row counts as the + // start of the list. val anchorIndex = remember { mutableIntStateOf(0) } val scrolledAway by remember { derivedStateOf { @@ -350,7 +350,7 @@ internal fun AgendaContent( today = state.today, enabled = showToday && state.anchor == state.today, ) - // Loaded past days alone aren't anything coming up. + // Past days alone don't count as anything coming up. if (days.none { it.date >= state.anchor }) { // Nothing to scroll: drop the position a previous list left, so // the today FAB doesn't linger over an empty screen. @@ -400,8 +400,8 @@ private fun AgendaList( val itemDates = agendaItemDates(days) val anchorRow = itemDates.indexOfFirst { it >= anchor }.coerceAtLeast(0) SideEffect { anchorIndex.intValue = anchorRow } - // A new anchor opens the list on its row, past days above it, from the first - // frame. Keyed on the anchor the days arrived with, not the one just + // A new anchor opens the list on its row from the first frame, with past + // days above. Keyed on the anchor the days arrived with, not the one just // requested: scrolling before the new rows compose leaves the list keyed to // a row that reappears further down, and it follows it there. The first run // may restore a remembered day instead. @@ -415,7 +415,7 @@ private fun AgendaList( listState.requestScrollToItem(index) onDispose {} } - // Scrolling up near the first loaded day reaches further back. + // Scrolling up near the first loaded day loads earlier days. val currentLoadEarlier by rememberUpdatedState(onLoadEarlier) val loadOnScrollUp = remember(listState) { object : NestedScrollConnection { diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/month/MonthScreen.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/month/MonthScreen.kt index 9f34a7bb..07830045 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/month/MonthScreen.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/month/MonthScreen.kt @@ -2868,7 +2868,7 @@ private fun MonthBar( ) { val title = event.title.ifBlank { stringResource(R.string.event_untitled) } val dimCutoff = LocalDimCutoff.current - // A bar is one piece, so it dims once the last day it covers is behind. + // A bar is one piece, so it dims once the last day it covers has passed. val dimmed = dimCutoff != null && (event.hasEnded(dimCutoff) || days?.let { event.isPastOn(it.last(), dimCutoff) } == true) val paint = eventPaint(event, dark) diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/week/WeekScreen.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/week/WeekScreen.kt index 51c225f7..abc49568 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/week/WeekScreen.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/week/WeekScreen.kt @@ -1119,7 +1119,7 @@ private fun AllDayBar( ) { val title = event.title.ifBlank { stringResource(R.string.event_untitled) } val dimCutoff = LocalDimCutoff.current - // A bar is one piece, so it dims once the last day it covers here is behind. + // A bar is one piece, so it dims once the last day it covers here has passed. val dimmed = dimCutoff != null && event.isPastOn(lastDay, dimCutoff) val paint = eventPaint(event, dark) Box(