You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(bitmap 3D PFP): nipplejs 1.x listener signature — the REAL mobile bug
The previous commit fixed the DOM-mount bug that made the touch UI
invisible on mobile. With the UI visible, the user reported they STILL
couldn't move. Root cause turned out to be a second latent bug:
nipplejs 1.0 (released some time before our 1.0.4) changed the listener
shape from the v0.x `(evt, data) => …` to `(evt) => …` where
`evt = { type, target, data }`. Our renderer was using the old shape:
moveStick.on('move', (_e, d) => {
joy.right = Math.round(d.vector.x * 30) / 30; // d is undefined → throws
joy.fwd = Math.round(d.vector.y * 30) / 30;
});
`d` is undefined under the new signature, so `d.vector.x` threw on every
move event. The throw bubbled up inside nipplejs's trigger loop and was
swallowed by the DOM event dispatcher — silent. Result: joy.fwd /
joy.right NEVER changed, the player couldn't walk no matter how the
user moved the stick. Desktop never noticed because the touch UI is
hidden on desktop (no kbm fallback hits this handler). Mobile users
ate the entire bug — touch UI present (after the previous fix), but
inert.
Switched both moveStick and lookStick handlers to the new
`(evt) => evt.data.vector` shape with a defensive nullish check.
Confirmed with the previously-fixme'd Playwright drag test: it now
PASSES — synthetic PointerEvents on the joystick zone drive joy.fwd to
1.0 (max forward deflection). The whole detour through Event.isTrusted
/ CDP-touch / known-Playwright-limitations was a red herring; the
events were reaching nipplejs fine the whole time. Our handler was
crashing.
14 of 14 mobile tests now green (was 13/14 with fixme).
Diagnostic getters joyMoves + joyInit removed (no longer needed; the
real test asserts joy.fwd > 0 directly).
Copy file name to clipboardExpand all lines: frontend/src/app/components/_ordpool/digital-artifact-viewer/bitmap-viewer/bitmap-3d-renderer.component.ts
0 commit comments