diff --git a/Strand/Liquid/LiquidTodayView.swift b/Strand/Liquid/LiquidTodayView.swift index 3f4ae341ed..7a8d294f75 100644 --- a/Strand/Liquid/LiquidTodayView.swift +++ b/Strand/Liquid/LiquidTodayView.swift @@ -1308,7 +1308,10 @@ struct LiquidTodayView: View { let rhr = (displayDay?.restingHr ?? restingHrDay?.restingHr).map(Double.init) return VStack(spacing: 8) { HStack(alignment: .firstTextBaseline, spacing: 8) { - sectionHead("KEY METRICS", trailing: trendWindowLabel) + // The label names the window the DETAILED tiles graph, so it is only honest while they + // are drawn: with the trend graphs off (the default) nothing in this section renders a + // trend, and the header was still announcing one (#2376). + sectionHead("KEY METRICS", trailing: keyMetricsDetailed ? trendWindowLabel : nil) // #430 parity: the SAME editor the classic grid uses — selection + order + Detailed tiles. Button { customizationDestination = .keyMetrics } label: { Text(String(localized: "Edit").uppercased()) @@ -1562,11 +1565,16 @@ struct LiquidTodayView: View { // MARK: - Reusable chrome - private func sectionHead(_ title: String, trailing: String) -> some View { + /// `trailing` is optional so a section can omit it entirely rather than carry a caption for + /// something it is not drawing (the Key Metrics window label, when the trend graphs are off). + /// Matches the Android twin, whose `SectionHeader` already takes `trailing: String? = null`. + private func sectionHead(_ title: String, trailing: String? = nil) -> some View { HStack(alignment: .firstTextBaseline) { Text(LocalizedStringKey(title)).font(StrandFont.overline).tracking(1.6).foregroundStyle(StrandPalette.textTertiary) Spacer() - Text(LocalizedStringKey(trailing)).font(StrandFont.caption).foregroundStyle(StrandPalette.textTertiary) + if let trailing { + Text(LocalizedStringKey(trailing)).font(StrandFont.caption).foregroundStyle(StrandPalette.textTertiary) + } } .padding(.horizontal, 2) .padding(.top, 4) diff --git a/android/app/src/main/java/com/noop/ui/TodayScreen.kt b/android/app/src/main/java/com/noop/ui/TodayScreen.kt index aa37a65eaa..33572dfe86 100644 --- a/android/app/src/main/java/com/noop/ui/TodayScreen.kt +++ b/android/app/src/main/java/com/noop/ui/TodayScreen.kt @@ -1769,7 +1769,10 @@ fun TodayScreen( ) { Row(verticalAlignment = Alignment.Top) { Box(modifier = Modifier.weight(1f)) { - SectionHeader(uiString(R.string.today_section_key_metrics), overline = dayLabel, trailing = trendWindowLabel(keyMetricsWindowDays)) + // The label names the window the DETAILED tiles graph, so it is only honest while they are + // drawn: with the trend graphs off (the default) nothing in this section renders a + // trend, and the header was still announcing one (#2376). Twin of the Apple change. + SectionHeader(uiString(R.string.today_section_key_metrics), overline = dayLabel, trailing = if (keyMetricsDetailed) trendWindowLabel(keyMetricsWindowDays) else null) } TodayEditAction( onClick = { showMetricsEditor = true },