Commit 7e501c1c3d

7e501c1c3d7ef01616a7f93bdba6889a4fdb6fb8

parent: 98b41213c1

Verified · cmc

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

iOS agenda: lay out for accessibility text sizes

The gutter width and the priority ring are scaled metrics, and bar
buttons have a minimum rather than a fixed size. At accessibility
sizes the time or status is a line of its own above the entry, icon
first, and Today moves into the span menu so the bar fits.

Ref #221

Layout: unified · split

Sources/OrgstarMobile/AgendaScreen.swift +83 −42
@@ -17,6 +17,7 @@ struct AgendaScreen: View, Equatable {
1717 @Environment(ClockModel.self) private var clock
1818 @Environment(MobileModel.self) private var model
1919 @Environment(\.colorScheme) private var colorScheme
20 @Environment(\.dynamicTypeSize) private var typeSize
2021 @Environment(\.openURL) private var openURL
2122 @State private var tick = 0
2223 /// The time the now line shows, kept to the minute while the agenda is open.
@@ -653,12 +654,18 @@ struct AgendaScreen: View, Equatable {
653654 if case .agenda = agenda.mode {
654655 HStack(spacing: 2) {
655656 barButton("Earlier", "chevron.left") { step(forward: false) }
656 Button("Today") { goToday() }
657 .font(.subheadline.weight(.semibold))
658 .padding(.horizontal, 8)
659 .frame(minHeight: 44)
660 .contentShape(Rectangle())
657 // At accessibility sizes Today goes into the span menu, so the bar fits.
658 if !typeSize.isAccessibilitySize {
659 Button("Today") { goToday() }
660 .font(.subheadline.weight(.semibold))
661 .padding(.horizontal, 8)
662 .frame(minHeight: 44)
663 .contentShape(Rectangle())
664 }
661665 Menu {
666 if typeSize.isAccessibilitySize {
667 Button("Today") { goToday() }
668 }
662669 Picker("Span", selection: Binding { range } set: { show($0, around: $0 == nil || todayShown ? agenda.today : firstDay) }) {
663670 ForEach(SpanRange.allCases) { Text($0.title).tag(Optional($0)) }
664671 Text("\(agenda.span) Days").tag(SpanRange?.none)
@@ -686,7 +693,7 @@ struct AgendaScreen: View, Equatable {
686693 Button(String(localized: title), systemImage: image, action: action)
687694 .labelStyle(.iconOnly)
688695 .font(.body.weight(.medium))
689 .frame(width: 44, height: 44)
696 .frame(minWidth: 44, minHeight: 44)
690697 .contentShape(Rectangle())
691698 }
692699
@@ -949,44 +956,25 @@ struct AgendaRowView: View {
949956 let day: Int
950957 let theme: ThemeSpec
951958 let dark: Bool
959 @Environment(\.dynamicTypeSize) private var typeSize
960 @ScaledMetric(relativeTo: .subheadline) private var gutterWidth: CGFloat = 82
961 @ScaledMetric(relativeTo: .caption2) private var badgeSize: CGFloat = 18
962
963 /// TODO and match lists have no times or statuses.
964 private var hasGutter: Bool { !row.gutter.isEmpty || row.icon != nil }
952965
953966 var body: some View {
954 HStack(alignment: .top, spacing: 10) {
955 // TODO and match lists have no times or statuses.
956 if !row.gutter.isEmpty || row.icon != nil { gutter.frame(width: 82, alignment: .leading) }
957 VStack(alignment: .leading, spacing: 2) {
958 HStack(alignment: .top, spacing: 5) {
959 // Wraps instead of truncating the tags.
960 FlowLayout(spacing: 5, lineSpacing: 3) {
961 if !row.category.isEmpty {
962 HStack(spacing: 5) {
963 Circle().fill(categoryColor).frame(width: 7, height: 7)
964 Text(row.category).lineLimit(1)
965 }
966 }
967 if let detail = row.prefixDetail { Text(detail).lineLimit(1).truncationMode(.middle) }
968 ForEach([row.progress, row.detail].compactMap { $0 }, id: \.self) { progress in
969 Text(progress).monospacedDigit()
970 .padding(.horizontal, 5)
971 .background(.quaternary.opacity(0.7), in: Capsule())
972 }
973 ForEach(row.tags, id: \.self) { tag in
974 Text(tag).lineLimit(1)
975 .padding(.horizontal, 5)
976 .background(.quaternary.opacity(0.7), in: Capsule())
977 }
978 }
979 Spacer(minLength: 4)
980 marks
967 Group {
968 // At accessibility sizes the gutter is a line of its own above the rest.
969 if typeSize.isAccessibilitySize {
970 VStack(alignment: .leading, spacing: 4) {
971 if hasGutter { stackedGutter }
972 content
981973 }
982 .font(.caption)
983 .foregroundStyle(.secondary)
984 Text(row.title.isEmpty ? " " : row.title)
985 .font(.body)
986 .strikethrough(row.isDone)
987 .foregroundStyle(row.isDone ? .secondary : .primary)
988 if let habit = row.item?.habit {
989 HabitStrip(cells: habit.graph(today: day), theme: theme, dark: dark).padding(.top, 3)
974 } else {
975 HStack(alignment: .top, spacing: 10) {
976 if hasGutter { gutter.frame(width: gutterWidth, alignment: .leading) }
977 content
990978 }
991979 }
992980 }
@@ -995,6 +983,44 @@ struct AgendaRowView: View {
995983 .opacity(row.isBlocked ? 0.5 : row.isDone ? 0.75 : 1)
996984 }
997985
986 private var content: some View {
987 VStack(alignment: .leading, spacing: 2) {
988 HStack(alignment: .top, spacing: 5) {
989 // Wraps instead of truncating the tags.
990 FlowLayout(spacing: 5, lineSpacing: 3) {
991 if !row.category.isEmpty {
992 HStack(spacing: 5) {
993 Circle().fill(categoryColor).frame(width: 7, height: 7)
994 Text(row.category).lineLimit(1)
995 }
996 }
997 if let detail = row.prefixDetail { Text(detail).lineLimit(1).truncationMode(.middle) }
998 ForEach([row.progress, row.detail].compactMap { $0 }, id: \.self) { progress in
999 Text(progress).monospacedDigit()
1000 .padding(.horizontal, 5)
1001 .background(.quaternary.opacity(0.7), in: Capsule())
1002 }
1003 ForEach(row.tags, id: \.self) { tag in
1004 Text(tag).lineLimit(1)
1005 .padding(.horizontal, 5)
1006 .background(.quaternary.opacity(0.7), in: Capsule())
1007 }
1008 }
1009 Spacer(minLength: 4)
1010 marks
1011 }
1012 .font(.caption)
1013 .foregroundStyle(.secondary)
1014 Text(row.title.isEmpty ? " " : row.title)
1015 .font(.body)
1016 .strikethrough(row.isDone)
1017 .foregroundStyle(row.isDone ? .secondary : .primary)
1018 if let habit = row.item?.habit {
1019 HabitStrip(cells: habit.graph(today: day), theme: theme, dark: dark).padding(.top, 3)
1020 }
1021 }
1022 }
1023
9981024 /// The TODO keyword and the priority, on the category's line.
9991025 private var marks: some View {
10001026 HStack(spacing: 5) {
@@ -1011,7 +1037,7 @@ struct AgendaRowView: View {
10111037 Text(priority)
10121038 .font(.caption2.weight(.bold))
10131039 .foregroundStyle(color)
1014 .frame(width: 18, height: 18)
1040 .frame(width: badgeSize, height: badgeSize)
10151041 .background(color.opacity(0.14), in: Circle())
10161042 .overlay(Circle().strokeBorder(color, lineWidth: 1.2))
10171043 .accessibilityLabel("Priority \(priority)")
@@ -1057,6 +1083,21 @@ struct AgendaRowView: View {
10571083 }
10581084 }
10591085
1086 /// The gutter as one line, the icon first, for accessibility sizes.
1087 private var stackedGutter: some View {
1088 HStack(alignment: .firstTextBaseline, spacing: 6) {
1089 if let symbol = row.symbol {
1090 Image(systemName: symbol)
1091 .font(.caption.weight(.semibold))
1092 .imageScale(row.icon == .event ? .small : .medium)
1093 .foregroundStyle(iconColor)
1094 }
1095 Text(row.gutter)
1096 .font(.subheadline.weight(.semibold).monospacedDigit())
1097 .foregroundStyle(row.start != nil && row.status == .normal ? Color.primary : statusColor)
1098 }
1099 }
1100
10601101 private var iconColor: Color {
10611102 if row.isEvent { return categoryColor }
10621103 return row.status == .normal ? Color(.tertiaryLabel) : statusColor
docs/manual/guide/14-ios.org +1 −1
@@ -192,7 +192,7 @@ The Agenda tab shows the agenda over all your folders, with the span and start d
192192
193193- Views (top left) :: the built-in views and those in =views.toml=, Tags and Properties… (a match such as =+work-home= or ~TODO="WAIT"~), and Search… (a phrase, or snippets such as =+invoice -paid=); Save as View… keeps the match or search showing as a view in =views.toml=. Below them are Go to Date…, Filter… and Select, which picks entries for an action on all of them.
194194- Folders (top right, with more than one folder) :: shows or hides each folder's files in the agenda, the widgets, the watch and the badge; the shown folders' names appear under the title. A Focus can hide folders too, and mute their reminders (see Hiding folders in [[file:07-agenda.org][The agenda]]).
195- The bar at the bottom :: Earlier, Today, the span (Day, Week, Month or the configured span, and Log Mode, which adds closed entries and clocked time) and Later.
195- The bar at the bottom :: Earlier, Today, the span (Day, Week, Month or the configured span, and Log Mode, which adds closed entries and clocked time) and Later. At accessibility text sizes Today is in the span's menu, and each entry's time or status is on a line of its own above it.
196196- Filter :: keep or leave out tags and categories of the entries shown, or type a filter as Org's =/= takes it: =+keep= and =-drop= tags or categories, =<0:30= for effort, =/regexp/=. The filter in use shows above the bar.
197197- + on a day's header :: captures an entry scheduled on that day (see [[file:08-capture.org][Capture]]).
198198- Tap :: an entry to open it in a sheet: its title, TODO state, priority, scheduled date, deadline, tags and notes. Changes use the same commands as the editor and are written to the file together on Done, or dropped on Cancel; Undo and Redo step through them. More ▸ Open in File saves and shows the entry in the reader.