Show audit and review pickers as labeled rows

This commit is contained in:
Ian Gulliver
2026-10-20 21:42:28 -07:00
parent cde5089f46
commit 4680d7d2da
+14 -6
View File
@@ -119,15 +119,14 @@ private struct ProjectWorkflowMenu: View {
var body: some View { var body: some View {
let current = audit ? project.auditWorkflow : project.reviewWorkflow let current = audit ? project.auditWorkflow : project.reviewWorkflow
let kind = audit ? "audits" : "reviews"
Menu { Menu {
Button("No \(kind)") { set("") } Button("Off") { set("") }
ForEach(workflows, id: \.self) { name in ForEach(workflows, id: \.self) { name in
Button(name) { set(name) } Button(name) { set(name) }
} }
} label: { } label: {
HStack(spacing: 6) { HStack(spacing: 6) {
Text(current.isEmpty ? "no \(kind)" : "\(kind): \(current)") Text(current.isEmpty ? "Off" : current)
Image(systemName: "chevron.up.chevron.down") Image(systemName: "chevron.up.chevron.down")
.font(.system(size: 8, weight: .semibold)) .font(.system(size: 8, weight: .semibold))
} }
@@ -175,12 +174,21 @@ private struct ProjectBlock: View {
HStack(alignment: .firstTextBaseline, spacing: 6) { HStack(alignment: .firstTextBaseline, spacing: 6) {
Text(project.name).font(Fonts.font(13, weight: 700)) Text(project.name).font(Fonts.font(13, weight: 700))
Text(project.defaultBranch).font(Fonts.font(11)).foregroundStyle(Palette.muted) Text(project.defaultBranch).font(Fonts.font(11)).foregroundStyle(Palette.muted)
Spacer()
ProjectWorkflowMenu(project: project, audit: true)
ProjectWorkflowMenu(project: project, audit: false)
} }
.padding(.top, 16) .padding(.top, 16)
.padding(.bottom, 6) .padding(.bottom, 6)
Grid(alignment: .leading, horizontalSpacing: 12, verticalSpacing: 4) {
GridRow {
Text("Audit \(project.defaultBranch)")
ProjectWorkflowMenu(project: project, audit: true)
}
GridRow {
Text("Review tasks")
ProjectWorkflowMenu(project: project, audit: false)
}
}
.font(Fonts.font(11))
.foregroundStyle(Palette.muted)
heading("Tasks") heading("Tasks")
TaskRows(active: active.filter { !$0.background }) TaskRows(active: active.filter { !$0.background })
ForEach(active.filter(\.background), id: \.id) { task in ForEach(active.filter(\.background), id: \.id) { task in