Elastic peel-away swipe list

I wanted to see if a scrollable inbox inside one ElementGL WebGL 2 canvas could arbitrate vertical touch pans against horizontal row swipes, while curling or rubber-banding the live HTML rows over Archive and Delete strips and spring-collapsing the list. Scroll the feed up and down, tap any Star or checkbox, or swipe a row left or right.

Inbox 6 of 6 remaining Archived 0 · Deleted 0
Swipe right: Archive Swipe left: Delete
Paul Kinlan
Android 159 peel gesture trace
Check lock angle at 14 px horizontal delta on Pixel.
Ada Rivera
WebGL texture budget on mobile
Keep backing store under 4 MP and release retired slots.
Jonah Meyer
Spring collapse timing curve
Stiffness 260 with damping 26 settles cleanly in 280 ms.
Elena Lin
Touch-action pan-y notes
Vertical pan yields cleanly past the 8 px deadzone.
Samira Khan
Hit-test cache invalidation
Flip dataset.hitTick only when a row slot moves.
Theo Ross
Context-loss recovery test
Move live rows into plain HTML if the GPU drops.
Drag any row sideways to peel or stretch past 42%, or drag vertically to scroll.
Show the code touch arbitration, 28x10 peel and taffy shaders, springs, geometry sync
  1. Six live inbox rows inside one drawable canvas. Each row is a direct drawable child inside a sticky WebGL canvas over an overflow-y: auto scroll track.
  2. Angle-locked touch arbitration. An 8 px deadzone separates taps on Star or checkbox controls from directional locks: |dx| > 8 and |dx| > |dy| * 1.4 locks horizontal peel, while |dy| > 8 yields to vertical scroll.
  3. 28 by 10 Sticker Peel and Elastic Taffy shaders. Sticker Peel curls the row round a rolling cylinder and shades gl_FrontFacing vs the matte underside with a lit specular crease over procedural SDF Archive and Delete strips; Elastic Taffy stretches the leading edge ahead of the trailing anchor with Poisson necking.
  4. 240 Hz sub-stepped spring collapse. Releasing past 42% flings the row away and spring-collapses lower rows upward, or settles immediately under prefers-reduced-motion: reduce.
  5. Hit-box tracking with updateElementGeometry(). Each visible row's matrix scales by geometryUnit() and toggles dataset.hitTick only when its quantized slot or inert flag changes.
  6. Single ElementGL pass and 2D 5-argument fallback. Uploads dirty rows via texElementSubImage2D() and drops to 5-argument drawElementImage() or plain HTML if WebGL is missing or lost.

How it works

Six live HTML inbox rows sit directly inside one <canvas content="drawable" layoutsubtree> backed by a single ElementGL WebGL 2 context from /lib/element-gl.js. Rather than growing the canvas to the full list height (which risks crossing 4 megapixels on a phone), the canvas uses position: sticky; top: 0 at 388 CSS pixels tall (368 px below 520 px wide) inside an overflow-y: auto feed track. That keeps the GPU backing store around 1 megapixel at 412 px wide and 2.625 DPR while native wheel, scrollbar and touch-action: pan-y momentum scroll keep working.

When your finger or pointer moves past an 8 px deadzone, decideLock() compares horizontal and vertical travel. If |dx| > 8 and |dx| > |dy| * 1.4, horizontal peel locks, setPointerCapture() holds the pointer, and a non-passive touchmove guard prevents vertical drift from stealing the swipe. Otherwise, |dy| > 8 yields to native vertical scrolling without bending the row. Short taps inside the 8 px deadzone pass straight through to the row's Star button or checkbox.

In Sticker Peel mode, a 28 by 10 triangle mesh wraps the peeled edge round a 3D cylinder whose axis tilts slightly with vertical grab position. Reversed column draw order (Painter's sorting) renders the flat adhesive face first and the lifted curl on top, using gl_FrontFacing to paint the live HTML card on the front and a matte paper underside with a lit specular crease on the back. In Elastic Taffy mode, the leading edge pulls ahead of a lagging trailing anchor while the row waist narrows via Poisson necking until it pops at the 42% commit threshold.

Releasing past 42% (or pressing "Swipe row #2 demo") completes the swipe, spring-collapses the row slot upward via 240 Hz symplectic springs, detaches the committed row, and calls stage.forget(el) to delete its GPU texture without leaks. "Undo last" re-inserts the exact DOM node (preserving its starred or checked state) so the next paint event re-uploads it via texElementSubImage2D(). If WebGL 2 isn't available, the page falls back to 5-argument drawElementImage(), and on context loss or missing HTML-in-canvas it moves all live rows into plain HTML.

Live checks

Each check builds an isolated fixture on testStage() and waits for a tap so opening the page doesn't open extra WebGL contexts or steal focus.

StatusCheckDetail

Findings