diff options
| author | Christian Cleberg <[email protected]> | 2026-04-12 23:19:20 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-04-12 23:19:20 -0500 |
| commit | ee9f2904aa319231b7047fca3cb069f0c07019cd (patch) | |
| tree | 69a18234512c63f38f0d477e0023969698ec3c9e /Hutch/Views/Settings | |
| parent | 72f860e0e171f6aac4e7d896e7a571147dbcb5c5 (diff) | |
| download | hutch-ee9f2904aa319231b7047fca3cb069f0c07019cd.tar.gz hutch-ee9f2904aa319231b7047fca3cb069f0c07019cd.tar.bz2 hutch-ee9f2904aa319231b7047fca3cb069f0c07019cd.zip | |
feat: add multi-account support
Implements: https://todo.sr.ht/~ccleberg/hutch/49
Implements: https://todo.sr.ht/~ccleberg/hutch/50
Implements: https://todo.sr.ht/~ccleberg/hutch/51
Diffstat (limited to 'Hutch/Views/Settings')
| -rw-r--r-- | Hutch/Views/Settings/SettingsView.swift | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/Hutch/Views/Settings/SettingsView.swift b/Hutch/Views/Settings/SettingsView.swift index 5abac90..b6ff8dd 100644 --- a/Hutch/Views/Settings/SettingsView.swift +++ b/Hutch/Views/Settings/SettingsView.swift @@ -2,10 +2,10 @@ import SwiftUI struct SettingsView: View { @Environment(AppState.self) private var appState - @AppStorage(AppStorageKeys.appTheme) private var appTheme: AppTheme = .system - @AppStorage(AppStorageKeys.displayDensity) private var displayDensity: DisplayDensity = .standard - @AppStorage(AppStorageKeys.swipeActionsEnabled) private var swipeActionsEnabled = true - @AppStorage(AppStorageKeys.contributionGraphsEnabled) private var contributionGraphsEnabled = true + @AppStorage(AppStorageKeys.appTheme, store: .standard) private var appTheme: AppTheme = .system + @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 @State private var pendingDestructiveAction: SettingsDestructiveAction? var body: some View { @@ -89,7 +89,25 @@ struct SettingsView: View { HStack { Image(systemName: "key.fill") .foregroundStyle(.secondary) - Text("Personal access token in use") + VStack(alignment: .leading, spacing: 2) { + Text(appState.currentUser?.canonicalName ?? "No active account") + Text("\(appState.accounts.count) saved account\(appState.accounts.count == 1 ? "" : "s")") + .font(.caption) + .foregroundStyle(.secondary) + } + } + .alignmentGuide(.listRowSeparatorLeading) { _ in 0 } + + NavigationLink { + AccountSwitcherView() + } label: { + Label("Manage Accounts", systemImage: "person.2") + } + + HStack { + Image(systemName: "lock.shield") + .foregroundStyle(.secondary) + Text("Tokens are stored separately per account in the iOS keychain") .font(.subheadline) .foregroundStyle(.secondary) } @@ -105,7 +123,7 @@ struct SettingsView: View { } header: { Text("Authentication") } footer: { - Text("Hutch stores your SourceHut token in the iOS keychain. Reset App Data removes saved token data, local settings, cached responses, cookies, and embedded web data on this device.") + Text("Account switching keeps local caches and saved state isolated per account. Sign Out removes all saved accounts from this device. Reset App Data also clears local settings, cached responses, cookies, and embedded web data.") } } |
