diff options
| author | Adam Soltys <[email protected]> | 2026-09-02 12:11:12 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-09-02 12:11:12 -0700 |
| commit | 92594d6b1290c4985c33276cf5203ace2c5d6c61 (patch) | |
| tree | 095339bb56f056e70d5c9f49d214c06f4c5d7ceb /src/app.js | |
| parent | d991ec192c5b6b00e1ce75aa5717fd85390aa39e (diff) | |
| download | coinosv3-92594d6b1290c4985c33276cf5203ace2c5d6c61.tar.gz coinosv3-92594d6b1290c4985c33276cf5203ace2c5d6c61.zip | |
Tabs answer the finger, not the click: switching happens on pointerdown (the click event lands 100-250ms after the touch, and a tab has no scroll ambiguity to wait out — keyboard activation keeps the click path), every button takes touch-action:manipulation so double-tap-zoom arbitration stops taxing quick taps, and the sliding pane pre-promotes to its own compositor layer — a slow mid-slide re-render was letting Chrome expose unpainted gray tiles at the viewport edges
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MrkLsNScXe9b6BviUSdmMr
Diffstat (limited to 'src/app.js')
| -rw-r--r-- | src/app.js | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -809,7 +809,22 @@ function linkify(text) { } function tabBtn(label, active, onClick) { - return h('button', { class: active ? 'active' : '', onClick }, label); + // Act on POINTERDOWN, not click: on a phone the click event lands + // 100–250ms after the finger does, and a tab switch has no scroll or + // long-press ambiguity to wait out — native segmented controls switch on + // touch-down for exactly this reason. The click handler stays for + // keyboard/AT activation; re-selecting the current tab is a no-op, so the + // pair firing together costs nothing. + let downAt = 0; + return h('button', { + class: active ? 'active' : '', + onPointerdown: (e) => { + if (e.button !== 0) return; + downAt = performance.now(); + onClick(); + }, + onClick: () => { if (performance.now() - downAt > 500) onClick(); }, + }, label); } function createPane() { |
