Phase 2: Explore's latch, haptics, back button, label overflow

Four things reported on the device, all real.

Tapping a modifier did nothing. setLayer was only reachable from a
search result or the layer sheet, so the reference's latch was simply
never ported. It is now, with the semantics intact rather than reduced
to a toggle: hold to peek and it lifts away, tap to lock and it stays,
tap again to release, and reading a lit key while holding a modifier
spends that modifier so lifting drops it. Knobs and pads never latch,
which is what NOLATCH is for. held is now the source of truth and the
layer key is derived from it, as in the reference.

That needed per-control release events. Panel knew which control each
pointer held and threw it away; it now reports onRelease before the
gesture-wide callback, because the latch decides hold-versus-tap from
how long one key was down.

Haptics and the hardware back button were missing entirely - Phase 1 did
both in native.js and the port had no equivalent. native.ts adds them,
no-ops in a browser so the dev server is unaffected. Back owns the whole
stack: sheet, then Explore, then exit.

Grade haptics fire from the transition into answered, not from the four
dispatch sites. Grading happens in the reducer, so deciding correctness
again at each call site would be a second source of truth free to drift.

PINGPONG overflowed its key. Lit keys show the entry's short label, which
comes from the data and can be one unbreakable word; the soft hyphens
only cover printed labels. Keys now break anywhere and clip.

141 tests, typecheck clean, installed and running on the device.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-17 21:00:23 +03:00
parent 7ddaf3d949
commit b95cff1be1
4 changed files with 185 additions and 37 deletions

View File

@@ -45,7 +45,12 @@
padding: 2px 1px;
border-radius: 3px;
hyphens: manual;
overflow-wrap: break-word;
/* Lit keys show the entry's short label, which comes from the data and can be
one long unbreakable word — SHIFT + LOOP is PINGPONG. Soft hyphens only
cover the printed labels, so allow a break anywhere and clip what is left,
rather than letting it spill outside the key. */
overflow-wrap: anywhere;
overflow: hidden;
}
/* Lit is an outline, not a fill. The SHIFT layer lights 35 of 54 controls, and