From 7f917e98b929dcf0f7901d0bc4eb05e04db3aa0c Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Wed, 22 Jul 2026 00:47:12 -0500 Subject: feat(a11y): seeded audit fixtures; fix dense-row reflow they exposed (#21) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dense rows and portfolio sections never rendered in the audit — the test simulator has no tracked domains or batch results — so five phases of row treatment shipped unmeasured. Driving the add-domain UI was tried earlier and rejected (keyboard contamination, persistent state), so this adds DOMAIN_DIG_SEED_FIXTURES: DEBUG-only launch argument, same pattern as DOMAIN_DIG_FORCE_PRO_PLUS, seeding four tracked domains and four batch results chosen to exercise every badge path, including a failed lookup and a stress-length domain name. Fixtures are strictly in-memory. persistTrackedDomains, refreshWidgetData (App Group file), refreshPersistedData, and refreshMonitoringState are all guarded while fixtures are active — the last one mattered: it runs right after seeding in the app task and was reloading the empty disk over the fixtures, which initially made the seeded watchlist audit pass by silently auditing the empty state. Four new audit tests cover the seeded Dashboard, Tracked Domains, and batch results at default and AccessibilityXXXL. What they found was real. At XXXL the watchlist row rendered the domain as "hea lt…" while the Registered badge wrapped one character per line into a screen-height capsule. Fixes, verified by before/after screenshots and the XXXL audits dropping to 7-8 findings per screen: - AppStatusBadgeView gets .fixedSize() — a capsule badge must never letter-wrap; taking natural width instead forces the row layout to its stacked alternative. - WatchlistRowView, BatchResultRowView, and PortfolioExpiryRow headers use ViewThatFits: domain-beside-badge while it genuinely fits, badge below the domain at accessibility sizes. Domain titles get fixedSize(horizontal: false, vertical: true) so they wrap rather than report a single-line ideal width to ViewThatFits and truncate. - The watchlist monitoring metadata strip (three texts abreast) stacks vertically when it no longer fits instead of wrapping mid-word. Known and deliberate: the seeded default-size audits still report a contrast/dynamicType wave attributed to "unknown element". Bisecting the row and badge accessibility modifiers showed most of it is an audit artifact on children-ignored content (the same rows measure 6-7:1 and render correctly); the artifact classes get characterised suppressions when enforcement lands, not blanket ones. --- DomainDig/BatchResultsView.swift | 41 ++++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 10 deletions(-) (limited to 'DomainDig/BatchResultsView.swift') diff --git a/DomainDig/BatchResultsView.swift b/DomainDig/BatchResultsView.swift index aeae48f..1636a16 100644 --- a/DomainDig/BatchResultsView.swift +++ b/DomainDig/BatchResultsView.swift @@ -59,16 +59,22 @@ struct BatchResultRowView: View { var body: some View { VStack(alignment: .leading, spacing: appDensity.metrics.rowSpacing + 1) { - HStack(alignment: .firstTextBaseline, spacing: 8) { - Text(result.domain) - .font(appDensity.font(.callout)) - .foregroundStyle(.primary) - .lineLimit(1) - Spacer(minLength: 8) - Text(result.resultSource.label.lowercased()) - .font(appDensity.font(.caption2)) - .foregroundStyle(Color(.appTextSecondary)) - AppStatusBadgeView(model: quickStatusBadge) + // Same reflow as WatchlistRowView: wide while it fits, stacked at + // accessibility sizes so the badge cannot letter-wrap vertically. + ViewThatFits(in: .horizontal) { + HStack(alignment: .firstTextBaseline, spacing: 8) { + domainTitle + Spacer(minLength: 8) + sourceLabel + AppStatusBadgeView(model: quickStatusBadge) + } + VStack(alignment: .leading, spacing: 6) { + domainTitle + HStack(spacing: 8) { + AppStatusBadgeView(model: quickStatusBadge) + sourceLabel + } + } } HStack(spacing: 10) { @@ -133,6 +139,21 @@ struct BatchResultRowView: View { )) } + private var domainTitle: some View { + Text(result.domain) + .font(appDensity.font(.callout)) + .foregroundStyle(.primary) + .lineLimit(3) + .multilineTextAlignment(.leading) + .fixedSize(horizontal: false, vertical: true) + } + + private var sourceLabel: some View { + Text(result.resultSource.label.lowercased()) + .font(appDensity.font(.caption2)) + .foregroundStyle(Color(.appTextSecondary)) + } + private var changeContentLabel: String { result.changeClassification != nil ? "Impact" : "Status" } -- cgit v1.2.3