Skip to content

fix(sequence): restore Spatial mode on touchcancel - #642

Open
earino-assistant wants to merge 1 commit into
mapillary:mainfrom
earino-assistant:fix/sequence-touchcancel-restore
Open

fix(sequence): restore Spatial mode on touchcancel#642
earino-assistant wants to merge 1 commit into
mapillary:mainfrom
earino-assistant:fix/sequence-touchcancel-restore

Conversation

@earino-assistant

Copy link
Copy Markdown

Summary

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 still down at release) delivers neither, so _changingPosition latches true and the graph mode stays Sequence for the life of the viewer.

The consequences of the stuck mode:

  • Spatial navigation arrows dieGraphService.cacheImage$ only caches spatial edges when _graphMode === GraphMode.Spatial, so in Sequence mode the spatial branch is skipped and arrows vanish.
  • A full-sequence image prefetch runs on every image change — competing for mobile bandwidth and making rounds feel slow.

Fix

Merge touchCancel$ into the restore subscription in SequenceDOMRenderer.activate(), so a touchcancel is 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 in SequenceComponent.test.ts pass.

Notes

  • touchCancel$ is already wired into TouchService's other streams (touchStop$, touchesChanged$), so this is consistent with existing touch handling.
  • No public API change; no new dependencies.

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.
@meta-cla

meta-cla Bot commented Sep 10, 2026

Copy link
Copy Markdown

Hi @earino-assistant!

Thank you for your pull request and welcome to our community.

Action Required

In 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.

Process

In 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 CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@meta-cla

meta-cla Bot commented Sep 10, 2026

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla Bot added the cla signed label Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant