question disappeared
This commit is contained in:
+19
-10
@@ -1276,18 +1276,27 @@ private struct QuestionBubble: View {
|
||||
QuestionCard(item: item)
|
||||
.id("\(item.id)/\(item.state.rawValue)/\(item.responses.count)")
|
||||
} else {
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
HStack(spacing: 4) {
|
||||
Text("asked")
|
||||
WhenText(when: item.createdAt)
|
||||
}
|
||||
.font(Fonts.font(11))
|
||||
.foregroundStyle(Palette.muted)
|
||||
MarkdownView(blocks: parseMarkdown(jsString(item.payload.value["question"] ?? "")), ctx: MDContext(taskId: item.taskId))
|
||||
Text(status)
|
||||
DetailsBox(boxed: false) {
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
HStack(spacing: 4) {
|
||||
Text("asked")
|
||||
WhenText(when: item.createdAt)
|
||||
}
|
||||
.font(Fonts.font(11))
|
||||
.foregroundStyle(Palette.muted)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
MarkdownView(blocks: parseMarkdown(jsString(item.payload.value["question"] ?? "")), ctx: MDContext(taskId: item.taskId))
|
||||
Text(status)
|
||||
.font(Fonts.font(11))
|
||||
.foregroundStyle(Palette.muted)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
}
|
||||
} content: {
|
||||
QuestionDetails(item: item)
|
||||
.padding(.leading, 10)
|
||||
.overlay(alignment: .leading) {
|
||||
Rectangle().fill(Palette.border).frame(width: 1)
|
||||
}
|
||||
.padding(.top, 8)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,9 +221,33 @@ struct QuestionCard: View {
|
||||
}
|
||||
}
|
||||
|
||||
struct QuestionDetails: View {
|
||||
let item: InboxItem
|
||||
@Environment(Store.self) private var store
|
||||
@Environment(Overlays.self) private var overlays
|
||||
@ViewState private var model: CardModel?
|
||||
@FocusState private var focus: String?
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
if let model {
|
||||
CardBody(model: model, focus: $focus, question: false)
|
||||
Thread(item: item)
|
||||
}
|
||||
}
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.onAppear {
|
||||
if model == nil {
|
||||
model = CardModel(item, store, overlays)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private struct CardBody: View {
|
||||
let model: CardModel
|
||||
var focus: FocusState<String?>.Binding
|
||||
var question = true
|
||||
@ViewState private var wide = true
|
||||
|
||||
private var contextCtx: MDContext {
|
||||
@@ -239,9 +263,11 @@ private struct CardBody: View {
|
||||
MarkdownView(blocks: model.context, ctx: contextCtx)
|
||||
.onGeometryChange(for: Bool.self) { $0.size.width > 480 } action: { wide = $0 }
|
||||
.padding(.vertical, 10)
|
||||
MarkdownView(blocks: parseMarkdown(jsString(p["question"] ?? "")), ctx: MDContext(taskId: item.taskId))
|
||||
.padding(.top, 10)
|
||||
.padding(.bottom, 4)
|
||||
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)
|
||||
.padding(.bottom, 8)
|
||||
Attachments(list: attachments(p["attachments"] ?? nil), taskId: item.taskId)
|
||||
|
||||
Reference in New Issue
Block a user