Skip to content

Switch Time Travel comparisons in a single frame - #648

Merged
borismasis merged 1 commit into
mapillary:mainfrom
borismasis:time-travel-single-frame
Nov 2, 2026
Merged

borismasis merged 1 commit into
mapillary:mainfrom
borismasis:time-travel-single-frame

Conversation

@borismasis

Copy link
Copy Markdown
Member

Opening or changing a slider comparison could briefly show the original alone with the curtain hidden, the previous comparison at the next framing, a black frame, or a first frame with the default curtain while the next pair loaded.

Changes

  • SliderComponent.preload(ids) caches a pair, including image assets, without showing it, so a following configure with the same ids switches within one frame.
  • Pair options (viewAligned, mode, viewScale, viewCorrection, visibility) apply only once the state shows the configured pair; the shown pair keeps its own options while the next one loads.
  • A cached pair swaps before the next frame (new StateService.lastState$, the replayed latest frame).
  • The slider leaves traversal before changing the trajectory, and a newly activated slider applies its curtain together with its first GL update.
  • SliderGLRenderer.render clears before drawing, so it never composites over another background renderer still active in the same frame.
  • A disposed TextureProvider ignores late region-of-interest updates and tiles instead of throwing on its released renderer.

Testing

  • yarn lint, yarn build, yarn test (1,735 tests, 128 suites) pass locally.
  • New tests: SliderPreload, SliderPairConfiguration, SliderExclusiveBackground, TextureProviderDisposed; updated SliderSelectionFraming, SliderAutomaticMotion, SliderViewAligned.
  • Checked in a Time Travel app with per-frame canvas captures: one visual change per comparison switch and a single-step entry.

Opening or changing a slider comparison could show the original alone with
the curtain hidden, the previous comparison at the next framing, a black
frame or a first frame with the default curtain while the next pair loaded.

- SliderComponent.preload(ids) caches a pair, including image assets,
  without showing it, so a following configure with the same ids switches
  within one frame.
- Pair options (viewAligned, mode, viewScale, viewCorrection, visibility)
  apply only once the state shows the configured pair.
- A cached pair swaps before the next frame (StateService.lastState$).
- The slider leaves traversal before changing the trajectory, and a newly
  activated slider applies its curtain together with its first GL update.
- SliderGLRenderer clears before drawing, so it never composites over
  another background renderer active in the same frame.
- A disposed TextureProvider ignores late region-of-interest updates and
  tiles instead of throwing on its released renderer.

Regression tests: SliderPreload, SliderPairConfiguration,
SliderExclusiveBackground, TextureProviderDisposed and updated
SliderSelectionFraming, SliderAutomaticMotion and SliderViewAligned.
@meta-cla meta-cla Bot added the cla signed label Nov 2, 2026
@borismasis
borismasis merged commit 4352c53 into mapillary:main Nov 2, 2026
3 checks passed
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