From 97b4d24724170b1f15a4a401d7a908cea5e3b05e Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Wed, 9 Sep 2026 15:33:53 +0200 Subject: [PATCH] fix(components): take the section header's metrics from Calendula's MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The header was invented here rather than converged from the app that already had one. Calendula's SectionHeader is labelLarge at top 16 / bottom 4, and separates one group from the next with the caller's own 8dp spacer — a hub's first header follows the About card, not another group, so the gap cannot live on the header. Matched exactly, so the two apps' settings hubs are the same page. --- CHANGELOG.md | 10 +++++----- .../floret/components/GroupedList.kt | 17 ++++++++--------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01f0cb6..d912622 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,11 +13,11 @@ are no binary releases; "version" tracks the shared `version` in the root build ### Added - **`components`** — `GroupedSectionHeader`, the label above a run of - `GroupedRow`s. Starts on `GroupedListInset` and owns the gap to the group - above, so a page writes header-then-rows and nothing else; `primary`, after - the Android-15 settings pattern the row system already follows. Wanted by - Agendula's settings hub, which had grown a flat run of a dozen rows with - nothing separating how the app behaves from what it is. + `GroupedRow`s: small, `primary`, inset to `GroupedListInset` so it shares the + cards' left margin. Converged from Calendula's settings hub, where the recipe + was written as a private `SectionHeader`, and now Agendula's, which had grown + a flat run of a dozen rows with nothing separating how the app behaves from + what it is. - **`components`** — `GroupedRow` takes a `contentColor`, the pair to the existing `container`: a row given a tint now names the `on*` role that goes diff --git a/components/src/main/kotlin/de/jeanlucmakiola/floret/components/GroupedList.kt b/components/src/main/kotlin/de/jeanlucmakiola/floret/components/GroupedList.kt index 33c8799..292fe67 100644 --- a/components/src/main/kotlin/de/jeanlucmakiola/floret/components/GroupedList.kt +++ b/components/src/main/kotlin/de/jeanlucmakiola/floret/components/GroupedList.kt @@ -58,24 +58,23 @@ val GroupedListInset = 16.dp * rather than merely spaced apart — a settings hub that separates how the app * behaves from what it is. * - * Starts on [GroupedListInset], the same edge as the cards it names, and owns - * the space that separates its group from the one above, so a caller writes - * header-then-rows and nothing else. Coloured `primary` after the Android-15 - * settings pattern this row system already follows: the headers are what makes - * the grouping readable at a glance, and `onSurfaceVariant` sinks them into the - * summaries. + * Small, `primary`, and inset to [GroupedListInset] so it shares the left + * margin of the cards it names. Converged from Calendula's settings hub, where + * the recipe was written; a caller separates one group from the next with its + * own 8dp spacer, since a hub's first header follows the About card rather than + * another group. */ @Composable fun GroupedSectionHeader(text: String, modifier: Modifier = Modifier) { Text( text = text, - style = MaterialTheme.typography.titleSmall, + style = MaterialTheme.typography.labelLarge, color = MaterialTheme.colorScheme.primary, modifier = modifier.padding( start = GroupedListInset, end = GroupedListInset, - top = 24.dp, - bottom = 8.dp, + top = 16.dp, + bottom = 4.dp, ), ) }