Commit 8ab8c91ce9
Copy SHA
8ab8c91ce9a90393da7626b962ba9bb0508c0769
parent: 27fc65bcc5
Verified · cmc
cmc <hello@cleberg.net> · 2026-11-22 20:53 UTC
Accessibility labels for complications and widget rows
A Today row, a habit and each complication read as one element; a habit's
label adds today's state, and circular and corner complications say how many
entries are open today.
Ref #221
Changed files (5)
Sources/OrgstarWatchWidgets/WatchWidgets.swift
+7 · view
@@ -68,14 +68,18 @@ struct NextEntryView: View {
68 68 Text ( " open " ) . font ( . caption2 )
69 69 }
70 70 }
71 . accessibilityElement ( children : . ignore )
72 . accessibilityLabel ( Text ( " \( open ) open today " ) )
71 73 case . accessoryCorner :
72 74 Text ( " \( open ) " ) . font ( . title3 . weight ( . semibold ) ) . widgetLabel { Text ( next ? . title ? ? String ( localized : " Agenda clear " ) ) }
75 . accessibilityLabel ( Text ( " \( open ) open today " ) + Text ( verbatim : next . map { " , \( $0 . title ) " } ? ? " " ) )
73 76 default :
74 77 VStack ( alignment : . leading , spacing : 0 ) {
75 78 Text ( next ? . gutter ? ? String ( localized : " Agenda " ) ) . font ( . headline ) . widgetAccentable ( ) . lineLimit ( 1 )
76 79 Text ( next ? . title ? ? ( entry . agenda = = nil ? String ( localized : " Open orgstar " ) : String ( localized : " Nothing left today " ) ) ) . lineLimit ( 2 )
77 80 }
78 81 . frame ( maxWidth : . infinity , alignment : . leading )
82 . accessibilityElement ( children : . combine )
79 83 }
80 84 }
81 85 }
@@ -109,6 +113,8 @@ struct ClockView: View {
109 113 Image ( systemName : " stopwatch " ) . font ( . title3 )
110 114 }
111 115 }
116 . accessibilityElement ( children : . ignore )
117 . accessibilityLabel ( clock . map { Text ( " Clocked in " ) + Text ( verbatim : " , \( $0 . heading ) , " ) + Text ( $0 . startedAt , style : . timer ) } ? ? Text ( " Not clocked in " ) )
112 118 default :
113 119 VStack ( alignment : . leading , spacing : 0 ) {
114 120 if let clock {
@@ -120,6 +126,7 @@ struct ClockView: View {
120 126 }
121 127 }
122 128 . frame ( maxWidth : . infinity , alignment : . leading )
129 . accessibilityElement ( children : . combine )
123 130 }
124 131 }
125 132 }
Sources/OrgstarWidgets/HabitsWidget.swift
+18 −3 · view
@@ -91,14 +91,16 @@ struct HabitsView: View {
91 91 let cells = habit . habit . graph ( today : today , preceding : 6 , following : 1 )
92 92 VStack ( alignment : . leading , spacing : 2 ) {
93 93 Text ( habit . title ) . font ( . caption ) . lineLimit ( 1 )
94 HabitCells ( cells : cells , colors : snapshot . colors , width : 12 , height : 8 )
94 HabitCells ( cells : cells , today : today , colors : snapshot . colors , width : 12 , height : 8 )
95 95 }
96 . accessibilityElement ( children : . combine )
96 97 } else {
97 98 HStack ( spacing : 8 ) {
98 99 Text ( habit . title ) . font ( . caption ) . lineLimit ( 1 )
99 100 Spacer ( minLength : 4 )
100 HabitCells ( cells : habit . habit . graph ( today : today ) , colors : snapshot . colors , width : 5 , height : 12 )
101 HabitCells ( cells : habit . habit . graph ( today : today ) , today : today , colors : snapshot . colors , width : 5 , height : 12 )
101 102 }
103 . accessibilityElement ( children : . combine )
102 104 }
103 105 }
104 106 }
@@ -109,6 +111,7 @@ struct HabitsView: View {
109 111 // / f r o m c l e a r ( f a i n t e s t ) t o o v e r d u e ( s o l i d ) , a n d d a y s t o c o m e a r e o u t l i n e d .
110 112 struct HabitCells : View {
111 113 let cells : [ Habit . Cell ]
114 let today : Int
112 115 let colors : [ String : AgendaSnapshot . Hex ]
113 116 let width : CGFloat
114 117 let height : CGFloat
@@ -137,7 +140,19 @@ struct HabitCells: View {
137 140 }
138 141 }
139 142 . accessibilityElement ( children : . ignore )
140 . accessibilityLabel ( " Done \( cells . filter { $0 . glyph = = " * " } . count ) of \( cells . count ) days " )
143 . accessibilityLabel ( Text ( " Done \( cells . filter { $0 . glyph = = " * " } . count ) of \( cells . count ) days " ) + Text ( verbatim : " , " ) + todayState )
144 }
145
146 // / T o d a y ' s s t a t e i n w o r d s .
147 private var todayState : Text {
148 guard let cell = cells . first ( where : { $0 . day = = today } ) else { return Text ( verbatim : " " ) }
149 if cell . glyph = = " * " { return Text ( " Done today " ) }
150 switch cell . face {
151 case . clear , . clearFuture : return Text ( " Not due today " )
152 case . ready , . readyFuture : return Text ( " Due today " )
153 case . alert , . alertFuture : return Text ( " Last chance today " )
154 case . overdue , . overdueFuture : return Text ( " Overdue " )
155 }
141 156 }
142 157
143 158 // / A f i l l e d b a r f o r p a s t d a y s a n d a n o u t l i n e f o r d a y s t o c o m e , a t t h e s t a t e ' s s t e p ; a
Sources/OrgstarWidgets/TodayWidget.swift
+13 · view
@@ -114,6 +114,7 @@ struct SmallRow: View {
114 114 . foregroundStyle ( row . statusColor ? . color ( scheme ) ? ? . secondary )
115 115 Text ( row . title ) . font ( . caption ) . lineLimit ( 1 )
116 116 }
117 . accessibilityElement ( children : . combine )
117 118 }
118 119 }
119 120
@@ -153,6 +154,18 @@ struct WideRow: View {
153 154 Spacer ( minLength : 0 )
154 155 Circle ( ) . fill ( row . categoryColor ? . color ( scheme ) ? ? . secondary ) . frame ( width : categoryDot , height : categoryDot )
155 156 }
157 . accessibilityElement ( children : . ignore )
158 . accessibilityLabel ( label )
159 }
160
161 // / T h e t i m e o r s t a t u s , k e y w o r d , p r i o r i t y , t i t l e a n d c a t e g o r y , a s o n e p h r a s e .
162 private var label : Text {
163 var parts = [ Text ( verbatim : row . gutter ) ]
164 if let todo = row . todo { parts . append ( Text ( verbatim : todo ) ) }
165 if let priority = row . priority { parts . append ( Text ( " Priority \( priority ) " ) ) }
166 parts . append ( Text ( verbatim : row . title ) )
167 if ! row . category . isEmpty { parts . append ( Text ( verbatim : row . category ) ) }
168 return parts . dropFirst ( ) . reduce ( parts [ 0 ] ) { $0 + Text ( verbatim : " , " ) + $1 }
156 169 }
157 170 }
158 171
docs/manual/guide/14-ios.org
+1 −1 · view
@@ -225,7 +225,7 @@ Tapping a row in the medium or large Today widget opens that entry; tapping else
225 225
226 226 Widgets can't read your folders, so the app writes the next seven days of the agenda (today included) for them to read: while it is open, when files, edits or settings change, when you return to the app, and every hour. Between those times the widgets move on by themselves as timed entries end and at midnight, but they show nothing new until you open orgstar. Until the app has written the agenda once, they say =Open orgstar to show your agenda here.= The widgets ignore the agenda's filter and show no days without entries. The Habits widget's graphs move on at midnight by themselves.
227 227
228 In the Habits graph a day's bar has the colour of its state: not yet due, due, due today for the last time, or overdue; days to come are lighter. In the tinted and clear Home Screen styles, and with Differentiate Without Colour on (Settings ▸ Accessibility ▸ Display & Text Size), the states are also told apart by how solid the bar is, from not yet due (faintest) to overdue (solid), and days to come are outlined. In the tinted style, the Today widget's date and the Habits title take the tint.
228 In the Habits graph a day's bar has the colour of its state: not yet due, due, due today for the last time, or overdue; days to come are lighter. In the tinted and clear Home Screen styles, and with Differentiate Without Colour on (Settings ▸ Accessibility ▸ Display & Text Size), the states are also told apart by how solid the bar is, from not yet due (faintest) to overdue (solid), and days to come are outlined. In the tinted style, the Today widget's date and the Habits title take the tint. VoiceOver reads each row of the Today widget, each habit and each complication as one item; a habit with how many of the days shown were done and today's state.
229 229
230 230 ** Controls
231 231
l10n/Localizable.xcstrings
+102 · view
@@ -10694,6 +10694,40 @@
10694 10694 }
10695 10695 }
10696 10696 },
10697 "Done today": {
10698 "localizations": {
10699 "de": {
10700 "stringUnit": {
10701 "state": "translated",
10702 "value": "Heute erledigt"
10703 }
10704 },
10705 "es": {
10706 "stringUnit": {
10707 "state": "translated",
10708 "value": "Hecho hoy"
10709 }
10710 },
10711 "fr": {
10712 "stringUnit": {
10713 "state": "translated",
10714 "value": "Effectuée aujourd'hui"
10715 }
10716 },
10717 "ja": {
10718 "stringUnit": {
10719 "state": "translated",
10720 "value": "今日は完了"
10721 }
10722 },
10723 "pt-BR": {
10724 "stringUnit": {
10725 "state": "translated",
10726 "value": "Concluído hoje"
10727 }
10728 }
10729 }
10730 },
10697 10731 "Doom's own org defaults are read from the folder Doom is installed in": {
10698 10732 "localizations": {
10699 10733 "de": {
@@ -17286,6 +17320,40 @@
17286 17320 }
17287 17321 }
17288 17322 },
17323 "Last chance today": {
17324 "localizations": {
17325 "de": {
17326 "stringUnit": {
17327 "state": "translated",
17328 "value": "Heute letzte Gelegenheit"
17329 }
17330 },
17331 "es": {
17332 "stringUnit": {
17333 "state": "translated",
17334 "value": "Última oportunidad hoy"
17335 }
17336 },
17337 "fr": {
17338 "stringUnit": {
17339 "state": "translated",
17340 "value": "Dernière chance aujourd'hui"
17341 }
17342 },
17343 "ja": {
17344 "stringUnit": {
17345 "state": "translated",
17346 "value": "今日が最後の機会"
17347 }
17348 },
17349 "pt-BR": {
17350 "stringUnit": {
17351 "state": "translated",
17352 "value": "Última chance hoje"
17353 }
17354 }
17355 }
17356 },
17289 17357 "Later": {
17290 17358 "localizations": {
17291 17359 "de": {
@@ -21961,6 +22029,40 @@
21961 22029 }
21962 22030 }
21963 22031 },
22032 "Not due today": {
22033 "localizations": {
22034 "de": {
22035 "stringUnit": {
22036 "state": "translated",
22037 "value": "Heute nicht fällig"
22038 }
22039 },
22040 "es": {
22041 "stringUnit": {
22042 "state": "translated",
22043 "value": "No vence hoy"
22044 }
22045 },
22046 "fr": {
22047 "stringUnit": {
22048 "state": "translated",
22049 "value": "Pas d'échéance aujourd'hui"
22050 }
22051 },
22052 "ja": {
22053 "stringUnit": {
22054 "state": "translated",
22055 "value": "今日は期限なし"
22056 }
22057 },
22058 "pt-BR": {
22059 "stringUnit": {
22060 "state": "translated",
22061 "value": "Não vence hoje"
22062 }
22063 }
22064 }
22065 },
21964 22066 "Not imported": {
21965 22067 "localizations": {
21966 22068 "de": {