From d3a27d06809e6744c092f9bed4bf0537843d0210 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Fri, 17 Jul 2026 00:27:45 -0500 Subject: Complete v4.5.0: Run Sweep intent, detail deep link, and portfolio widget Finishes the v4.5.0 "Home Screen & Shortcuts reach" scope that the tag shipped partially: - Add RunSweepIntent (opens the app and runs refreshAllTrackedDomains via the in-process router) and expose it in DomainDigShortcuts. - Extend the domaindig:// scheme with `sweep` and `domain` (detail) actions; route .detail to present TrackedDomainDetailView and .sweep to refresh the watchlist. Move DomainDigDeepLink into Shared/ so the widget can build links. - Add a WidgetKit extension (DomainDigWidgetExtension) with small/medium/large Portfolio widgets showing health counts, per-domain status, and certificate countdowns; tapping a domain deep-links into its detail. - Share portfolio state via an App Group (group.net.cleberg.DomainDig): the app writes a DomainDigWidgetData snapshot on launch/foreground and on watchlist changes and reloads timelines; the widget reads the same store. --- DomainDig/RootTabView.swift | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'DomainDig/RootTabView.swift') diff --git a/DomainDig/RootTabView.swift b/DomainDig/RootTabView.swift index 72038a1..9823d37 100644 --- a/DomainDig/RootTabView.swift +++ b/DomainDig/RootTabView.swift @@ -12,6 +12,7 @@ struct RootTabView: View { @Bindable var viewModel: DomainViewModel @State private var purchaseService = PurchaseService.shared @State private var intentRouter = DomainDigIntentRouter.shared + @State private var detailDomain: TrackedDomain? @State private var selectedTab: RootTab = FeatureAccessService.currentTier == .free ? .inspect : .dashboard var body: some View { @@ -83,6 +84,11 @@ struct RootTabView: View { selectedTab = .dashboard } } + .sheet(item: $detailDomain) { trackedDomain in + NavigationStack { + TrackedDomainDetailView(viewModel: viewModel, trackedDomain: trackedDomain) + } + } .onOpenURL { url in guard let action = DomainDigDeepLink.action(from: url) else { return } perform(action) @@ -113,6 +119,19 @@ struct RootTabView: View { if viewModel.trackDomain(domain: domain, availabilityStatus: nil) { selectedTab = .dashboard } + case let .detail(domain): + // Open the tracked domain's detail (e.g. from a widget tap). If it is + // no longer tracked, fall back to inspecting it. + if let tracked = viewModel.trackedDomains.first( + where: { $0.domain.caseInsensitiveCompare(domain) == .orderedSame } + ) { + detailDomain = tracked + } else { + perform(.inspect(domain)) + } + case .sweep: + selectedTab = .dashboard + viewModel.refreshAllTrackedDomains() } } } -- cgit v1.2.3