Add searchable instrument browser

This commit is contained in:
diyaa
2026-09-14 00:55:41 +02:00
parent b2bf04e78b
commit ecbf07d1ea
5 changed files with 102 additions and 1 deletions
@@ -9,6 +9,7 @@ struct ProjectInspectorView: View {
@State private var newInstrumentName = ""
@State private var newVocalistLabel = ""
@State private var newLanguageName = ""
@State private var isInstrumentBrowserPresented = false
@State private var isSaving = false
@State private var saveStatus: SaveStatus?
@@ -62,6 +63,12 @@ struct ProjectInspectorView: View {
}
Section("Instruments") {
Button {
isInstrumentBrowserPresented = true
} label: {
Label("Browse catalog", systemImage: "magnifyingglass")
}
ForEach($project.instruments, id: \.instrumentId) { $instrument in
Toggle(isOn: $instrument.selected) {
Text(instrument.variant?.isEmpty == false ? instrument.variant ?? instrument.instrumentId : instrument.instrumentId)
@@ -138,6 +145,9 @@ struct ProjectInspectorView: View {
}
}
.background(Color(nsColor: .windowBackgroundColor))
.sheet(isPresented: $isInstrumentBrowserPresented) {
InstrumentBrowserView()
}
}
private var durationSecondsBinding: Binding<String> {