summaryrefslogtreecommitdiff
path: root/Hutch/Views/Settings
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-04-13 09:57:23 -0500
committerChristian Cleberg <[email protected]>2026-04-13 09:57:23 -0500
commit0e461a382257979037e8927e5f6b468635b0a7fe (patch)
tree0aa3a19f6f8f966b0e90f4874ed54359a7898107 /Hutch/Views/Settings
parentee9f2904aa319231b7047fca3cb069f0c07019cd (diff)
downloadhutch-0e461a382257979037e8927e5f6b468635b0a7fe.tar.gz
hutch-0e461a382257979037e8927e5f6b468635b0a7fe.tar.bz2
hutch-0e461a382257979037e8927e5f6b468635b0a7fe.zip
feat: add power user actions
Implements: https://todo.sr.ht/~ccleberg/hutch/52 Implements: https://todo.sr.ht/~ccleberg/hutch/53 Implements: https://todo.sr.ht/~ccleberg/hutch/54
Diffstat (limited to 'Hutch/Views/Settings')
-rw-r--r--Hutch/Views/Settings/SettingsView.swift41
1 files changed, 39 insertions, 2 deletions
diff --git a/Hutch/Views/Settings/SettingsView.swift b/Hutch/Views/Settings/SettingsView.swift
index b6ff8dd..f8cc0bd 100644
--- a/Hutch/Views/Settings/SettingsView.swift
+++ b/Hutch/Views/Settings/SettingsView.swift
@@ -7,6 +7,7 @@ struct SettingsView: View {
@AppStorage(AppStorageKeys.swipeActionsEnabled, store: .standard) private var swipeActionsEnabled = true
@AppStorage(AppStorageKeys.contributionGraphsEnabled, store: .standard) private var contributionGraphsEnabled = true
@State private var pendingDestructiveAction: SettingsDestructiveAction?
+ @State private var showAccountSwitcher = false
var body: some View {
Form {
@@ -17,6 +18,9 @@ struct SettingsView: View {
}
.themedList()
.navigationTitle("Settings")
+ .sheet(isPresented: $showAccountSwitcher) {
+ AccountSwitcherView()
+ }
.alert(
pendingDestructiveAction?.title ?? "",
isPresented: Binding(
@@ -98,8 +102,8 @@ struct SettingsView: View {
}
.alignmentGuide(.listRowSeparatorLeading) { _ in 0 }
- NavigationLink {
- AccountSwitcherView()
+ Button {
+ showAccountSwitcher = true
} label: {
Label("Manage Accounts", systemImage: "person.2")
}
@@ -176,6 +180,7 @@ private enum SettingsDestructiveAction {
}
private struct AboutView: View {
+ @Environment(AppState.self) private var appState
private let appName = Bundle.main.object(forInfoDictionaryKey: "CFBundleDisplayName") as? String
?? Bundle.main.object(forInfoDictionaryKey: "CFBundleName") as? String
?? "Hutch"
@@ -183,6 +188,17 @@ private struct AboutView: View {
?? "Unknown"
private let build = Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String
?? "Unknown"
+ @State private var developerRevealCount = 0
+
+ private var developerToolsVisible: Bool {
+ appState.isDebugModeEnabled || developerRevealCount >= 5
+ }
+
+ private var developerRevealFooterText: String {
+ developerRevealCount >= 5
+ ? "Debug toggle unlocked. Scroll down to Developer to enable it."
+ : "Tap the build number 5 times to reveal the debug toggle."
+ }
var body: some View {
Form {
@@ -197,7 +213,15 @@ private struct AboutView: View {
.padding(.vertical, 4)
LabeledContent("Version", value: version)
+ .onTapGesture {
+ developerRevealCount = min(developerRevealCount + 1, 5)
+ }
LabeledContent("Build", value: build)
+ .onTapGesture {
+ developerRevealCount = min(developerRevealCount + 1, 5)
+ }
+ } footer: {
+ Text(developerRevealFooterText)
}
Section("Links") {
@@ -233,6 +257,19 @@ private struct AboutView: View {
.font(.subheadline)
.foregroundStyle(.secondary)
}
+
+ if developerToolsVisible {
+ Section {
+ Toggle("Debug Mode", isOn: Binding(
+ get: { appState.isDebugModeEnabled },
+ set: { appState.isDebugModeEnabled = $0 }
+ ))
+ } header: {
+ Text("Developer")
+ } footer: {
+ Text("Shows raw API payloads and diagnostic details on builds and tickets screens. This stays hidden until explicitly enabled.")
+ }
+ }
}
.themedList()
.navigationTitle("About")