Commit 58f3b73e8f

58f3b73e8ff337e5a15111fbb32c0d57cf2346da

parent: 2c99274b57

Verified · cmc

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

Agenda: keyword pills under Increase Contrast and Differentiate Without Colour

On the Mac and iOS, Increase Contrast fills keyword and priority badges
with their colour and draws the label in the background colour, and
the Mac's tag outlines go to full strength. Differentiate Without
Colour outlines keyword badges and puts a check mark before a done
keyword.

Ref #221

Layout: unified · split

Sources/Orgstar/AgendaRowView.swift +22 −10
@@ -18,6 +18,8 @@ struct AgendaRowView: View {
1818 var marked = false
1919 @Environment(\.orgTheme) private var theme
2020 @ScaledMetric(relativeTo: .callout) private var gutterWidth = AgendaRowView.gutterWidth
21 @Environment(\.colorSchemeContrast) private var contrast
22 @Environment(\.accessibilityDifferentiateWithoutColor) private var withoutColor
2123 @ScaledMetric(relativeTo: .caption) private var badgeSize: CGFloat = 18
2224
2325 static let gutterWidth: CGFloat = 92
@@ -60,6 +62,11 @@ struct AgendaRowView: View {
6062 .accessibilityElement(children: .combine)
6163 }
6264
65 /// Increase Contrast: keyword and priority badges are filled with their colour, tags outlined in full.
66 private var highContrast: Bool { contrast == .increased }
67
68 private var background: Color { theme.color("agenda-background") ?? Color(nsColor: .textBackgroundColor) }
69
6370 private var statusColor: Color {
6471 theme.dynamic(.secondaryLabelColor) { [theme, row] in theme.statusColor(row.status, dark: $0) }
6572 }
@@ -127,7 +134,7 @@ struct AgendaRowView: View {
127134 .foregroundStyle(theme.color("tags") ?? .secondary)
128135 .padding(.horizontal, 6)
129136 .padding(.vertical, 1)
130 .background(Capsule().strokeBorder((theme.color("tags") ?? .secondary).opacity(0.35), lineWidth: 0.5))
137 .background(Capsule().strokeBorder((theme.color("tags") ?? .secondary).opacity(highContrast ? 1 : 0.35), lineWidth: highContrast ? 1 : 0.5))
131138 }
132139 }
133140 }
@@ -137,12 +144,17 @@ struct AgendaRowView: View {
137144 HStack(spacing: 6) {
138145 if let todo = row.todo {
139146 let color = theme.dynamic(row.isDone ? .systemGreen : .systemRed) { [theme, row] in theme.todoColor(todo, isDone: row.isDone, dark: $0) }
140 Text(todo)
141 .font(.caption.weight(.bold))
142 .foregroundStyle(color)
143 .padding(.horizontal, 7)
144 .padding(.vertical, 2)
145 .background(Capsule().fill(color.opacity(0.14)))
147 HStack(spacing: 2) {
148 // Done or not without telling green from red.
149 if withoutColor, row.isDone { Image(systemName: "checkmark") }
150 Text(todo)
151 }
152 .font(.caption.weight(.bold))
153 .foregroundStyle(highContrast ? background : color)
154 .padding(.horizontal, 7)
155 .padding(.vertical, 2)
156 .background(Capsule().fill(highContrast ? color : color.opacity(0.14)))
157 .overlay { if withoutColor, !highContrast { Capsule().strokeBorder(color, lineWidth: 1) } }
146158 }
147159 priorityBadge
148160 }
@@ -155,10 +167,10 @@ struct AgendaRowView: View {
155167 let color = theme.dynamic(.systemOrange) { [theme] in theme.priorityColor(priority, dark: $0) }
156168 Text(priority)
157169 .font(.caption.weight(.bold))
158 .foregroundStyle(color)
170 .foregroundStyle(highContrast ? background : color)
159171 .frame(width: badgeSize, height: badgeSize)
160 .background(Circle().fill(color.opacity(0.14)))
161 .overlay(Circle().strokeBorder(color.opacity(0.6), lineWidth: 1))
172 .background(Circle().fill(highContrast ? color : color.opacity(0.14)))
173 .overlay(Circle().strokeBorder(color.opacity(highContrast ? 1 : 0.6), lineWidth: 1))
162174 .help("Priority \(priority)")
163175 } else {
164176 Color.clear.frame(width: badgeSize, height: badgeSize)
Sources/OrgstarMobile/AgendaScreen.swift +17 −7
@@ -959,6 +959,11 @@ struct AgendaRowView: View {
959959 @Environment(\.dynamicTypeSize) private var typeSize
960960 @ScaledMetric(relativeTo: .subheadline) private var gutterWidth: CGFloat = 82
961961 @ScaledMetric(relativeTo: .caption2) private var badgeSize: CGFloat = 18
962 @Environment(\.colorSchemeContrast) private var contrast
963 @Environment(\.accessibilityDifferentiateWithoutColor) private var withoutColor
964
965 /// Increase Contrast: keyword and priority badges are filled with their colour.
966 private var highContrast: Bool { contrast == .increased }
962967
963968 /// TODO and match lists have no times or statuses.
964969 private var hasGutter: Bool { !row.gutter.isEmpty || row.icon != nil }
@@ -1026,19 +1031,24 @@ struct AgendaRowView: View {
10261031 HStack(spacing: 5) {
10271032 if let todo = row.todo {
10281033 let color = theme.todoColor(todo, isDone: row.isDone, dark: dark)?.swiftUI ?? .secondary
1029 Text(todo)
1030 .font(.caption2.weight(.semibold))
1031 .foregroundStyle(color)
1032 .padding(.horizontal, 6).padding(.vertical, 2)
1033 .background(color.opacity(0.14), in: Capsule())
1034 HStack(spacing: 2) {
1035 // Done or not without telling green from red.
1036 if withoutColor, row.isDone { Image(systemName: "checkmark") }
1037 Text(todo)
1038 }
1039 .font(.caption2.weight(.semibold))
1040 .foregroundStyle(highContrast ? Color(.systemBackground) : color)
1041 .padding(.horizontal, 6).padding(.vertical, 2)
1042 .background(highContrast ? color : color.opacity(0.14), in: Capsule())
1043 .overlay { if withoutColor, !highContrast { Capsule().strokeBorder(color, lineWidth: 1) } }
10341044 }
10351045 if let priority = row.priority {
10361046 let color = theme.priorityColor(priority, dark: dark)?.swiftUI ?? .orange
10371047 Text(priority)
10381048 .font(.caption2.weight(.bold))
1039 .foregroundStyle(color)
1049 .foregroundStyle(highContrast ? Color(.systemBackground) : color)
10401050 .frame(width: badgeSize, height: badgeSize)
1041 .background(color.opacity(0.14), in: Circle())
1051 .background(highContrast ? color : color.opacity(0.14), in: Circle())
10421052 .overlay(Circle().strokeBorder(color, lineWidth: 1.2))
10431053 .accessibilityLabel("Priority \(priority)")
10441054 }
docs/manual/guide/07-agenda.org +2
@@ -185,6 +185,8 @@ Rows look the same on the Mac and iOS. Each shows:
185185- The title: the heading without its TODO keyword, priority cookie, statistics cookies, timestamps and tags, with links shown as their descriptions. A done entry's title is struck through.
186186- Under the title, the habit's consistency graph, for habits.
187187
188With Increase Contrast on in the system's accessibility settings, the keyword and priority badges are filled with their color, and on the Mac tags have a full outline. With Differentiate Without Color on, keyword badges are outlined and a done keyword shows a check mark.
189
188190The status sets the color of the left column:
189191
190192| Status | When | Theme key |