mirror of
https://github.com/rommapp/romm.git
synced 2026-12-06 15:54:45 +01:00
* Use VueUse for v2's rAF loops, listener pairs and grid observers Hand-managed requestAnimationFrame loops in useGamepad, usePlaybackTime, useRightStickScroll, ControllerDebug and RBox3D move to useRafFn, and the listener pairs and MutationObservers in useGridNav, useWrapGridNav, RBox3D and useGamepad's connect listener move to useEventListener and useMutationObserver. Each stops with its scope, so the matching cancel, remove and disconnect calls in unmount hooks go. The grid composables still register from onMounted, keeping listener order unchanged. ControllerDebug pauses its loop before leaving on hold-B. RBox3D's root listeners now bind once its template ref settles, a microtask after mount, instead of synchronously in onMounted. Adds tests for usePlaybackTime, useRightStickScroll, ControllerDebug and RBox3D, the late-cell autofocus of both grid composables, and useGamepad's unmount. They also pass against the previous versions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Keep ControllerDebug polling past a back that goes nowhere Hold-to-exit paused the frame loop before calling router.back(), so in a tab opened straight onto /controller-debug the back did nothing and the inspector froze. The loop now keeps running and fires once per hold, and with no history entry to return to it goes home instead. The useGamepad, useRightStickScroll and ControllerDebug tests build pads from a shared, fully typed gamepad fixture rather than casting partial objects to Gamepad. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>