From 209155dc431cf70d9c8dba20625bab7e3b1a5085 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Wed, 1 Apr 2026 14:04:27 -0500 Subject: Fix several bugs ahead of 2.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. --- Hutch/Views/Repositories/DiffView.swift | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Hutch/Views/Repositories/DiffView.swift') diff --git a/Hutch/Views/Repositories/DiffView.swift b/Hutch/Views/Repositories/DiffView.swift index 4b8e512..a370dfb 100644 --- a/Hutch/Views/Repositories/DiffView.swift +++ b/Hutch/Views/Repositories/DiffView.swift @@ -76,13 +76,15 @@ private struct DiffBlockView: View { let lines: [String] var body: some View { - VStack(alignment: .leading, spacing: 0) { - ForEach(Array(lines.enumerated()), id: \.offset) { _, line in - DiffLineView(line: line) + ScrollView(.horizontal, showsIndicators: false) { + LazyVStack(alignment: .leading, spacing: 0) { + ForEach(Array(lines.enumerated()), id: \.offset) { _, line in + DiffLineView(line: line) + } } + .frame(minWidth: 0, maxWidth: .infinity, alignment: .leading) } .font(.system(.caption, design: .monospaced)) - .frame(maxWidth: .infinity, alignment: .leading) .background(Color(.secondarySystemBackground)) } } -- cgit v1.2.3