From 3bc63119eeb09b6ae35658ccf73b82be4885a121 Mon Sep 17 00:00:00 2001 From: Robin Kutesa Date: Mon, 1 Jun 2026 02:37:54 +0300 Subject: [PATCH] Fix: scope task completion toggle to circle only Wrapping the entire TaskRowView in a Button caused any tap on the row to mark the task complete. Circle is now the only interactive element. Co-Authored-By: Kutesir --- KisaniCal/Views/TodayView.swift | 78 ++++++++++++++++----------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/KisaniCal/Views/TodayView.swift b/KisaniCal/Views/TodayView.swift index e9ba6f6..9fe299f 100644 --- a/KisaniCal/Views/TodayView.swift +++ b/KisaniCal/Views/TodayView.swift @@ -978,8 +978,8 @@ struct TaskRowView: View { }() var body: some View { - Button(action: onToggle) { - HStack(spacing: 10) { + HStack(spacing: 10) { + Button(action: onToggle) { ZStack { Circle() .fill(task.taskColor.soft()) @@ -990,48 +990,48 @@ struct TaskRowView: View { } .frame(width: 36, height: 44) .padding(.leading, 4) + .contentShape(Circle()) + } + .buttonStyle(PressButtonStyle(scale: 0.82)) - VStack(alignment: .leading, spacing: 2) { - Text(task.title) - .font(AppFonts.sans(13)) - .foregroundColor(AppColors.text(cs)) - if let d = task.dueDate, showDetails { - HStack(spacing: 4) { - Text("\(dueFmt.string(from: d))\(task.isRecurring ? " · Annual" : "")") - .font(AppFonts.mono(9.5)) - .foregroundColor(AppColors.text3(cs)) - Text("·") - .font(AppFonts.mono(9.5)) - .foregroundColor(AppColors.text3(cs).opacity(0.4)) - Text(countdownLabel(to: d)) - .font(AppFonts.mono(9.5, weight: .semibold)) - .foregroundColor(countdownColor(to: d)) - } + VStack(alignment: .leading, spacing: 2) { + Text(task.title) + .font(AppFonts.sans(13)) + .foregroundColor(AppColors.text(cs)) + if let d = task.dueDate, showDetails { + HStack(spacing: 4) { + Text("\(dueFmt.string(from: d))\(task.isRecurring ? " · Annual" : "")") + .font(AppFonts.mono(9.5)) + .foregroundColor(AppColors.text3(cs)) + Text("·") + .font(AppFonts.mono(9.5)) + .foregroundColor(AppColors.text3(cs).opacity(0.4)) + Text(countdownLabel(to: d)) + .font(AppFonts.mono(9.5, weight: .semibold)) + .foregroundColor(countdownColor(to: d)) } } - - Spacer() - - TagChip( - text: task.category.rawValue, - color: task.taskColor.color(), - bg: task.taskColor.soft() - ) - .padding(.trailing, 9) } - .frame(minHeight: 48) - .background(AppColors.surface(cs)) - .overlay(alignment: .leading) { - Rectangle() - .fill(task.taskColor.color()) - .frame(width: 2.5) - } - .clipShape(RoundedRectangle(cornerRadius: AppRadius.small)) - .overlay(RoundedRectangle(cornerRadius: AppRadius.small) - .stroke(AppColors.border(cs), lineWidth: 1)) - .contentShape(Rectangle()) + + Spacer() + + TagChip( + text: task.category.rawValue, + color: task.taskColor.color(), + bg: task.taskColor.soft() + ) + .padding(.trailing, 9) } - .buttonStyle(PressButtonStyle()) + .frame(minHeight: 48) + .background(AppColors.surface(cs)) + .overlay(alignment: .leading) { + Rectangle() + .fill(task.taskColor.color()) + .frame(width: 2.5) + } + .clipShape(RoundedRectangle(cornerRadius: AppRadius.small)) + .overlay(RoundedRectangle(cornerRadius: AppRadius.small) + .stroke(AppColors.border(cs), lineWidth: 1)) } private func countdownLabel(to date: Date) -> String {