fix(preview): follow the slot's own frame, not the store-wide latest - #218
Merged
Conversation
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
requested review from
JPPhoto,
Pfannkuchensack and
blessedcoolant
as code owners
September 6, 2026 22:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
LivePreviewreads its followed slot's own frame viauseQueueItemProgressImage(queueItemId, itemIndex); the store-wide matchergetMatchingProgressImageand theprogressImageprop are removed.progressImageStorekeeps 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), fulltest:browser(1178), both perf gates in check modePreviewNavigation.browser.test.tsx); store fallback tests (progressImageStore.test.ts)🤖 Generated with Claude Code
https://claude.ai/code/session_01DoHBJ9QPWfq1qMTfzdzuke