macOS client parity review
This commit is contained in:
@@ -150,16 +150,27 @@ private struct LeadNotes: View {
|
||||
let groups = [("", "Every project")] + store.projects.map { ($0.id, $0.name) }
|
||||
let current = groups.contains { $0.0 == project } ? project : ""
|
||||
let shown = list.filter { ($0.projectId ?? "") == current }
|
||||
Picker("", selection: Binding(get: { current }, set: { v in
|
||||
project = v
|
||||
notesProject = v
|
||||
})) {
|
||||
let label = { (g: (String, String)) in "\(g.1) (\(list.filter { ($0.projectId ?? "") == g.0 }.count))" }
|
||||
Menu {
|
||||
ForEach(groups, id: \.0) { g in
|
||||
Text("\(g.1) (\(list.filter { ($0.projectId ?? "") == g.0 }.count))").tag(g.0)
|
||||
Button(label(g)) {
|
||||
project = g.0
|
||||
notesProject = g.0
|
||||
}
|
||||
}
|
||||
} label: {
|
||||
HStack(spacing: 8) {
|
||||
Text(label(groups.first { $0.0 == current } ?? groups[0]))
|
||||
Image(systemName: "chevron.up.chevron.down")
|
||||
.font(.system(size: 9, weight: .semibold))
|
||||
}
|
||||
.foregroundStyle(Palette.text)
|
||||
.modifier(FieldStyle())
|
||||
.contentShape(Rectangle())
|
||||
}
|
||||
.labelsHidden()
|
||||
.pickerStyle(.menu)
|
||||
.menuStyle(.button)
|
||||
.buttonStyle(.plain)
|
||||
.menuIndicator(.hidden)
|
||||
.fixedSize()
|
||||
.help("Which notes to show")
|
||||
.padding(.bottom, 8)
|
||||
|
||||
Reference in New Issue
Block a user