summaryrefslogtreecommitdiff
path: root/Hutch/Views/Settings
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-04-20 12:42:09 -0500
committerChristian Cleberg <[email protected]>2026-04-20 12:42:09 -0500
commit454c459394437f346a2d08d59a5504c0f6ec299f (patch)
treedd7dc1521aec859cb7b093c922ea61ea5efac7a9 /Hutch/Views/Settings
parent32c0e55b0713a15094c1640e7af70e0ed19d78d6 (diff)
downloadhutch-454c459394437f346a2d08d59a5504c0f6ec299f.tar.gz
hutch-454c459394437f346a2d08d59a5504c0f6ec299f.tar.bz2
hutch-454c459394437f346a2d08d59a5504c0f6ec299f.zip
feat: user-defined time period for recent builds card
- limit Home failed-build counts to a configurable lookback window and add the setting under Behavior. - make the Recent and Builds rows fully tappable across the entire cell and add coverage for the new failed-build filtering. Fixes: https://todo.sr.ht/~ccleberg/hutch/67
Diffstat (limited to 'Hutch/Views/Settings')
-rw-r--r--Hutch/Views/Settings/SettingsView.swift18
1 files changed, 16 insertions, 2 deletions
diff --git a/Hutch/Views/Settings/SettingsView.swift b/Hutch/Views/Settings/SettingsView.swift
index 0046f92..ce980e2 100644
--- a/Hutch/Views/Settings/SettingsView.swift
+++ b/Hutch/Views/Settings/SettingsView.swift
@@ -6,6 +6,8 @@ struct SettingsView: View {
@AppStorage(AppStorageKeys.displayDensity, store: .standard) private var displayDensity: DisplayDensity = .standard
@AppStorage(AppStorageKeys.swipeActionsEnabled, store: .standard) private var swipeActionsEnabled = true
@AppStorage(AppStorageKeys.contributionGraphsEnabled, store: .standard) private var contributionGraphsEnabled = true
+ @AppStorage(AppStorageKeys.homeFailedBuildLookbackDays, store: .standard)
+ private var failedBuildLookbackDays = HomeViewModel.defaultFailedBuildLookbackDays
@State private var pendingDestructiveAction: SettingsDestructiveAction?
@State private var showAccountSwitcher = false
@@ -85,10 +87,16 @@ struct SettingsView: View {
ContributionWidgetContextStore.setEnabled(newValue)
}
.themedRow()
+ Picker("Failed build window", selection: $failedBuildLookbackDays) {
+ ForEach(HomeViewModel.allowedFailedBuildLookbackDays, id: \.self) { days in
+ Text(failedBuildWindowLabel(days)).tag(days)
+ }
+ }
+ .themedRow()
} header: {
Text("Behavior")
} footer: {
- Text("When enabled, swipe list rows to quickly take actions like resolving tickets, cancelling builds, and deleting pastes. Contribution graphs controls whether SourceHut activity heatmaps appear in lookup profiles.")
+ Text("When enabled, swipe list rows to quickly take actions like resolving tickets, cancelling builds, and deleting pastes. Contribution graphs controls whether SourceHut activity heatmaps appear in lookup profiles. Failed build window controls how far back the Home tab counts failed builds.")
}
}
@@ -143,6 +151,13 @@ struct SettingsView: View {
}
+private func failedBuildWindowLabel(_ days: Int) -> String {
+ if days == 1 {
+ return "Today only"
+ }
+ return "Last \(days) days"
+}
+
func settingsBioAttributedString(_ markdown: String) -> AttributedString {
profileBioAttributedString(markdown)
}
@@ -178,4 +193,3 @@ private enum SettingsDestructiveAction {
}
}
}
-