From cac11f0a22ab877591e4fb0663d3f2ac72962827 Mon Sep 17 00:00:00 2001 From: psavarmattas Date: Sat, 15 Aug 2026 20:31:24 +0100 Subject: [PATCH] feat(settings): Preferences notification-badge picker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes out the Behavior subsection. Uses NotificationBadgeStyle (None/Unread Indicator/Unread Count) — wire values are a guess same as the other preference keys, flagged in OutlineUserPreferences. --- Outpost/Features/Account/SettingsView.swift | 30 +++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Outpost/Features/Account/SettingsView.swift b/Outpost/Features/Account/SettingsView.swift index 771d4dd..5bdb771 100644 --- a/Outpost/Features/Account/SettingsView.swift +++ b/Outpost/Features/Account/SettingsView.swift @@ -293,6 +293,8 @@ struct SettingsView: View { isOn: session.userPreferences?.smartText ?? false, onChange: { newValue in Task { await savePreference { $0.smartText = newValue } } } ) + Divider() + notificationBadgeRow } if let preferencesErrorMessage { @@ -370,6 +372,34 @@ struct SettingsView: View { } } + private var notificationBadgeRow: some View { + HStack { + VStack(alignment: .leading, spacing: 2) { + Text("Notification badge") + Text("Choose how unread notifications are indicated on the app icon.") + .font(.caption) + .foregroundStyle(.secondary) + } + Spacer() + Picker("Notification badge", selection: notificationBadgeBinding) { + ForEach(NotificationBadgeStyle.allCases) { style in + Text(style.label).tag(style) + } + } + .labelsHidden() + .frame(width: 160) + } + } + + private var notificationBadgeBinding: Binding { + Binding( + get: { + session.userPreferences?.notificationBadge.flatMap(NotificationBadgeStyle.init(rawValue:)) ?? .all + }, + set: { newValue in Task { await savePreference { $0.notificationBadge = newValue.rawValue } } } + ) + } + private var languageBinding: Binding { Binding( get: { session.userLanguage ?? "en_US" },