From 349bec0e99f330fc1172ca9847c58f019e861f61 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Mon, 20 Jul 2026 18:29:18 -0500 Subject: fix(a11y): suppress disabled-control contrast findings on the rule MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WCAG 1.4.3 exempts inactive components from contrast requirements, so Inspect's Run button — disabled until a domain is typed — was reporting a contrast failure that was never a real defect. The first attempt typed a domain to enable the button. That worked for the single-screen test but raised the keyboard, which then followed the audit onto every later screen in the Dynamic Type sweep and reported nine phantom hit-region findings per screen against the system emoji picker's category buttons. Suppressing on the rule instead — drop contrast findings whose element reports isEnabled == false — fixes it everywhere with no UI manipulation. Also documents that simulator keyboard state persists across runs, so a dirty simulator inflates the burndown with system-UI findings. Erase and re-run before believing anything that names system UI. --- DomainDigUITests/AccessibilityAuditHarness.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'DomainDigUITests/AccessibilityAuditHarness.swift') diff --git a/DomainDigUITests/AccessibilityAuditHarness.swift b/DomainDigUITests/AccessibilityAuditHarness.swift index ca4d12b..08ddedd 100644 --- a/DomainDigUITests/AccessibilityAuditHarness.swift +++ b/DomainDigUITests/AccessibilityAuditHarness.swift @@ -85,6 +85,18 @@ enum AccessibilityAuditHarness { timeout = nil do { try app.performAccessibilityAudit { issue in + // WCAG 1.4.3 exempts inactive components from contrast + // requirements, but the audit flags them anyway. Inspect's + // Run button is disabled until a domain is typed, so the + // empty state reported a contrast failure that was never a + // real defect. Suppressing on the rule beats driving the UI + // to enable the control: typing raises the keyboard, which + // then follows the audit onto later screens and flags the + // system emoji picker's category buttons. + if issue.auditType.contains(.contrast), issue.element?.isEnabled == false { + return true + } + let isEnforced = !enforcedAuditTypes.intersection(issue.auditType).isEmpty let marker = isEnforced ? "FAIL" : "report" // Include the element so the burndown says *what* to fix, not -- cgit v1.2.3