summaryrefslogtreecommitdiff
path: root/Hutch/Views/Settings/SettingsView.swift
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-04-01 14:04:27 -0500
committerChristian Cleberg <[email protected]>2026-04-01 14:04:27 -0500
commit209155dc431cf70d9c8dba20625bab7e3b1a5085 (patch)
tree42d2c2c1b2ab0863b69bd57c9c6d2ab27fe1594c /Hutch/Views/Settings/SettingsView.swift
parente84e5543be9be548784859f4b082b9d7a3122f15 (diff)
downloadhutch-2.6.1.tar.gz
hutch-2.6.1.tar.bz2
hutch-2.6.1.zip
Fix several bugs ahead of 2.6.1v2.6.1
FileTreeView: when wrap is OFF, activate an explicit width constraint on the code container derived from the widest line, giving the horizontal scroll view a defined content size. Previously the constraint was deactivated with nothing to replace it, making horizontal scrolling unreliable. Also set horizontalScrollView.isScrollEnabled = !wrapLines to prevent gesture conflicts when wrap is ON. InboxView: remove the unnecessary loadThreads() network call fired after markAllThreadsRead(). The threads array is already updated optimistically and read state is persisted via InboxReadStateStore, so the refetch was redundant and caused a brief loading flash. HomeView: add scenePhase onChange handler to refresh dashboard data when the app returns to the foreground, matching the existing pattern in InboxView. DiffView: wrap DiffBlockView content in a horizontal ScrollView so long diff lines are readable. Switch inner VStack to LazyVStack for better performance on large diffs. SettingsView: replace direct UserDefaults access in behaviorSection with @AppStorage, consistent with the rest of the app.
Diffstat (limited to 'Hutch/Views/Settings/SettingsView.swift')
-rw-r--r--Hutch/Views/Settings/SettingsView.swift11
1 files changed, 2 insertions, 9 deletions
diff --git a/Hutch/Views/Settings/SettingsView.swift b/Hutch/Views/Settings/SettingsView.swift
index e90f4e3..237c076 100644
--- a/Hutch/Views/Settings/SettingsView.swift
+++ b/Hutch/Views/Settings/SettingsView.swift
@@ -8,6 +8,7 @@ private let settingsBioMarkdownOptions = AttributedString.MarkdownParsingOptions
struct SettingsView: View {
@Environment(AppState.self) private var appState
@Environment(\.colorScheme) private var colorScheme
+ @AppStorage(AppStorageKeys.swipeActionsEnabled) private var swipeActionsEnabled = true
@State private var viewModel: SettingsViewModel?
@State private var pendingDestructiveAction: SettingsDestructiveAction?
@@ -389,15 +390,7 @@ struct SettingsView: View {
@ViewBuilder
private func behaviorSection() -> some View {
Section {
- Toggle(
- "Swipe actions",
- isOn: Binding(
- get: {
- UserDefaults.standard.object(forKey: AppStorageKeys.swipeActionsEnabled) as? Bool ?? true
- },
- set: { UserDefaults.standard.set($0, forKey: AppStorageKeys.swipeActionsEnabled) }
- )
- )
+ Toggle("Swipe actions", isOn: $swipeActionsEnabled)
} header: {
Text("Behavior")
} footer: {