From 7a8c41c73df80ec0155fd95f3a1c2568658d58f0 Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Wed, 25 Nov 2026 15:17:41 +0100 Subject: [PATCH] fix(#143): review round 3 - name the view in the row notes, entry summary and picker hint --- .../calendula/ui/common/CalendarView.kt | 4 ---- .../calendula/ui/filter/CalendarFilterList.kt | 15 ++++++++------- .../calendula/ui/filter/ViewCalendarsPicker.kt | 7 ++++--- app/src/main/res/values/strings.xml | 18 +++++++++++------- docs/ARCHITECTURE.md | 2 +- 5 files changed, 24 insertions(+), 22 deletions(-) diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/common/CalendarView.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/common/CalendarView.kt index 5069306a..7715ee27 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/common/CalendarView.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/common/CalendarView.kt @@ -42,10 +42,6 @@ fun CalendarView.label(): String = when (this) { CalendarView.Agenda -> stringResource(R.string.view_agenda) } -/** "Hide in “Month” view": the per-view hide's drawer entry and picker title (#143). */ -@Composable -fun CalendarView.hideInViewTitle(): String = stringResource(R.string.view_hide_in_title, label()) - /** Leading icon for the view in the drawer's View section. */ val CalendarView.icon: ImageVector get() = when (this) { diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/filter/CalendarFilterList.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/filter/CalendarFilterList.kt index 57781609..2d78c348 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/filter/CalendarFilterList.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/filter/CalendarFilterList.kt @@ -38,7 +38,7 @@ import de.jeanlucmakiola.calendula.ui.common.CalendarAccountGroup import de.jeanlucmakiola.calendula.ui.common.CalendarColorChip import de.jeanlucmakiola.calendula.ui.common.CalendarView import de.jeanlucmakiola.calendula.ui.common.accountGroupTitle -import de.jeanlucmakiola.calendula.ui.common.hideInViewTitle +import de.jeanlucmakiola.calendula.ui.common.label import de.jeanlucmakiola.calendula.ui.common.orUnnamed import de.jeanlucmakiola.floret.components.GroupedListInset import de.jeanlucmakiola.floret.components.GroupedRow @@ -71,7 +71,7 @@ fun CalendarFilterList( hidden = s.hidden, hiddenInView = hiddenInView, hiddenOnlyHere = hiddenInView.size, - hideInViewTitle = currentView.hideInViewTitle(), + currentView = currentView, onHideInView = onHideInView, onToggleCalendar = viewModel::toggleCalendar, onToggleGroup = viewModel::toggleGroup, @@ -92,12 +92,13 @@ private fun FilterList( hidden: Set, hiddenInView: Set, hiddenOnlyHere: Int, - hideInViewTitle: String, + currentView: CalendarView, onHideInView: () -> Unit, onToggleCalendar: (Long) -> Unit, onToggleGroup: (List) -> Unit, modifier: Modifier = Modifier, ) { + val viewName = currentView.label() Column(modifier = modifier.fillMaxWidth()) { groups.forEach { group -> val ids = group.calendars.map { it.id } @@ -110,7 +111,7 @@ private fun FilterList( val visible = cal.id !in hidden GroupedRow( title = cal.displayName.orUnnamed(), - summary = if (cal.id in hiddenInView) stringResource(R.string.filter_hidden_in_view) else null, + summary = if (cal.id in hiddenInView) stringResource(R.string.filter_hidden_in_named_view, viewName) else null, position = positionOf(index, group.calendars.size), minHeight = 56.dp, leading = { CalendarColorChip(cal.color) }, @@ -127,11 +128,11 @@ private fun FilterList( // The per-view hide (#517): the drawer filter above hides everywhere, this only here. Spacer(Modifier.height(8.dp)) GroupedRow( - title = hideInViewTitle, + title = stringResource(R.string.view_hide_in_title, viewName), summary = if (hiddenOnlyHere > 0) { - pluralStringResource(R.plurals.drawer_hidden_in_view_count, hiddenOnlyHere, hiddenOnlyHere) + pluralStringResource(R.plurals.drawer_hidden_in_named_view_count, hiddenOnlyHere, hiddenOnlyHere, viewName) } else { - stringResource(R.string.drawer_hidden_in_view_none) + stringResource(R.string.drawer_hidden_in_named_view_none, viewName) }, position = Position.Alone, minHeight = 56.dp, diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/filter/ViewCalendarsPicker.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/filter/ViewCalendarsPicker.kt index 1303568d..b22f18c5 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/filter/ViewCalendarsPicker.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/filter/ViewCalendarsPicker.kt @@ -12,7 +12,7 @@ import de.jeanlucmakiola.calendula.ui.common.CalendarColorChip import de.jeanlucmakiola.calendula.ui.common.CalendarView import de.jeanlucmakiola.calendula.ui.common.accountGroupTitle import de.jeanlucmakiola.calendula.ui.common.calendarsHiddenIn -import de.jeanlucmakiola.calendula.ui.common.hideInViewTitle +import de.jeanlucmakiola.calendula.ui.common.label import de.jeanlucmakiola.calendula.ui.common.orUnnamed import de.jeanlucmakiola.floret.components.FullScreenPicker import de.jeanlucmakiola.floret.components.GroupedHint @@ -31,8 +31,9 @@ fun ViewCalendarsPicker( onSetHidden: (calendarId: Long, hidden: Boolean) -> Unit, onDismiss: () -> Unit, ) { + val viewName = view.label() FullScreenPicker( - title = view.hideInViewTitle(), + title = stringResource(R.string.view_hide_in_title, viewName), onDismiss = onDismiss, predictiveBack = true, ) { @@ -43,7 +44,7 @@ fun ViewCalendarsPicker( // Seeded once, then ahead of the store: the picker is the only // writer while open, so a quick second tap still flips. var hidden by remember(view) { mutableStateOf(state.hiddenViews.calendarsHiddenIn(view)) } - GroupedHint(stringResource(R.string.view_calendars_hint), verticalPadding = 8.dp) + GroupedHint(stringResource(R.string.view_calendars_named_hint, viewName), verticalPadding = 8.dp) state.groups.forEach { group -> GroupedSectionHeader(accountGroupTitle(group)) MultiOptionRows( diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index bc0027d3..76303648 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -967,15 +967,19 @@ Events from “%1$s” stay out of the views checked here. Reminders, search and widgets still include them. Shown in every view Hidden in %1$s - Hidden in this view - + + Hidden in “%1$s” view + Hide in “%1$s” view - - %d calendar hidden in this view - %d calendars hidden in this view + + + %1$d calendar hidden in “%2$s” view + %1$d calendars hidden in “%2$s” view - Leave calendars out of this view only - Checked calendars stay out of this view only. Reminders, search and widgets still include them. + + Leave calendars out of the “%1$s” view only + + Checked calendars stay out of the “%1$s” view only. Reminders, search and widgets still include them. Hidden in every view from the menu Mauve Red diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 2a7f3e5b..6d5c330e 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -421,7 +421,7 @@ separate in-app declutter that never touches reminders. Narrower still is the pe events through `instancesWithout(range, calendarsHiddenIn(view, …))`, which drops the calendars hidden in that one view on top of the repository's filters; reminders, search and widgets read the repository and never see it. The drawer's "Hide in “” view" entry (#517, #143) edits the same -set for the view on show, and the drawer's per-row "Hidden in this view" notes read it. +set for the view on show, and the drawer's per-row "Hidden in “” view" notes read it. **A channel per calendar (#145).** `ReminderChannels` keeps one notification channel per calendar, grouped by account (one that syncs no events only gets