clear merged
This commit is contained in:
@@ -379,7 +379,14 @@ private struct ChatHead: View {
|
||||
}
|
||||
case .task(let id):
|
||||
if let id, let task = store.findTask(id) {
|
||||
if task.status != .active {
|
||||
if task.status == .merged {
|
||||
let commit = task.mergeCommit ?? ""
|
||||
header(background: Palette.okTint) {
|
||||
Text("✓").foregroundStyle(Palette.ok)
|
||||
Text("Merged\(commit.isEmpty ? "" : " as \(commit.prefix(7))")")
|
||||
.foregroundStyle(Palette.text)
|
||||
}
|
||||
} else if task.status != .active {
|
||||
header {
|
||||
Text(task.status.rawValue)
|
||||
}
|
||||
@@ -401,13 +408,14 @@ private struct ChatHead: View {
|
||||
}
|
||||
}
|
||||
|
||||
private func header<Content: View>(@ViewBuilder _ content: () -> Content) -> some View {
|
||||
private func header<Content: View>(background: Color = .clear, @ViewBuilder _ content: () -> Content) -> some View {
|
||||
HStack(spacing: 8) {
|
||||
content()
|
||||
}
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.padding(.horizontal, 16)
|
||||
.padding(.vertical, 8)
|
||||
.background(background)
|
||||
.overlay(alignment: .bottom) {
|
||||
Rectangle().fill(Palette.border).frame(height: 1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user