From 205c8ea9b2c6dfa62bc8b2342d1aa71e2da7d6ac Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Tue, 14 Apr 2026 10:42:05 -0500 Subject: fix: remove prototype screens from developer menu - removed prototype screens - limited Recent section to 3 items - added initial support for tips Fixes: https://todo.sr.ht/~ccleberg/hutch/65 --- Hutch/Views/Settings/SettingsView.swift | 134 -------------------------------- 1 file changed, 134 deletions(-) (limited to 'Hutch/Views/Settings') diff --git a/Hutch/Views/Settings/SettingsView.swift b/Hutch/Views/Settings/SettingsView.swift index 577de8a..0046f92 100644 --- a/Hutch/Views/Settings/SettingsView.swift +++ b/Hutch/Views/Settings/SettingsView.swift @@ -14,7 +14,6 @@ struct SettingsView: View { appearanceSection() behaviorSection() authenticationSection() - aboutSection() } .themedList() .navigationTitle("Settings") @@ -142,17 +141,6 @@ struct SettingsView: View { } } - @ViewBuilder - private func aboutSection() -> some View { - Section("App") { - NavigationLink { - AboutView() - } label: { - SwiftUI.Label("About Hutch", systemImage: "info.circle") - } - .themedRow() - } - } } func settingsBioAttributedString(_ markdown: String) -> AttributedString { @@ -191,125 +179,3 @@ 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" - private let version = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String - ?? "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 { - Section { - VStack(alignment: .leading, spacing: 6) { - Text(appName) - .font(.title2.weight(.semibold)) - Text("A native SourceHut client for iOS.") - .font(.subheadline) - .foregroundStyle(.secondary) - } - .padding(.vertical, 4) - .themedRow() - - LabeledContent("Version", value: version) - .onTapGesture { - developerRevealCount = min(developerRevealCount + 1, 5) - } - .themedRow() - LabeledContent("Build", value: build) - .onTapGesture { - developerRevealCount = min(developerRevealCount + 1, 5) - } - .themedRow() - } footer: { - Text(developerRevealFooterText) - } - - Section("Links") { - Link(destination: URL(string: "https://sr.ht")!) { - SwiftUI.Label("SourceHut", systemImage: "link") - } - .themedRow() - Link(destination: URL(string: "https://man.sr.ht")!) { - SwiftUI.Label("SourceHut Manuals", systemImage: "book") - } - .themedRow() - Link(destination: URL(string: "https://sr.ht/~ccleberg/Hutch")!) { - SwiftUI.Label("Project Repository", systemImage: "folder") - } - .themedRow() - } - - Section("Support") { - Link(destination: URL(string: "mailto:hello@cleberg.net")!) { - SwiftUI.Label("Email Support", systemImage: "envelope") - } - .themedRow() - } - - Section("Privacy") { - Text("Hutch uses your SourceHut personal access token to make requests on your behalf. The token is stored locally in the iOS keychain.") - .font(.subheadline) - .foregroundStyle(.secondary) - .themedRow() - - Link(destination: URL(string: "https://zerolabs.sh/hutch/privacy-policy/")!) { - SwiftUI.Label("Privacy Policy", systemImage: "hand.raised") - } - .themedRow() - } - - Section("Acknowledgements") { - Text("Built for SourceHut users who want quick access to repositories, builds, and tickets on iOS.") - .font(.subheadline) - .foregroundStyle(.secondary) - .themedRow() - } - - if developerToolsVisible { - Section { - Toggle("Debug Mode", isOn: Binding( - get: { appState.isDebugModeEnabled }, - set: { appState.isDebugModeEnabled = $0 } - )) - .themedRow() - - NavigationLink { - HomePrototypeView() - } label: { - SwiftUI.Label("Home Prototype", systemImage: "house") - } - .themedRow() - - NavigationLink { - WorkPrototypeView() - } label: { - SwiftUI.Label("Work Prototype", systemImage: "tray.full") - } - .themedRow() - } header: { - Text("Developer") - } footer: { - Text("Shows raw API payloads and diagnostic details on builds and tickets screens. Home Prototype explores the dashboard structure, while Work Prototype evaluates the personal queue surface. This stays hidden until explicitly enabled.") - } - } - } - .themedList() - .navigationTitle("About") - .navigationBarTitleDisplayMode(.inline) - } -} -- cgit v1.2.3