@@ -196,7 +196,6 @@ struct TaskWidgetEntryView: View {
196196 VStack ( spacing : 4 ) { // Compact spacing
197197 ForEach ( Array ( sortedTasks . prefix ( 2 ) ) ) { task in
198198 taskRow ( task : task )
199- . widgetURL ( URL ( string : " taskwarrior://cardclicked?uuid= \( task . uuid ) " ) )
200199 }
201200
202201 if sortedTasks . count > 2 {
@@ -214,7 +213,7 @@ struct TaskWidgetEntryView: View {
214213 VStack ( spacing : 7 ) {
215214 ForEach ( Array ( sortedTasks . prefix ( 6 ) ) ) { task in
216215 taskRow ( task : task )
217- . widgetURL ( URL ( string : " taskwarrior://cardclicked?uuid= \( task . uuid ) " ) )
216+
218217 }
219218
220219 if sortedTasks . count > 6 {
@@ -227,32 +226,42 @@ struct TaskWidgetEntryView: View {
227226 }
228227 }
229228
230- // -- Row Designs --
231-
232- // Unified Row Design (Clean, Single Line)
233- func taskRow ( task : Task ) -> some View {
234- HStack ( spacing : 10 ) {
235- // Colored Bar
236- Capsule ( )
237- . fill ( task . priorityColor )
238- . frame ( width : 10 , height : 10 ) // Smaller height since text is single line
239-
240- // Description (Single line, centered vertically)
241- Text ( task . description )
242- . font ( . subheadline )
243- . fontWeight ( . medium )
244- . lineLimit ( 1 )
245- . foregroundColor ( . primary )
246-
247- Spacer ( )
229+ func taskRow ( task : Task ) -> some View {
230+ let isRealTask = task . uuid != " NO_TASK "
231+
232+ return Link ( destination : URL ( string : " taskwarrior://cardclicked?uuid= \( task . uuid ) " ) ! ) {
233+ HStack ( spacing : 10 ) {
234+
235+ // 1. Center alignment for status messages
236+ if ! isRealTask {
237+ Spacer ( )
238+ }
239+
240+ // 2. Priority Dot (Real tasks only)
241+ if isRealTask {
242+ Capsule ( )
243+ . fill ( task . priorityColor )
244+ . frame ( width : 10 , height : 10 )
245+ }
246+
247+ // 3. Task Description
248+ Text ( task . description )
249+ . font ( . subheadline )
250+ . fontWeight ( . medium )
251+ . lineLimit ( 1 )
252+ . foregroundColor ( isRealTask ? . primary : . secondary )
253+
254+ // 4. Trailing Spacer
255+ Spacer ( )
256+ }
257+ . padding ( . vertical , 8 )
258+ . padding ( . horizontal , 12 )
259+ . background (
260+ RoundedRectangle ( cornerRadius : 12 )
261+ // 5. Hide background if it's not a real task
262+ . fill ( isRealTask ? Color ( UIColor . secondarySystemBackground ) : Color . clear )
263+ )
248264 }
249- // Compact Padding to fit more items
250- . padding ( . vertical , 8 )
251- . padding ( . horizontal , 12 )
252- . background (
253- RoundedRectangle ( cornerRadius : 12 )
254- . fill ( Color ( UIColor . secondarySystemBackground ) )
255- )
256265 . fixedSize ( horizontal : false , vertical : true )
257266 }
258267}
0 commit comments