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 {
|
var body: some View {
|
||||||
Button(action: onToggle) {
|
HStack(spacing: 10) {
|
||||||
HStack(spacing: 10) {
|
Button(action: onToggle) {
|
||||||
ZStack {
|
ZStack {
|
||||||
Circle()
|
Circle()
|
||||||
.fill(task.taskColor.soft())
|
.fill(task.taskColor.soft())
|
||||||
@@ -990,48 +990,48 @@ struct TaskRowView: View {
|
|||||||
}
|
}
|
||||||
.frame(width: 36, height: 44)
|
.frame(width: 36, height: 44)
|
||||||
.padding(.leading, 4)
|
.padding(.leading, 4)
|
||||||
|
.contentShape(Circle())
|
||||||
|
}
|
||||||
|
.buttonStyle(PressButtonStyle(scale: 0.82))
|
||||||
|
|
||||||
VStack(alignment: .leading, spacing: 2) {
|
VStack(alignment: .leading, spacing: 2) {
|
||||||
Text(task.title)
|
Text(task.title)
|
||||||
.font(AppFonts.sans(13))
|
.font(AppFonts.sans(13))
|
||||||
.foregroundColor(AppColors.text(cs))
|
.foregroundColor(AppColors.text(cs))
|
||||||
if let d = task.dueDate, showDetails {
|
if let d = task.dueDate, showDetails {
|
||||||
HStack(spacing: 4) {
|
HStack(spacing: 4) {
|
||||||
Text("\(dueFmt.string(from: d))\(task.isRecurring ? " · Annual" : "")")
|
Text("\(dueFmt.string(from: d))\(task.isRecurring ? " · Annual" : "")")
|
||||||
.font(AppFonts.mono(9.5))
|
.font(AppFonts.mono(9.5))
|
||||||
.foregroundColor(AppColors.text3(cs))
|
.foregroundColor(AppColors.text3(cs))
|
||||||
Text("·")
|
Text("·")
|
||||||
.font(AppFonts.mono(9.5))
|
.font(AppFonts.mono(9.5))
|
||||||
.foregroundColor(AppColors.text3(cs).opacity(0.4))
|
.foregroundColor(AppColors.text3(cs).opacity(0.4))
|
||||||
Text(countdownLabel(to: d))
|
Text(countdownLabel(to: d))
|
||||||
.font(AppFonts.mono(9.5, weight: .semibold))
|
.font(AppFonts.mono(9.5, weight: .semibold))
|
||||||
.foregroundColor(countdownColor(to: d))
|
.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))
|
Spacer()
|
||||||
.overlay(alignment: .leading) {
|
|
||||||
Rectangle()
|
TagChip(
|
||||||
.fill(task.taskColor.color())
|
text: task.category.rawValue,
|
||||||
.frame(width: 2.5)
|
color: task.taskColor.color(),
|
||||||
}
|
bg: task.taskColor.soft()
|
||||||
.clipShape(RoundedRectangle(cornerRadius: AppRadius.small))
|
)
|
||||||
.overlay(RoundedRectangle(cornerRadius: AppRadius.small)
|
.padding(.trailing, 9)
|
||||||
.stroke(AppColors.border(cs), lineWidth: 1))
|
|
||||||
.contentShape(Rectangle())
|
|
||||||
}
|
}
|
||||||
.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 {
|
private func countdownLabel(to date: Date) -> String {
|
||||||
|
|||||||
Reference in New Issue
Block a user