From 9c11d69002d71556fea1e2a938e02d4f4d503ea5 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Fri, 7 Aug 2026 03:06:34 -0500 Subject: Expand App Intents: dialogs, search type, mutating intents (#17) Addresses the three open items on the App Intents ticket: - Check Status / Check Builds now return a spoken/visible dialog alongside their value, so they surface a result in Siri instead of appearing to do nothing. Logic consolidated to always produce a message. - Search Hutch gains a Search Type parameter (user, git/hg repo, mailing list, tracker, build job) threaded through the .search route into Lookup, which pre-selects the type. LookupType now conforms to AppEnum. - Adds mutating intents (not just navigation): Clear Recent Activity and Unpin Resource, backed by RecentActivityStore.clear and a new HomePinStore.removePin. Both act on the active account's storage. Tests cover search-type routing, the blank-query fallback, and pin removal. --- Hutch/Views/Home/HomePinStore.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'Hutch/Views/Home/HomePinStore.swift') diff --git a/Hutch/Views/Home/HomePinStore.swift b/Hutch/Views/Home/HomePinStore.swift index e9bffd1..3b00843 100644 --- a/Hutch/Views/Home/HomePinStore.swift +++ b/Hutch/Views/Home/HomePinStore.swift @@ -144,6 +144,21 @@ enum HomePinStore { saveAll(pinsByUser, defaults: defaults) } + static func removePin( + id: String, + for userKey: String, + defaults: UserDefaults = .standard + ) { + let normalizedUserKey = normalizedUserKey(userKey) + guard !normalizedUserKey.isEmpty else { return } + + var pinsByUser = loadAll(defaults: defaults) + var pins = normalizedPins(pinsByUser[normalizedUserKey] ?? loadPins(for: normalizedUserKey, defaults: defaults)) + pins.removeAll { $0.id == id } + pinsByUser[normalizedUserKey] = pins + saveAll(pinsByUser, defaults: defaults) + } + static func pinnedProjectIDs( for userKey: String, defaults: UserDefaults = .standard -- cgit v1.2.3