Cut transcript noise: fold grey boxes, drop duplicate review rows

This commit is contained in:
Ian Gulliver
2026-10-20 13:04:17 -07:00
parent 0f33ad4524
commit a7b2333535
14 changed files with 312 additions and 290 deletions
+13 -22
View File
@@ -300,19 +300,27 @@ private struct CardBody: View {
var body: some View {
let p = model.payload
let item = model.item
let split = model.context.firstIndex(where: choiceList) ?? model.context.count
VStack(alignment: .leading, spacing: 0) {
MarkdownView(blocks: model.context, ctx: contextCtx)
.onGeometryChange(for: Bool.self) { $0.size.width > 480 } action: { wide = $0 }
.padding(.vertical, 10)
MarkdownView(blocks: Array(model.context[..<split]), ctx: contextCtx)
.padding(.top, 10)
if question {
MarkdownView(blocks: parseMarkdown(jsString(p["question"] ?? "")), ctx: MDContext(taskId: item.taskId))
.padding(.top, 10)
.padding(.bottom, 4)
}
WhyLine(text: jsString(p["why_blocked"] ?? ""), taskId: item.taskId)
MarkdownView(blocks: Array(model.context[split...]), ctx: contextCtx)
.padding(.top, 10)
.padding(.bottom, 8)
Attachments(list: attachments(p["attachments"] ?? nil), taskId: item.taskId)
}
.onGeometryChange(for: Bool.self) { $0.size.width > 480 } action: { wide = $0 }
}
private func choiceList(_ block: MDBlock) -> Bool {
if case .list(_, _, let items, _) = block {
return items.contains { $0.choice != nil }
}
return false
}
private func attachments(_ v: (any Sendable)?) -> [Attachment] {
@@ -328,23 +336,6 @@ private struct CardBody: View {
}
}
private struct WhyLine: View {
let text: String
let taskId: String
@Environment(Store.self) private var store
var body: some View {
var out = AttributedString("Blocked on: ")
out.foregroundColor = Palette.text
var rest = InlineRenderer(store: store, size: 13, taskId: taskId).text(parseInline(text))
rest.foregroundColor = rest.foregroundColor ?? Palette.muted
return Text(out + rest)
.foregroundStyle(Palette.muted)
.textSelection(.enabled)
.fixedSize(horizontal: false, vertical: true)
}
}
private struct ChoiceBox: View {
let model: CardModel
let item: MDItem