Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions Strand/Liquid/LiquidTodayView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion android/app/src/main/java/com/noop/ui/TodayScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
Loading