diff options
| author | Christian Cleberg <[email protected]> | 2026-04-21 23:21:19 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-04-21 23:21:19 -0500 |
| commit | 3846dc2f5dee69fc4ffbc052009a60e17d60e36b (patch) | |
| tree | 867dca9d45b87f318c1b368cd535c9c9fb53e29d /DomainDig/ContentView.swift | |
| parent | e73d58ee5dd43eaeaaa717f7781cc22256df30f0 (diff) | |
| download | domain-dig-3846dc2f5dee69fc4ffbc052009a60e17d60e36b.tar.gz domain-dig-3846dc2f5dee69fc4ffbc052009a60e17d60e36b.tar.bz2 domain-dig-3846dc2f5dee69fc4ffbc052009a60e17d60e36b.zip | |
feat(v2.5.0): add caching, request deduplication, and performance improvements
Diffstat (limited to 'DomainDig/ContentView.swift')
| -rw-r--r-- | DomainDig/ContentView.swift | 50 |
1 files changed, 50 insertions, 0 deletions
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 |
