From 3846dc2f5dee69fc4ffbc052009a60e17d60e36b Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Tue, 21 Apr 2026 23:21:19 -0500 Subject: feat(v2.5.0): add caching, request deduplication, and performance improvements --- DomainDig/ContentView.swift | 50 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'DomainDig/ContentView.swift') diff --git a/DomainDig/ContentView.swift b/DomainDig/ContentView.swift index c5fc1fa..7a3a42d 100644 --- a/DomainDig/ContentView.swift +++ b/DomainDig/ContentView.swift @@ -30,6 +30,10 @@ struct ContentView: View { } if viewModel.hasRun { actionButtons + if let statusMessage = viewModel.currentStatusMessage ?? (viewModel.currentResultSource != .live ? viewModel.currentResultSource.label : nil) { + LookupStatusBannerView(message: statusMessage, resultSource: viewModel.currentResultSource) + .padding(.top, 8) + } SummaryView(fields: viewModel.summaryFields) .padding(.top, 8) if let changeSummary = viewModel.currentChangeSummary { @@ -494,6 +498,52 @@ struct SummaryView: View { } } +struct LookupStatusBannerView: View { + let message: String + let resultSource: LookupResultSource + + var body: some View { + HStack(spacing: 8) { + Image(systemName: iconName) + .font(.caption) + Text(message) + .font(.system(.caption, design: .monospaced)) + Spacer() + } + .foregroundStyle(color) + .padding(8) + .frame(maxWidth: .infinity, alignment: .leading) + .background(color.opacity(0.12)) + .clipShape(RoundedRectangle(cornerRadius: 8)) + } + + private var color: Color { + switch resultSource { + case .live: + return .green + case .cached: + return .secondary + case .mixed: + return .yellow + case .snapshot: + return .orange + } + } + + private var iconName: String { + switch resultSource { + case .live: + return "bolt.horizontal" + case .cached: + return "clock.arrow.trianglehead.counterclockwise.rotate.90" + case .mixed: + return "arrow.triangle.branch" + case .snapshot: + return "archivebox" + } + } +} + struct DomainChangeSummaryView: View { let summary: DomainChangeSummary -- cgit v1.2.3