summaryrefslogtreecommitdiff
path: root/Hutch/App
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-07-16 11:50:53 -0500
committerGitHub <[email protected]>2026-07-16 11:50:53 -0500
commit0b6819d2d08b552e62fd236614d4c3c86a13394b (patch)
treeefb71f83c6dc62778ab01de9951cd229b50f348c /Hutch/App
parent2b913e1b727429a3a6bc7eb023003ef2815919ae (diff)
parentf3c70e04148c57dcafead89b4e02b83e5f5635f8 (diff)
downloadhutch-3.8.1.tar.gz
hutch-3.8.1.tar.bz2
hutch-3.8.1.zip
Merge pull request #8 from zerolabsco/phase-3-sonarcloud-housekeepingv3.8.1
v3.8.1: SonarCloud triage, forceRefresh fix, housekeeping
Diffstat (limited to 'Hutch/App')
-rw-r--r--Hutch/App/AccountSession.swift32
-rw-r--r--Hutch/App/HutchIntents.swift6
-rw-r--r--Hutch/App/RootView.swift8
3 files changed, 39 insertions, 7 deletions
diff --git a/Hutch/App/AccountSession.swift b/Hutch/App/AccountSession.swift
new file mode 100644
index 0000000..1918b0a
--- /dev/null
+++ b/Hutch/App/AccountSession.swift
@@ -0,0 +1,32 @@
+import Foundation
+
+struct AccountSession: Sendable {
+ let account: AccountEntry
+ let user: User
+ let client: SRHTClient
+ let defaults: UserDefaults
+ let systemStatusRepository: SystemStatusRepository
+
+ var id: String {
+ account.id
+ }
+}
+
+enum AccountDefaultsStore {
+ private static let suitePrefix = "net.cleberg.Hutch.account"
+
+ static func userDefaults(for accountID: String) -> UserDefaults {
+ let suiteName = suiteName(for: accountID)
+ return UserDefaults(suiteName: suiteName) ?? .standard
+ }
+
+ static func clear(accountID: String) {
+ let suiteName = suiteName(for: accountID)
+ guard let defaults = UserDefaults(suiteName: suiteName) else { return }
+ defaults.removePersistentDomain(forName: suiteName)
+ }
+
+ private static func suiteName(for accountID: String) -> String {
+ "\(suitePrefix).\(accountID)"
+ }
+}
diff --git a/Hutch/App/HutchIntents.swift b/Hutch/App/HutchIntents.swift
index c2f144a..947ec04 100644
--- a/Hutch/App/HutchIntents.swift
+++ b/Hutch/App/HutchIntents.swift
@@ -134,7 +134,8 @@ struct SearchHutchIntent: AppIntent {
var route: HutchRoute {
let normalized = query.trimmingCharacters(in: .whitespacesAndNewlines)
- // TODO: Route to global local search once Hutch has one.
+ // Routes to Lookup for now; repoint at a global content search when Hutch
+ // gains one — tracked in ROADMAP.md § "App Intent gaps".
return normalized.isEmpty ? .lookup : .search(query: normalized)
}
@@ -145,7 +146,8 @@ struct SearchHutchIntent: AppIntent {
}
}
-// TODO: Add OpenSavedSearchIntent when Hutch has global saved-search persistence.
+// An OpenSavedSearchIntent belongs here once Hutch has global saved-search
+// persistence — tracked in ROADMAP.md § "App Intent gaps".
// MARK: - App Entities
diff --git a/Hutch/App/RootView.swift b/Hutch/App/RootView.swift
index 10720ad..2e16718 100644
--- a/Hutch/App/RootView.swift
+++ b/Hutch/App/RootView.swift
@@ -198,11 +198,9 @@ struct RootView: View {
}
switch link {
- case .home:
- homePath = NavigationPath()
- appState.selectedTab = .home
-
- case .recentActivity:
+ // Recent activity is a section of the Home tab, not a screen of its
+ // own, so its intent/widget deep link lands on Home like .home does.
+ case .home, .recentActivity:
homePath = NavigationPath()
appState.selectedTab = .home