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 <tqwyy79vzn@privaterelay.appleid.com>
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user