commit 4acb98c53559c4ff3a8cfed9758517fab4a97eaf
parent 82d12e1a25dbfcf6375d192a9c185a5610e3cac4
Author: Michael Camilleri <[email protected]>
Date: Sat, 17 Oct 2026 13:25:01 +0900
Scale the timeline's time column with Dynamic Type
At the largest text sizes, a four-digit time such as '10:20' wrapped
in the timeline, leaving its last digit on a line of its own, because
the time column had a fixed width while its font grew. The column's
width now scales with the time's font, so the time stays on one line
and every row's column still lines up.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat
| M | Reportage/Views/Home/HomeView.swift | | | 5 | ++++- |
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Reportage/Views/Home/HomeView.swift b/Reportage/Views/Home/HomeView.swift
@@ -306,6 +306,9 @@ struct ReportRow: View {
@Environment(\.reportStore) private var store
@State private var isWriting = false
+ /// Wide enough for '10:20' in the time's font, and scaled with it, so
+ /// the time never wraps and every row's column lines up.
+ @ScaledMetric(relativeTo: .title3) private var timeWidth: CGFloat = 60
var body: some View {
let summary = describer.summary(of: report)
@@ -315,7 +318,7 @@ struct ReportRow: View {
// instead of sitting at the foot of the large digits.
HStack(alignment: .capTop, spacing: Theme.itemGap) {
ReportTime(date: report.date, timeZone: report.timeZone)
- .frame(width: 60, alignment: .leading)
+ .frame(width: timeWidth, alignment: .leading)
VStack(alignment: .leading, spacing: 6) {
ReportKindLabel(kind: kind, isLogged: isLogged)
ReportSummaryText(