Render interactive architecture diagrams natively in the transcript

This commit is contained in:
Ian Gulliver
2026-10-21 15:01:28 -07:00
parent 08b8a3ab32
commit 47b62763ce
8 changed files with 1016 additions and 13 deletions
+19 -10
View File
@@ -606,16 +606,25 @@ struct DiagramView: View {
FlowchartCanvas(layout: layoutFlowchart(chart))
.frame(maxWidth: .infinity, alignment: .leading)
case .failure(let error):
VStack(alignment: .leading, spacing: 4) {
Text(verbatim: source)
.textSelection(.enabled)
.padding(.horizontal, 8)
.padding(.vertical, 6)
.frame(maxWidth: .infinity, alignment: .leading)
.background(Palette.surface, in: RoundedRectangle(cornerRadius: 6))
Text(verbatim: "diagram not rendered: \(error.reason)")
.foregroundStyle(Palette.muted)
}
DiagramFailure(source: source, reason: error.reason)
}
}
}
struct DiagramFailure: View {
let source: String
let reason: String
var body: some View {
VStack(alignment: .leading, spacing: 4) {
Text(verbatim: source)
.textSelection(.enabled)
.padding(.horizontal, 8)
.padding(.vertical, 6)
.frame(maxWidth: .infinity, alignment: .leading)
.background(Palette.surface, in: RoundedRectangle(cornerRadius: 6))
Text(verbatim: "diagram not rendered: \(reason)")
.foregroundStyle(Palette.muted)
}
}
}