chore: sync webchat bundle and voice wake settings

This commit is contained in:
Peter Steinberger
2025-12-08 21:51:08 +01:00
parent 293b4960f3
commit 11400e43dc
2 changed files with 1781 additions and 1784 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -228,50 +228,44 @@ struct VoiceWakeSettings: View {
} }
private func chimeRow(title: String, selection: Binding<VoiceWakeChime>) -> some View { private func chimeRow(title: String, selection: Binding<VoiceWakeChime>) -> some View {
VStack(alignment: .leading, spacing: 6) { HStack(alignment: .center, spacing: 10) {
HStack(alignment: .center, spacing: 8) { Text(title)
Text(title) .font(.callout.weight(.semibold))
.font(.callout.weight(.semibold)) .frame(width: self.fieldLabelWidth, alignment: .leading)
.frame(width: self.fieldLabelWidth, alignment: .leading)
Menu { Menu {
Button("No Sound") { selection.wrappedValue = .none } Button("No Sound") { selection.wrappedValue = .none }
Divider() Divider()
ForEach(VoiceWakeChimeCatalog.systemOptions, id: \.self) { option in ForEach(VoiceWakeChimeCatalog.systemOptions, id: \.self) { option in
Button(VoiceWakeChimeCatalog.displayName(for: option)) { Button(VoiceWakeChimeCatalog.displayName(for: option)) {
selection.wrappedValue = .system(name: option) selection.wrappedValue = .system(name: option)
}
} }
Divider()
Button("Choose file…") { self.chooseCustomChime(for: selection) }
} label: {
HStack(spacing: 6) {
Text(selection.wrappedValue.displayLabel)
Spacer()
Image(systemName: "chevron.down")
.font(.caption)
.foregroundStyle(.secondary)
}
.frame(width: self.controlWidth, alignment: .leading)
.padding(6)
.background(Color(nsColor: .windowBackgroundColor))
.overlay(
RoundedRectangle(cornerRadius: 6)
.stroke(Color.secondary.opacity(0.25), lineWidth: 1))
.clipShape(RoundedRectangle(cornerRadius: 6))
} }
Divider()
Button("Play") { Button("Choose file…") { self.chooseCustomChime(for: selection) }
VoiceWakeChimePlayer.play(selection.wrappedValue) } label: {
HStack(spacing: 6) {
Text(selection.wrappedValue.displayLabel)
.lineLimit(1)
.truncationMode(.middle)
Spacer()
Image(systemName: "chevron.down")
.font(.caption)
.foregroundStyle(.secondary)
} }
.keyboardShortcut(.space, modifiers: [.command]) .padding(6)
.frame(minWidth: self.controlWidth, maxWidth: .infinity, alignment: .leading)
.background(Color(nsColor: .windowBackgroundColor))
.overlay(
RoundedRectangle(cornerRadius: 6)
.stroke(Color.secondary.opacity(0.25), lineWidth: 1))
.clipShape(RoundedRectangle(cornerRadius: 6))
} }
if case let .custom(displayName, _) = selection.wrappedValue { Button("Play") {
Text("Custom: \(displayName)") VoiceWakeChimePlayer.play(selection.wrappedValue)
.font(.footnote)
.foregroundStyle(.secondary)
} }
.keyboardShortcut(.space, modifiers: [.command])
} }
} }