Commit d2bd66a373

d2bd66a37316197d89c6264628627eef9e71a04e

parent: 7bc631fb21

Verified · cmc

cmc <hello@cleberg.net> · 2026-11-22 20:50 UTC

Today widget: text styles and scaled widths instead of fixed sizes

Keyword and priority badges use caption2; the gutter, the priority ring and
the category dot scale with the text size.

Ref #221

Layout: unified · split

Sources/OrgstarWidgets/TodayWidget.swift +8 −5
@@ -120,6 +120,9 @@ struct SmallRow: View {
120120struct WideRow: View {
121121 let row: AgendaSnapshot.Row
122122 @Environment(\.colorScheme) private var scheme
123 @ScaledMetric(relativeTo: .caption2) private var gutterWidth: CGFloat = 72
124 @ScaledMetric(relativeTo: .caption2) private var priorityRing: CGFloat = 16
125 @ScaledMetric(relativeTo: .caption) private var categoryDot: CGFloat = 6
123126
124127 var body: some View {
125128 HStack(spacing: 6) {
@@ -127,11 +130,11 @@ struct WideRow: View {
127130 .font(.caption2.weight(.medium).monospacedDigit())
128131 .foregroundStyle(row.statusColor?.color(scheme) ?? .secondary)
129132 .lineLimit(1)
130 .frame(width: 72, alignment: .leading)
133 .frame(width: gutterWidth, alignment: .leading)
131134 if let todo = row.todo {
132135 let color = row.todoColor?.color(scheme) ?? .secondary
133136 Text(todo)
134 .font(.system(size: 9, weight: .bold))
137 .font(.caption2.weight(.bold))
135138 .foregroundStyle(color)
136139 .padding(.horizontal, 4)
137140 .padding(.vertical, 1)
@@ -140,14 +143,14 @@ struct WideRow: View {
140143 if let priority = row.priority {
141144 let color = row.priorityColor?.color(scheme) ?? .orange
142145 Text(priority)
143 .font(.system(size: 9, weight: .bold))
146 .font(.caption2.weight(.bold))
144147 .foregroundStyle(color)
145 .frame(width: 14, height: 14)
148 .frame(width: priorityRing, height: priorityRing)
146149 .overlay(Circle().strokeBorder(color, lineWidth: 1))
147150 }
148151 Text(row.title).font(.caption).lineLimit(1)
149152 Spacer(minLength: 0)
150 Circle().fill(row.categoryColor?.color(scheme) ?? .secondary).frame(width: 6, height: 6)
153 Circle().fill(row.categoryColor?.color(scheme) ?? .secondary).frame(width: categoryDot, height: categoryDot)
151154 }
152155 }
153156}