Skip to content

Viewer smoothness batch + small fixes - #77

Merged
ljchang merged 9 commits into
mainfrom
feat/viewer-smoothness-batch
Jul 2, 2026
Merged

Viewer smoothness batch + small fixes#77
ljchang merged 9 commits into
mainfrom
feat/viewer-smoothness-batch

Conversation

@ljchang

@ljchang ljchang commented Jul 2, 2026

Copy link
Copy Markdown
Member

Summary

Six tasks from the review backlog, each individually reviewed, plus a final whole-branch review whose one integration finding is fixed in the last commit.

Viewer smoothness

  • Smooth playback overlay: frame advance now driven by requestVideoFrameCallback while playing (was throttled timeupdate at ~4 Hz) — measured 19 distinct overlay frames per 2 s of playback vs ~8 before
  • O(1) frame lookups: fex rows and identity assignments indexed by frame once per session (was an O(N) filter over ~1,500-key rows on every frame tick); drag-seeks in the scrub bar and timeseries plot coalesced to animation frames
  • Race-free session switching: token-guarded selectSession — rapid A→B clicks can no longer leave A's data under B's id; the big CSV/frame-times fetches start in parallel with the metadata round-trips; loading indicator; failed loads are caught; stale overlay data cleared eagerly so old-session landmarks never render over the new video
  • Letterbox-correct face clicks: hit-testing now maps through the aspect-locked box the video/overlay actually fill (was the outer stage — wrong scale AND offset when letterboxed)
  • User seeks pause playback (scrub drag, plot click, annotation click) — resolves the final review's finding that the new 60 Hz frame advance and 60 Hz coalesced drag-seeks fought over the playhead

Features & fixes

  • "Open in Viewer" works: Analyze's button (previously silently dropped) and a new "Recording saved — Open in Viewer" toast in Live both thread the session id into the Viewer's initial selection
  • MeshCanvas / emoji buttons → lucide icons (repo icon rule)
  • Live frame cache 40 → 16 bitmaps (~150 MB → ~60 MB worst case, still 2× the documented latency headroom)
  • Recorder no longer KeyErrors writing metadata for a bare RecorderConfig (capabilities omitted instead)
  • api.ts health type gains the app identity field; splash "not responding after 30s" hint reworded for first-run cold imports; session-id extraction is path-separator-safe

Test plan

  • Full pytest suite: 220 passed (1 new TDD test for the recorder guard)
  • pnpm check (only the pre-existing vendor/ogl.js declaration error) + pnpm build
  • Browser-driven checks per task against the live sidecar: playback frame-rate measurement, keyboard/scrub sanity, rapid session-switch race test, center-click assign dialog, mid-playback seek pauses, tab cycling with zero console errors

@ljchang
ljchang merged commit 723a5f1 into main Jul 2, 2026
2 checks passed
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