fix(sequence): restore Spatial mode on touchcancel - #642
Conversation
The sequence scrubber's changing-position restore only listens for documentMouseUp and touchEnd with zero remaining touches. An Android touchcancel (gesture takeover, notification shade, second finger) delivers neither, so _changingPosition latches true and the graph mode stays Sequence for the life of the viewer — killing spatial navigation arrows and running a full-sequence prefetch on every image change. Merge touchCancel$ into the restore subscription so a touchcancel is treated like a terminal release and restores Spatial mode.
|
Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Summary
The sequence scrubber's changing-position restore only listens for
documentMouseUpandtouchEndwith zero remaining touches. An Androidtouchcancel(gesture takeover, notification shade, second finger still down at release) delivers neither, so_changingPositionlatchestrueand the graph mode staysSequencefor the life of the viewer.The consequences of the stuck mode:
GraphService.cacheImage$only caches spatial edges when_graphMode === GraphMode.Spatial, so in Sequence mode the spatial branch is skipped and arrows vanish.Fix
Merge
touchCancel$into the restore subscription inSequenceDOMRenderer.activate(), so atouchcancelis treated like a terminal zero-touch release and restores Spatial mode.TouchService.touchCancel$is already a public getter; this is a one-line addition to the existing merge.Test
Adds a regression test that simulates a scrubber drag (Sequence mode) followed by a
touchcancel, asserting the graph mode is restored to Spatial. All 20 tests inSequenceComponent.test.tspass.Notes
touchCancel$is already wired intoTouchService's other streams (touchStop$,touchesChanged$), so this is consistent with existing touch handling.