Let the human comment on each decision in the ready-for-merge card

This commit is contained in:
Ian Gulliver
2026-10-21 16:05:26 -07:00
parent 8202e9fc9f
commit ccb08ab6ec
7 changed files with 166 additions and 45 deletions
+9 -1
View File
@@ -412,6 +412,7 @@ struct MDContext {
var color: Color = Palette.text
var taskId: String?
var choice: ((MDItem, Bool) -> AnyView)?
var discuss: ((MDItem) -> AnyView)?
var gridColumns = 4
var weight: CGFloat = 400
var dir = ""
@@ -470,6 +471,9 @@ struct MarkdownView: View {
if ctx.choice != nil && items.contains(where: { $0.choice != nil }) {
return false
}
if ctx.discuss != nil && items.contains(where: { $0.discuss }) {
return false
}
return items.allSatisfy { !hasImage($0.inline) && $0.blocks.allSatisfy(flows) }
default:
return false
@@ -846,7 +850,11 @@ private struct ListBlock: View {
Text(verbatim: ordered ? "\(start + n)." : "•")
.font(Fonts.font(ctx.size))
.foregroundStyle(ctx.color)
ItemBody(item: item, ctx: ctx)
if item.discuss, let discuss = ctx.discuss {
discuss(item)
} else {
ItemBody(item: item, ctx: ctx)
}
}
}
}