diff --git a/KDChat/Views/ChatBufferView.swift b/KDChat/Views/ChatBufferView.swift index 75fa71d..9050370 100644 --- a/KDChat/Views/ChatBufferView.swift +++ b/KDChat/Views/ChatBufferView.swift @@ -49,8 +49,9 @@ struct ChatBufferView: View { playBufferSound() } - // Announce + haptic — active buffer only - if isActive { + // Announce + haptic + let announceOther = UserDefaults.standard.bool(forKey: "announce_other_buffers") + if isActive || announceOther { if !last.isSystem { AccessibilityNotification.Announcement( "\(last.senderName): \(last.content)" diff --git a/KDChat/Views/SettingsView.swift b/KDChat/Views/SettingsView.swift index eda8fd6..660002e 100644 --- a/KDChat/Views/SettingsView.swift +++ b/KDChat/Views/SettingsView.swift @@ -31,6 +31,7 @@ struct SettingsView: View { @AppStorage("sounds_map") private var mapSound = true @AppStorage("sounds_dm") private var dmSound = true @AppStorage("sounds_background_buffers") private var backgroundBufferSounds = true + @AppStorage("announce_other_buffers") private var announceOtherBuffers = false @Environment(\.modelContext) private var modelContext @State private var showDeleteConfirmation = false @@ -43,7 +44,7 @@ struct SettingsView: View { var body: some View { Form { - Section("Messages") { + Section { Toggle("Save Messages", isOn: $saveMessages) Toggle("Save Debug Buffer", isOn: $saveDebugBuffer) .disabled(!saveMessages) @@ -67,9 +68,13 @@ struct SettingsView: View { } message: { Text("Are you sure you want to delete all messages from all buffers?") } + } header: { + Text("Messages") + } footer: { + Text("Save Debug Buffer saves system and debug messages between sessions.") } - Section("Sounds") { + Section { Toggle("Sounds", isOn: $soundsEnabled) Toggle("Global Chat", isOn: $globalSound) .disabled(!soundsEnabled) @@ -77,16 +82,32 @@ struct SettingsView: View { .disabled(!soundsEnabled) Toggle("Direct Messages", isOn: $dmSound) .disabled(!soundsEnabled) - Toggle("Other Buffers", isOn: $backgroundBufferSounds) + Toggle("Background Buffer Sounds", isOn: $backgroundBufferSounds) .disabled(!soundsEnabled) + } header: { + Text("Sounds") + } footer: { + Text("Background Buffer Sounds plays sounds for messages in buffers you're not currently viewing.") } - Section("Haptics") { + Section { Toggle("Haptics", isOn: $hapticsEnabled) Toggle("Message Haptics", isOn: $messageHaptics) .disabled(!hapticsEnabled) Toggle("Status Haptics", isOn: $statusHaptics) .disabled(!hapticsEnabled) + } header: { + Text("Haptics") + } footer: { + Text("Status Haptics provides feedback for system events such as connect and disconnect.") + } + + Section { + Toggle("Announce Background Messages", isOn: $announceOtherBuffers) + } header: { + Text("Accessibility") + } footer: { + Text("When on, VoiceOver announces new messages from buffers you're not currently viewing.") } Section {