diff options
| author | Christian Cleberg <[email protected]> | 2026-07-20 21:49:57 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-07-20 21:57:22 -0500 |
| commit | e2da09fec3d3d52ac6108b9256b2419405f76dd3 (patch) | |
| tree | f94c68534b3f8823f1c07c831bbd8be2873b4807 /DomainDig/ContentView.swift | |
| parent | 1c2830fbfc8cccfc0c585ec2356467bb95bc1642 (diff) | |
| download | domain-dig-e2da09fec3d3d52ac6108b9256b2419405f76dd3.tar.gz domain-dig-e2da09fec3d3d52ac6108b9256b2419405f76dd3.tar.bz2 domain-dig-e2da09fec3d3d52ac6108b9256b2419405f76dd3.zip | |
feat(a11y): Dynamic Type reflow and tap targets (#21 phase 3)
Takes the audit from 18 findings to 11 in dark mode. Everything that
remains is system-rendered or placeholder noise, characterised below.
The largest win was not where the plan expected. Every empty-state
heading reported as clipped text, and the cause was `Label`: it
constrains its own title, and `.fixedSize` applied to the Label does not
reach the `Text` inside. Splitting into `HStack { Image; Text }` and
putting the modifier on the Text cleared all four empty states at both
default and accessibility sizes.
That fix then caused a regression the audit caught immediately. `Label`
folds its image into the title's accessibility element; an HStack does
not, so the icon began announcing its raw SF Symbol name
("checklist.unchecked") to VoiceOver. Decorative icons split out of a
Label now carry .accessibilityHidden(true).
Tap targets:
- AppCopyButton was a literal 30x30 on nearly every data row. Now
@ScaledMetric from 44, floored at AppLayout.minimumTapTarget —
@ScaledMetric scales down below the default text size as well as up,
so the floor is load-bearing.
- controlMinHeight was 42 in compact density, putting every collapsible
section header and both Run buttons under the minimum.
Reflow:
- CardView's allowsHorizontalScroll defaulted to true, so nine call sites
hid content behind a horizontal gesture instead of wrapping — a WCAG
1.4.10 failure and the mechanism behind clipped rows at large text
sizes. The default is now false, and the remaining opt-in is suppressed
at accessibility sizes.
- Fixed .system(size:) point sizes replaced with text styles in the app
and the widget.
- The widget is clamped at accessibility1, the one place clamping is
correct: a widget canvas is a fixed size and WidgetKit truncates
overflow with no scroll affordance.
Two hypotheses were tested and discarded rather than left in. Monospaced
fonts looked like the clipping culprit — the app is 82% monospaced and
hyphenates mid-word at accessibility sizes — but switching the empty
state to proportional changed nothing, and prose typography is a design
decision rather than an accessibility fix. Shortening search prompts and
the domain placeholder also changed nothing: placeholder text is reported
clipped regardless of length, so "Search" is flagged exactly as "Search
portfolio" was.
Not done: ViewThatFits reflow for BatchResultRowView and
WatchlistRowView. Those rows never render in the audit because the test
simulator has no tracked domains or batch results, so any change there
would be unverifiable. Absence of findings is absence of data.
Diffstat (limited to 'DomainDig/ContentView.swift')
| -rw-r--r-- | DomainDig/ContentView.swift | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/DomainDig/ContentView.swift b/DomainDig/ContentView.swift index f48e2a0..a4800ed 100644 --- a/DomainDig/ContentView.swift +++ b/DomainDig/ContentView.swift @@ -2418,19 +2418,31 @@ struct SectionTitleView: View { } } +/// A card that wraps its content by default. +/// +/// `allowsHorizontalScroll` used to default to `true`, so nine call sites put +/// their content behind a horizontal gesture instead of letting it wrap — a +/// WCAG 1.4.10 (Reflow) failure, and the mechanism behind clipped rows at large +/// text sizes. It also forced VoiceOver and Switch Control users onto a nested +/// scroll axis to reach data. +/// +/// The default is now `false`. Where horizontal scrolling genuinely suits wide +/// tabular content, it is still opt-in — but it is suppressed at accessibility +/// text sizes, where wrapping always beats a hidden axis. struct CardView<Content: View>: View { @Environment(\.appDensity) private var appDensity + @Environment(\.dynamicTypeSize) private var dynamicTypeSize let allowsHorizontalScroll: Bool let content: Content - init(allowsHorizontalScroll: Bool = true, @ViewBuilder content: () -> Content) { + init(allowsHorizontalScroll: Bool = false, @ViewBuilder content: () -> Content) { self.allowsHorizontalScroll = allowsHorizontalScroll self.content = content() } var body: some View { Group { - if allowsHorizontalScroll { + if allowsHorizontalScroll, !dynamicTypeSize.isAccessibilitySize { ScrollView(.horizontal) { cardContent .scrollTargetLayout() |
