From 25bb6d1b545fd00bebab23c68d7f049044856a91 Mon Sep 17 00:00:00 2001 From: Blake Oliver Date: Sun, 5 Apr 2026 20:12:16 -0600 Subject: [PATCH] Add Announce Background Messages setting and descriptive footers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - New "Announce Background Messages" toggle in Accessibility section (off by default) — VoiceOver announces messages from non-active buffers when enabled - Rename "Other Buffers" to "Background Buffer Sounds" in Sounds section - Add footer descriptions to Save Debug Buffer, Background Buffer Sounds, Status Haptics, and Announce Background Messages --- KDChat/Views/ChatBufferView.swift | 5 +++-- KDChat/Views/SettingsView.swift | 29 +++++++++++++++++++++++++---- 2 files changed, 28 insertions(+), 6 deletions(-) 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 {