Skip to content

fix(preview): follow the slot's own frame, not the store-wide latest - #218

Merged
lstein merged 2 commits into
mainfrom
fix/preview-follow-slot-frame
Sep 6, 2026
Merged

fix(preview): follow the slot's own frame, not the store-wide latest#218
lstein merged 2 commits into
mainfrom
fix/preview-follow-slot-frame

Conversation

@lstein

@lstein lstein commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Found while testing #215 on a multi-GPU rig: a long video render plus a quick image batch, tab hidden for a minute while the batch finished, and on return the preview was blank while the gallery cell still showed the video's last step. Reloading restored it.

Cause. The single-frame preview read the store-wide "latest" progress frame and showed it only if its target matched the followed slot. While hidden, the batch kept stepping, so "latest" pointed at the batch. When the batch completed and its slot was released, the store set "latest" to null. The video slot's own frame was still stored per slot (that is what the gallery cell reads), but the preview saw null and rendered an empty card until the video's next step. The #215 snapshot could not help: the socket stayed up, so the snapshot's revision equalled the one already seen and was correctly dropped.

Fix.

  • LivePreview reads its followed slot's own frame via useQueueItemProgressImage(queueItemId, itemIndex); the store-wide matcher getMatchingProgressImage and the progressImage prop are removed.
  • progressImageStore keeps per-slot recency and, when the cleared slot was the latest, falls back to the most recently updated remaining slot instead of null, so the header's live-follow toggle and the editor's Current Image node do not blank either.

Independent of #215; applies on main. The same commit is cherry-picked onto #215's branch so the build under test has it.

Test plan

  • pnpm lint, pnpm test (7623), full test:browser (1178), both perf gates in check mode
  • New regression test: followed slot has a frame while the store-wide latest is null → live frame rendered (PreviewNavigation.browser.test.tsx); store fallback tests (progressImageStore.test.ts)
  • Adversarial fresh-context review: no defect; noted that the editor's Current Image node may briefly show a settling slot's frame during a routing window where it previously went blank
  • Manual: repeat the video + anima scenario with the tab hidden

🤖 Generated with Claude Code

https://claude.ai/code/session_01DoHBJ9QPWfq1qMTfzdzuke

With two slots live — a long video render next to a quick image batch — the
single-frame preview read the store-wide "latest" frame and matched it to the
followed placeholder. The latest belonged to whichever slot stepped last, and
releasing that slot when its batch finished nulled it outright. The video
slot's own frame was still stored per slot (the gallery cell kept showing
it), but the preview rendered an empty card until the video's next step,
minutes away. Reloading fixed it only because reconcile re-fed the frame.

LivePreview now reads its followed slot's frame directly, and the store's
latest falls back to the most recently updated remaining slot instead of
null so the header toggle and the editor's Current Image node do not blank
either. The store-wide matcher is gone.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DoHBJ9QPWfq1qMTfzdzuke
@lstein
lstein enabled auto-merge September 6, 2026 22:33
@lstein
lstein merged commit 9c14c62 into main Sep 6, 2026
19 checks passed
@lstein
lstein deleted the fix/preview-follow-slot-frame branch September 6, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant