Commit 1ebd99e628

1ebd99e62873fd909da21d86df5501f20e56eaec

parent: 3c147ebd42

Unsigned

cmc <hello@cleberg.net> · 2026-10-25 23:23 UTC

Lay out the result screens as Lists, like the rest of the app (!43)

Closes I1.

Inspect was a hand-rolled `ScrollView` of cards over a `LinearGradient`, with
manual `.padding(.top,)` between eighteen children, while Dashboard and
Settings were `List`s with per-row surface overrides. Inspect and the history
snapshot detail are now `List`s with Dashboard's exact treatment:
`.scrollContentBackground(.hidden)` over `.appBackground`, one `Section` per
block, `.appSurface` row backgrounds.

The history detail is in scope because it shares all eight result section views
and had the same hand-rolled shape — converting the section views without it
would have left its sections with no spacing.

**Two changes make that work without rewriting the sections' contents.**

`CollapsibleSectionView`'s body is a `Group` rather than a `VStack`, so its
header and each card become their own `List` row. That is the part that keeps a
section's cards apart: the Web section's TLS, Headers and Redirects cards are
*siblings*, not nested, and as a single row on a single surface they would have
merged into one undifferentiated panel. As rows, the List's separators keep
them distinct. It is used only by the eight result section views, so nothing
else is affected.

`CardView` reads a new `cardProvidesSurface` environment value and drops its
padding, fill and corner radius when its container already draws a surface. It
sets the value back to `true` for its own content, so only the outermost card
in a row gives up its chrome and a card nested inside one keeps it. Every other
screen leaves the default alone.

**Verification.** This is a visual change, so I checked it visually rather than
only building it: screenshots in both appearances via the existing
`AccessibilityScreenshotTests` attachments, and a real lookup driven through the
UI to see the collapsible sections, which the seeded fixtures do not populate.
Sections render as discrete rounded panels with separators between the cards
inside them. Dark mode is a clear improvement — Inspect had no visible panels
before. Light mode is subtle for the same reason Dashboard's is: `.appSurface`
sits close to `.appBackground` there, and Dashboard only reads better because
its rows hold elevated sub-cards.

334 unit tests green on iOS 18.6 and 27.0. On clean app data the UI suite goes
from four failing audits to one — the documented Settings `dynamicType` finding
on 27.0 — and `testHistoryScreen` now passes where it failed before. Ratchet
unchanged at 280.

One thing worth reading carefully: my first UI run showed `testInspectScreen`
failing with four findings. That was my own test pollution — the real lookup I
drove left `example.com` in recent searches, so the empty-state audit saw a
section it normally never does. With the app data cleared it passes with only
the two pre-characterised noise findings. The four findings are real but latent
and unrelated to this change, so they are recorded in
`Docs/ACCESSIBILITY.txt` as needing a seeded recent-searches fixture.

Layout: unified · split

Docs/ACCESSIBILITY.txt +15
@@ -169,6 +169,21 @@ The remaining Settings destinations — Display, History & Network, Local API,
169169iCloud Sync, Monitoring Log, Monitoring Settings, Scheduled Reports, Import &
170170Export, Data Management — are still unaudited.
171171
172## Recent searches are never audited
173
174The empty-state suite launches a fresh install, so Inspect's recent-searches
175section — which only appears once a lookup has been run — is never in the tree
176when the audit walks it. Driving one real lookup and re-auditing surfaced four
177findings in it on iOS 27.0:
178
179- `dynamicType` on the "RECENT" header and on the "Clear" button
180- `hitRegion` too small on "Clear"
181- `sufficientElementDescription`, "label not human-readable", on a domain chip
182
183These are latent rather than new: nothing in the section changed when Inspect
184moved to a `List`. They need a seeded recent-searches fixture to be audited
185properly, which the seed harness does not have.
186
172187## Why the floor runtime needs its own run
173188
174189**Audit coverage is not nested across OS versions.** Each runtime reports
DomainDig/ContentView.swift +41 −54
@@ -48,47 +48,38 @@ struct ContentView: View {
4848
4949 var body: some View {
5050 NavigationStack(path: $navigationPath) {
51 ScrollView(.vertical) {
52 VStack(spacing: 0) {
53 inputSection
54 if !viewModel.batchResults.isEmpty || viewModel.batchLookupRunning {
55 batchSection
56 .padding(.top, appDensity.metrics.cardSpacing)
57 }
58 if viewModel.hasRun {
59 actionButtons
60 if !viewModel.resultsLoaded {
61 LookupProgressOverviewView(steps: viewModel.activeLoadingLabels)
62 .padding(.top, appDensity.metrics.cardSpacing)
63 } else if let statusMessage = resultStatusMessage {
51 List {
52 Section { inputSection }
53 if !viewModel.batchResults.isEmpty || viewModel.batchLookupRunning {
54 Section { batchSection }
55 }
56 if viewModel.hasRun {
57 Section { actionButtons }
58 if !viewModel.resultsLoaded {
59 Section { LookupProgressOverviewView(steps: viewModel.activeLoadingLabels) }
60 } else if let statusMessage = resultStatusMessage {
61 Section {
6462 LookupStatusBannerView(message: statusMessage, resultSource: viewModel.currentResultSource)
65 .padding(.top, appDensity.metrics.cardSpacing)
66 }
67 if viewModel.resultsLoaded {
68 SummaryView(fields: viewModel.summaryFields)
69 .padding(.top, appDensity.metrics.cardSpacing)
70 if let report = viewModel.currentReport {
71 RiskSummaryCardView(report: report)
72 .padding(.top, appDensity.metrics.cardSpacing)
73 InsightsSummaryCardView(insights: report.insights)
74 .padding(.top, appDensity.metrics.cardSpacing)
75 }
76 if let changeSummary = viewModel.currentChangeSummary {
77 DomainChangeSummaryView(summary: changeSummary)
78 .padding(.top, appDensity.metrics.cardSpacing)
79 }
8063 }
64 }
65 if viewModel.resultsLoaded {
66 Section { SummaryView(fields: viewModel.summaryFields) }
8167 if let report = viewModel.currentReport {
82 intelligenceSection(report: report)
83 .padding(.top, appDensity.metrics.sectionSpacing)
68 Section { RiskSummaryCardView(report: report) }
69 Section { InsightsSummaryCardView(insights: report.insights) }
70 }
71 if let changeSummary = viewModel.currentChangeSummary {
72 Section { DomainChangeSummaryView(summary: changeSummary) }
8473 }
85 domainOverviewSection
86 .padding(.top, appDensity.metrics.sectionSpacing)
87 ownershipSection
88 .padding(.top, appDensity.metrics.sectionSpacing)
89 subdomainsSection
90 .padding(.top, appDensity.metrics.sectionSpacing)
91 if !viewModel.currentDiffSections.isEmpty {
74 }
75 if let report = viewModel.currentReport {
76 Section { intelligenceSection(report: report) }
77 }
78 Section { domainOverviewSection }
79 Section { ownershipSection }
80 Section { subdomainsSection }
81 if !viewModel.currentDiffSections.isEmpty {
82 Section {
9283 DomainDiffView(
9384 title: "Latest Changes",
9485 sections: viewModel.currentDiffSections,
@@ -96,15 +87,16 @@ struct ContentView: View {
9687 showsUnchanged: false,
9788 highlightedSectionID: nil
9889 )
99 .padding(.top, appDensity.metrics.sectionSpacing)
10090 }
101 dnsSection
102 .padding(.top, appDensity.metrics.sectionSpacing)
91 }
92 Section { dnsSection }
93 Section {
10394 WebSectionView(
10495 isCollapsed: sectionCollapsedBinding(.web),
10596 data: viewModel.webSectionData
10697 )
107 .padding(.top, appDensity.metrics.sectionSpacing)
98 }
99 Section {
108100 EmailSectionView(
109101 isCollapsed: sectionCollapsedBinding(.email),
110102 rows: viewModel.emailRows,
@@ -114,7 +106,8 @@ struct ContentView: View {
114106 confidence: viewModel.currentSnapshot.emailSecurityConfidence,
115107 error: viewModel.emailSecurityError
116108 )
117 .padding(.top, appDensity.metrics.sectionSpacing)
109 }
110 Section {
118111 NetworkSectionView(
119112 isCollapsed: sectionCollapsedBinding(.network),
120113 customPortsExpanded: $customPortsExpanded,
@@ -122,21 +115,15 @@ struct ContentView: View {
122115 data: viewModel.networkSectionData,
123116 onScanCustomPorts: runCustomPortScan
124117 )
125 .padding(.top, appDensity.metrics.sectionSpacing)
126 } else if !viewModel.recentSearches.isEmpty {
127 recentSearchesSection
128118 }
119 } else if !viewModel.recentSearches.isEmpty {
120 Section { recentSearchesSection }
129121 }
130 .padding(.horizontal)
131 .padding(.bottom, 32)
132122 }
133 .background(
134 LinearGradient(
135 colors: [Color(.appBackground), Color(.appSurface)],
136 startPoint: .top,
137 endPoint: .bottom
138 )
139 )
123 .listRowBackground(Color(.appSurface))
124 .environment(\.cardProvidesSurface, false)
125 .scrollContentBackground(.hidden)
126 .background(Color(.appBackground))
140127 .navigationTitle("DomainDig")
141128 .toolbar {
142129 ToolbarItem(placement: .topBarTrailing) {
DomainDig/DomainDigUI.swift +8 −1
@@ -415,6 +415,13 @@ struct EmptyStateCardView: View {
415415 }
416416}
417417
418/// A collapsible result section.
419///
420/// Its body is a `Group`, not a stack: inside a `List` that makes the header
421/// and each piece of content their own row, so the row backgrounds draw one
422/// grouped panel per section and the separators keep the cards inside it
423/// apart. Every caller puts it in a `List` for that reason — a stack would lay
424/// the children out itself and lose both.
418425struct CollapsibleSectionView<HeaderTrailing: View, Content: View>: View {
419426 @Environment(\.appDensity) private var appDensity
420427 @Environment(\.accessibilityReduceMotion) private var reduceMotion
@@ -440,7 +447,7 @@ struct CollapsibleSectionView<HeaderTrailing: View, Content: View>: View {
440447 }
441448
442449 var body: some View {
443 VStack(alignment: .leading, spacing: appDensity.metrics.cardSpacing) {
450 Group {
444451 Button {
445452 withAnimation(reduceMotion ? nil : .easeInOut(duration: 0.2)) {
446453 isCollapsed.toggle()
DomainDig/HistoryView.swift +122 −108
@@ -171,120 +171,134 @@ struct HistoryDetailView: View {
171171 }
172172
173173 var body: some View {
174 ScrollView(.vertical) {
175 VStack(alignment: .leading, spacing: 0) {
176 snapshotBanner
177 SummaryView(fields: DomainViewModel.summaryFields(from: snapshot))
178 .padding(.top, 8)
179 RiskSummaryCardView(report: report)
180 .padding(.top, 8)
181 InsightsSummaryCardView(insights: report.insights)
182 .padding(.top, 8)
183 IntelligenceSectionView(
184 isCollapsed: .constant(false),
185 report: report,
186 showsPlaceholder: !FeatureAccessService.hasAccess(to: .intelligenceDetail)
187 )
188 .padding(.top, 8)
189 DomainSectionView(
190 isCollapsed: .constant(false),
191 rows: DomainViewModel.domainRows(from: snapshot),
192 suggestions: DomainViewModel.suggestionRows(from: snapshot),
193 showSuggestions: entry.availabilityResult?.status == .registered && !entry.suggestions.isEmpty,
194 availabilityLoading: false,
195 suggestionsLoading: false,
196 provenance: snapshot.provenanceBySection[.availability],
197 confidence: snapshot.availabilityConfidence,
198 snapshotNote: entry.note,
199 trackedDomain: trackedDomain,
200 workflows: viewModel.workflowsContaining(domain: entry.domain),
201 trackingLimitMessage: nil,
202 onTrack: {
203 _ = viewModel.trackDomain(domain: entry.domain, availabilityStatus: entry.availabilityResult?.status)
204 },
205 onTogglePinned: {
206 guard let trackedDomain else { return }
207 viewModel.togglePinned(for: trackedDomain)
208 },
209 onEditNote: nil,
210 onAddToWorkflow: nil,
211 onOpenWorkflow: nil,
212 onRunWorkflow: nil
213 )
214 .padding(.top, appDensity.metrics.sectionSpacing)
215 OwnershipSectionView(
216 isCollapsed: .constant(false),
217 rows: DomainViewModel.ownershipRows(from: snapshot),
218 loading: false,
219 error: snapshot.ownershipError,
220 provenance: snapshot.provenanceBySection[.ownership],
221 confidence: snapshot.ownershipConfidence
222 )
223 .padding(.top, appDensity.metrics.sectionSpacing)
224 SubdomainsSectionView(
225 isCollapsed: .constant(false),
226 rows: DomainViewModel.subdomainRows(from: snapshot),
227 groups: report.subdomainGroups,
228 loading: false,
229 error: snapshot.subdomainsError,
230 provenance: snapshot.provenanceBySection[.subdomains],
231 confidence: snapshot.subdomainConfidence,
232 showsExtendedPlaceholder: !FeatureAccessService.hasAccess(to: .extendedSubdomains)
233 )
234 .padding(.top, appDensity.metrics.sectionSpacing)
174 List {
175 Section {
176 snapshotBanner
177 }
178 Section {
179 SummaryView(fields: DomainViewModel.summaryFields(from: snapshot))
180 }
181 Section {
182 RiskSummaryCardView(report: report)
183 }
184 Section {
185 InsightsSummaryCardView(insights: report.insights)
186 }
187 Section {
188 IntelligenceSectionView(
189 isCollapsed: .constant(false),
190 report: report,
191 showsPlaceholder: !FeatureAccessService.hasAccess(to: .intelligenceDetail)
192 )
193 }
194 Section {
195 DomainSectionView(
196 isCollapsed: .constant(false),
197 rows: DomainViewModel.domainRows(from: snapshot),
198 suggestions: DomainViewModel.suggestionRows(from: snapshot),
199 showSuggestions: entry.availabilityResult?.status == .registered && !entry.suggestions.isEmpty,
200 availabilityLoading: false,
201 suggestionsLoading: false,
202 provenance: snapshot.provenanceBySection[.availability],
203 confidence: snapshot.availabilityConfidence,
204 snapshotNote: entry.note,
205 trackedDomain: trackedDomain,
206 workflows: viewModel.workflowsContaining(domain: entry.domain),
207 trackingLimitMessage: nil,
208 onTrack: {
209 _ = viewModel.trackDomain(domain: entry.domain, availabilityStatus: entry.availabilityResult?.status)
210 },
211 onTogglePinned: {
212 guard let trackedDomain else { return }
213 viewModel.togglePinned(for: trackedDomain)
214 },
215 onEditNote: nil,
216 onAddToWorkflow: nil,
217 onOpenWorkflow: nil,
218 onRunWorkflow: nil
219 )
220 }
221 Section {
222 OwnershipSectionView(
223 isCollapsed: .constant(false),
224 rows: DomainViewModel.ownershipRows(from: snapshot),
225 loading: false,
226 error: snapshot.ownershipError,
227 provenance: snapshot.provenanceBySection[.ownership],
228 confidence: snapshot.ownershipConfidence
229 )
230 }
231 Section {
232 SubdomainsSectionView(
233 isCollapsed: .constant(false),
234 rows: DomainViewModel.subdomainRows(from: snapshot),
235 groups: report.subdomainGroups,
236 loading: false,
237 error: snapshot.subdomainsError,
238 provenance: snapshot.provenanceBySection[.subdomains],
239 confidence: snapshot.subdomainConfidence,
240 showsExtendedPlaceholder: !FeatureAccessService.hasAccess(to: .extendedSubdomains)
241 )
242 }
235243 if let comparisonSnapshot = viewModel.comparisonSnapshot(for: entry) {
236244 if let changeSummary = entry.changeSummary {
237 DomainChangeSummaryView(summary: changeSummary)
238 .padding(.top, appDensity.metrics.sectionSpacing)
245 Section {
246 DomainChangeSummaryView(summary: changeSummary)
247 }
239248 }
240 DomainDiffView(
241 title: "Compared With Previous Snapshot",
242 sections: DomainDiffService.diff(from: comparisonSnapshot, to: snapshot),
243 contextNote: DomainDiffService.comparisonContextNote(from: comparisonSnapshot, to: snapshot),
244 showsUnchanged: false,
245 highlightedSectionID: nil
249 Section {
250 DomainDiffView(
251 title: "Compared With Previous Snapshot",
252 sections: DomainDiffService.diff(from: comparisonSnapshot, to: snapshot),
253 contextNote: DomainDiffService.comparisonContextNote(from: comparisonSnapshot, to: snapshot),
254 showsUnchanged: false,
255 highlightedSectionID: nil
256 )
257 }
258 }
259 Section {
260 DNSSectionView(
261 isCollapsed: .constant(false),
262 dnssecLabel: DomainViewModel.dnssecLabel(from: snapshot),
263 patternSummary: report.dns.patternSummary,
264 sections: DomainViewModel.dnsRows(from: snapshot),
265 ptrMessage: DomainViewModel.ptrMessage(from: snapshot),
266 loading: false,
267 dnsProvenance: snapshot.provenanceBySection[.dns],
268 ptrProvenance: snapshot.provenanceBySection[.ptr],
269 sectionError: snapshot.dnsError
270 )
271 }
272 Section {
273 WebSectionView(
274 isCollapsed: .constant(false),
275 data: DomainViewModel.webSectionData(from: snapshot, report: report)
276 )
277 }
278 Section {
279 EmailSectionView(
280 isCollapsed: .constant(false),
281 rows: DomainViewModel.emailRows(from: snapshot),
282 assessment: report.email,
283 loading: false,
284 provenance: snapshot.provenanceBySection[.emailSecurity],
285 confidence: snapshot.emailSecurityConfidence,
286 error: snapshot.emailSecurityError
287 )
288 }
289 Section {
290 NetworkSectionView(
291 isCollapsed: .constant(false),
292 customPortsExpanded: .constant(false),
293 customPortInput: .constant(""),
294 data: DomainViewModel.networkSectionData(from: snapshot),
295 onScanCustomPorts: { /* Historical snapshot; re-scanning is not offered here. */ }
246296 )
247 .padding(.top, appDensity.metrics.sectionSpacing)
248297 }
249 DNSSectionView(
250 isCollapsed: .constant(false),
251 dnssecLabel: DomainViewModel.dnssecLabel(from: snapshot),
252 patternSummary: report.dns.patternSummary,
253 sections: DomainViewModel.dnsRows(from: snapshot),
254 ptrMessage: DomainViewModel.ptrMessage(from: snapshot),
255 loading: false,
256 dnsProvenance: snapshot.provenanceBySection[.dns],
257 ptrProvenance: snapshot.provenanceBySection[.ptr],
258 sectionError: snapshot.dnsError
259 )
260 .padding(.top, appDensity.metrics.sectionSpacing)
261 WebSectionView(
262 isCollapsed: .constant(false),
263 data: DomainViewModel.webSectionData(from: snapshot, report: report)
264 )
265 .padding(.top, appDensity.metrics.sectionSpacing)
266 EmailSectionView(
267 isCollapsed: .constant(false),
268 rows: DomainViewModel.emailRows(from: snapshot),
269 assessment: report.email,
270 loading: false,
271 provenance: snapshot.provenanceBySection[.emailSecurity],
272 confidence: snapshot.emailSecurityConfidence,
273 error: snapshot.emailSecurityError
274 )
275 .padding(.top, appDensity.metrics.sectionSpacing)
276 NetworkSectionView(
277 isCollapsed: .constant(false),
278 customPortsExpanded: .constant(false),
279 customPortInput: .constant(""),
280 data: DomainViewModel.networkSectionData(from: snapshot),
281 onScanCustomPorts: { /* Historical snapshot; re-scanning is not offered here. */ }
282 )
283 .padding(.top, appDensity.metrics.sectionSpacing)
284 }
285 .padding(.horizontal)
286 .padding(.bottom, 32)
287298 }
299 .listRowBackground(Color(.appSurface))
300 .environment(\.cardProvidesSurface, false)
301 .scrollContentBackground(.hidden)
288302 .background(Color(.appBackground))
289303 .navigationTitle(entry.domain)
290304 .toolbar {
DomainDig/ResultPrimitives.swift +27 −3
@@ -36,6 +36,25 @@ struct SectionTitleView: View {
3636 }
3737}
3838
39/// Whether a `CardView` draws its own surface, or whether whatever contains it
40/// already provides one.
41///
42/// Set to `false` by the screens that put cards in `List` rows, where the row's
43/// `.listRowBackground` is the surface and a card drawing its own would be a
44/// panel inside a panel. `CardView` sets it back to `true` for its content, so
45/// only the outermost card in a row gives up its chrome and a card nested
46/// inside one keeps it.
47private struct CardProvidesSurfaceKey: EnvironmentKey {
48 static let defaultValue = true
49}
50
51extension EnvironmentValues {
52 var cardProvidesSurface: Bool {
53 get { self[CardProvidesSurfaceKey.self] }
54 set { self[CardProvidesSurfaceKey.self] = newValue }
55 }
56}
57
3958/// A card that wraps its content by default.
4059///
4160/// `allowsHorizontalScroll` used to default to `true`, so nine call sites put
@@ -50,6 +69,7 @@ struct SectionTitleView: View {
5069struct CardView<Content: View>: View {
5170 @Environment(\.appDensity) private var appDensity
5271 @Environment(\.dynamicTypeSize) private var dynamicTypeSize
72 @Environment(\.cardProvidesSurface) private var providesSurface
5373 let allowsHorizontalScroll: Bool
5474 let content: Content
5575
@@ -72,15 +92,19 @@ struct CardView<Content: View>: View {
7292 }
7393 }
7494 .frame(maxWidth: .infinity, alignment: .leading)
75 .padding(appDensity.metrics.cardPadding)
76 .background(Color(.appSurface))
77 .clipShape(RoundedRectangle(cornerRadius: appDensity.metrics.cardCornerRadius))
95 .padding(providesSurface ? appDensity.metrics.cardPadding : 0)
96 .background(providesSurface ? Color(.appSurface) : Color.clear)
97 .clipShape(
98 RoundedRectangle(cornerRadius: providesSurface ? appDensity.metrics.cardCornerRadius : 0)
99 )
78100 }
79101
80102 private var cardContent: some View {
81103 VStack(alignment: .leading, spacing: appDensity.metrics.cardSpacing) {
82104 content
83105 }
106 // Only the outermost card in a row gives up its surface.
107 .environment(\.cardProvidesSurface, true)
84108 }
85109}
86110