Skip to main content

max / balanced_breakfast

Ask what is pointing at the screen, not what hardware exists The byte-identical twin of goingson's touch detection, fixed in the same pass so the duplication does not outlive the bug. The sniff asked the hardware inventory, so a laptop with a touchscreen and a mouse came back touch; it now asks matchMedia with makeover-geometry's Density::Touch condition, the query the generated geometry.css already uses. No build-side guard here, unlike goingson: this build.rs has no check pass at all, and copying one in is the wrong shape when the checker belongs in makeover-build. Tracked there.
Co-Authored-By
Claude Opus 5 (1M context) <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-08-10 22:15 UTC
Signed with PGP, not checked
Commit: 04321714b43ba9ed30068b44f4cc42301e004761
Parent: df5e04c
1 file changed, +10 insertions, -1 deletion
@@ -9,7 +9,16 @@
9 9
10 10 // Touch Detection
11 11
12 - const isTouchDevice = ('ontouchstart' in window) || (navigator.maxTouchPoints > 0);
12 + // The density question, asked the way geometry.css asks it. This was a
13 + // capability sniff off the window and the navigator until 2026-08-10: it
14 + // asked what hardware exists rather than what is pointing at the screen,
15 + // so a laptop with a touchscreen and a mouse came back touch and lost its
16 + // hover affordances. The string is makeover_geometry::Density::Touch's own
17 + // media condition. Unlike goingson, nothing here fails the build if it
18 + // drifts -- BB's build.rs has no check pass yet.
19 + const TOUCH_DENSITY = '(hover: none), (pointer: coarse)';
20 +
21 + const isTouchDevice = window.matchMedia(TOUCH_DENSITY).matches;
13 22
14 23 // Long Press
15 24