Link running TODO items to their task

This commit is contained in:
Ian Gulliver
2026-10-22 15:03:25 -07:00
parent 2524e1cb1f
commit c59e1cb4c3
+20 -4
View File
@@ -470,10 +470,7 @@ private struct TodoRow: View {
var body: some View {
VStack(alignment: .leading, spacing: 4) {
HStack(spacing: 10) {
Text(item.title)
.foregroundStyle(task.map { taskPalette[$0.color] } ?? Palette.text)
.frame(maxWidth: .infinity, alignment: .leading)
.fixedSize(horizontal: false, vertical: true)
title
action
}
if !item.body.isEmpty {
@@ -485,6 +482,25 @@ private struct TodoRow: View {
.background(task != nil && task?.id == store.selectedTaskId ? Palette.accentTint : .clear, in: RoundedRectangle(cornerRadius: 6))
}
@ViewBuilder
private var title: some View {
let text = Text(item.title)
.foregroundStyle(task.map { taskPalette[$0.color] } ?? Palette.text)
.frame(maxWidth: .infinity, alignment: .leading)
.fixedSize(horizontal: false, vertical: true)
if let task {
Button {
store.focusTask(task.id)
} label: {
text.contentShape(Rectangle())
}
.buttonStyle(.plain)
.help("Open \(task.name)")
} else {
text
}
}
@ViewBuilder
private var action: some View {
if let task {