Add Announce Background Messages setting and descriptive footers

- 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
This commit is contained in:
Blake Oliver 2026-04-05 20:12:16 -06:00
parent 0e36f8b5ff
commit 25bb6d1b54
No known key found for this signature in database
2 changed files with 28 additions and 6 deletions

View file

@ -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)"

View file

@ -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 {