Skip to content

Fix: make implicit viewer state explicit and repair its transition races - #66

Merged
marcelduin merged 11 commits into
mainfrom
fixes/implicit-state-machines
Nov 9, 2026
Merged

marcelduin merged 11 commits into
mainfrom
fixes/implicit-state-machines

Conversation

@marcelduin

Copy link
Copy Markdown
Member

This branch fixes the implicit state-machine hazards found in the viewer audit without introducing a reducer/FSM framework. Each subsystem now has one owner/reset path for the state it mirrors.

Main fixes

  • Media/tours: consistent play, pause, seek and end reporting across native, HLS and iframe players; replay no longer leaves stale ended/seeking state; serial steps invalidate superseded opens, report user pause, and report a new end after a jump restart.
  • Markers: cancellable return-view timers, one close path, re-armed popup advance latch.
  • Grid/book/camera: recorded transition z-tiers, stale fade cancellation, drag cancellation before navigation, superseded goto() waiters settle, paused animations abort.
  • UI/gallery: scrubber rect freshness, omni origin loss, strip teardown, mobile sheet reset, second dial pointercancel.
  • Render/core: retryable setup, switch/error reset, named tile phases, watermark replacement, released canvas video listeners.

Verification
typecheck, lint, 334 core tests, and 751 targeted browser tests across 37 files all pass. The existing dev.html modification is not included.

Route native, adapter, HLS and standalone playback through one report/reset path; emit adapter transport events; clear seeking/ended state on pause and replay.
Remove the dead startAt branch and reset a destroyed instance completely.
Invalidate suspended step opens, reset end reporting on a jump restart, report user pause, and stop a replaced tour.
Apply per-image volume, dedupe the unlock probe, retry the playlist on gesture, resume hidden GL videos, clear stale cues, and re-init fullscreen on a target change.
One close path, a cancellable return timer, a re-armed popup latch, and no redundant menu hook flag.
Retry rejected setup, clear switching/error, name tile phases, replace watermarks, and release removed canvas video listeners.
Stop a paused Ani before replacing it, cancel kinetic on a click, and let a wheel tick ignore an active drag/pinch.
Release a dragged page before navigation, resolve old goto waiters immediately, and stop a solver-less frame loop once idle.
Record behind-delayed z tiers, guard delayed fades by set id, respect hidden layouts, hook serial events before the first set, and resume cameras on teardown.
Measure the scrubber fresh, end omni gestures when their origin lifts, own strip flags, reset the mobile sheet, and keep the dial cancel guard.
@marcelduin
marcelduin added this pull request to stack #68 November 9, 2026 03:00
@marcelduin
marcelduin merged commit 6fe4969 into main Nov 9, 2026
4 of 5 checks passed
@marcelduin
marcelduin deleted the fixes/implicit-state-machines branch November 9, 2026 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant