Skip to content

fix(a11y): bring every pointer target up to the 24px floor - #712

Merged
EVWorth merged 1 commit into
mainfrom
fix/hit-targets
Sep 17, 2026
Merged

EVWorth merged 1 commit into
mainfrom
fix/hit-targets

Conversation

@EVWorth

@EVWorth EVWorth commented Sep 17, 2026

Copy link
Copy Markdown
Owner

Wave 3 of the UI review.
Closes #705.

13 of 38 interactive controls were below 24×24 (WCAG 2.2 SC 2.5.8).
Re-measured in the running app: 0 of 36.

Five groups, five different answers

what was fix
Toolbar buttons (Admin/Import/Backup/Restore/Theme) 20px tall min-h-6 — the bar is 36px, padding would distort the row
Status-bar controls 15px in a 24px row explicit minimum (see below)
Query-toolbar icon buttons, row-limit input 20–22px box raised; icons stay 12px
Explain-mode chevron 21px wide min-w-6
Two splitters 4px grab area widened, line unchanged

h-full on the status bar silently did nothing. The row centres its
children, so a percentage height has nothing to resolve against. It looked
like a fix and changed no pixels. An explicit minimum doesn't care about the
parent.

The splitters keep their 4px line — the width is part of the layout, and a
24px divider is a different design. An invisible overlay widens the grab area
instead.

They needed a second pass: the widened area worked to the left and not the
right, because the adjacent panel painted over it. z-10 fixes it. Worth
recording how that surfaced — measuring the CSS offsets said both sides
were fine. Only hit-testing with elementFromPoint showed the truth, and
that's the measurement behind both the before and after numbers.

No regression guard ships with this, deliberately

Three attempts, all instructive:

  1. A sweep in AppLayout.browser.test.tsx measured zero elements — that
    file mocks every child to a stub. It passed by finding nothing, which is
    the exact failure mode I've been adding count assertions elsewhere to
    prevent, and I walked into it anyway.
  2. Moved to TitleBar.browser.test.tsx, it found the right eight controls —
    and measured them at 33px tall. A component rendered standalone isn't
    under the layout constraints that made them 20px in the app.
  3. So a guard here can't reproduce the geometry it's meant to defend, and one
    that passes regardless is worse than none.

Filed separately. The fixes are verified against the real app; what's missing
is something to stop them regressing, and I'd rather say so than ship a green
tick that means nothing.

Verification

  • 2,931 unit tests, 340 browser tests, lint, dprint, tsc pass
  • Real-app hit-test sweep: 36 controls measured, 0 under 24×24
  • Splitter grab extents measured at 25px (vertical) and 24px (horizontal)

🤖 Generated with Claude Code

Thirteen of thirty-eight interactive controls were below 24×24 (WCAG 2.2
SC 2.5.8). Re-measured in the running app afterwards: none are.

Five groups, each needing a different answer:

- Toolbar buttons along the title bar were 20px tall. `min-h-6` rather than
  more padding — the bar is only 36px, and padding would have pushed the row
  out of shape.
- Status-bar controls were 15px inside a 24px row. `h-full` was the obvious
  fix and silently did nothing: the row centres its children, so a percentage
  height has nothing to resolve against. An explicit minimum does not care.
- The query toolbar's icon buttons and the row-limit input were 20–22px. The
  icons are fine at 12px; it was the box around them that was short.
- The explain-mode chevron was 21px wide, being half of a segmented control.
- The two splitters are 4px, and should stay 4px: their width is part of the
  layout, and a 24px divider is a different design. The grab area around them
  is widened instead, with an invisible overlay.

The splitters needed a second pass. The widened area worked to the left and
not to the right, because the adjacent panel painted over it — `z-10` fixes
that. Worth recording how it was found: measuring the CSS offsets said both
sides were fine. Only hit-testing with elementFromPoint showed the truth, and
the same measurement is what confirms 0 of 36 now.

No regression guard ships with this, deliberately. Three attempts at one all
failed, in instructive ways: a sweep in AppLayout's browser test measured
nothing at all, because that file mocks every child to a stub — it passed by
finding zero elements, which is the exact failure mode this project has been
adding count assertions to prevent. Moving it to TitleBar's browser test found
the right eight controls but measured them at 33px tall, because a component
rendered standalone is not under the layout constraints that made them 20px in
the app. A guard that cannot reproduce the geometry cannot defend it, and a
guard that passes regardless is worse than none. Followed up separately.

Closes #705.
@EVWorth
EVWorth merged commit 98113a8 into main Sep 17, 2026
12 checks passed
@EVWorth
EVWorth deleted the fix/hit-targets branch September 17, 2026 18:32
EVWorth added a commit that referenced this pull request Sep 18, 2026
…t targets (#716)

#713 said a pointer-target guard could not be built here, after three attempts
failed. The reason turned out to be one line: `test-setup.ts` never imported
`globals.css`, so every browser test has been rendering unstyled markup.

`text-xs` computed to 16px. `h-9` computed to zero. `px-2` to zero. That is why
the earlier sweep measured the title bar's buttons at 33px tall while they were
20px in the app — it was measuring browser defaults, and no assertion about
size, spacing or colour made in that suite could have meant anything.

Two further things had to be true before the guard was worth writing:

- The viewport was 414×896, a phone, for a desktop app. It put the window
  controls at x=430, off the right edge, where `elementFromPoint` cannot reach
  them — they measured as -1×-1. Now 1280×800.
- The sweep reports how many controls it swept and fails if that is too few. An
  earlier version of this test lived in AppLayout's browser test, where every
  child is mocked to a stub; it measured nothing, found nothing, and passed.
  That is the failure mode this project keeps meeting, and the count assertion
  is the only thing that catches it.

With those fixed, the guard works. Reverting the `min-h-6` from #712 now fails
it with the real numbers:

    Admin Tools is 49×21
    Import Data is 49×21
    Theme: Dark — click for Light is 30×19

Hit-testing rather than reading the box, because a control can be larger than
it looks — the splitters keep a 4px line and widen only the area around them,
and reading CSS offsets reports a widened area as passing even when a
neighbour paints over it.

All 341 browser tests still pass with the stylesheet loaded, so nothing was
depending on the absence of styles. jsdom ignores the import, so the unit suite
is untouched.

Closes #713.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P2][a11y] 13 of 37 interactive targets are under the 24×24 minimum

1 participant