Repository navigation
fix(preview): keep in-progress preview off after the user disables it - #9868
Conversation
A gallery selection made while the preview was explicitly off recorded a live-follow pause, so the next Invoke turned the preview back on. Selections now pause live-follow only when it is on or already paused.
lstein
left a comment
There was a problem hiding this comment.
Reviewed at 6ddd25a. No blockers; approving.
The opt-out/pause distinction (showProgressImagesInViewer off with vs. without liveFollowPausedAt) holds across every writer of that state: the pause helper (now skips the stamp on an explicit opt-out), the submit snapshot builder (the sole queue-item creation site; resumes only with a stamp), and setActiveProjectSettings (the hourglass toggle, tile follow() and the settings dialog all route through updateProjectPreferences, which clears the stamp). I found no path that drops the stamp (project serialization, session-scoped gallery stripping, layout preset switches, and every gallery-values replacement keep it), so a selection pause can't silently degrade into a permanent opt-out. Results arriving while opted out still can't take the selection, since shouldSelectGalleryResult requires live-follow on.
Checks: workbenchState.test.ts passes (327), lint:tsc clean, and the new test fails against the base reducer.
Non-blocking:
- The
&& getLiveFollowPausedAt(project) === nullhalf of the guard survives mutation: removing it leaves all 6293 workbench tests green. It's also behaviorally equivalent today, because every submit resumes live-follow, so no queue item can be submitted between an older pause stamp and a re-stamp. Fine to keep as a safeguard, but a short comment or test would stop it being removed as dead code. - Projects already saved with the old bug's stale stamp resume once more, as the PR notes. An old stamp can't be told apart from a real selection pause, so I don't see a better fix.
- The new test stops at submit and doesn't cover results routing. That logic is unchanged, so this is minor.
Summary
Turning off Show in-progress diffusion in Preview did not survive the next Invoke if the user clicked anything in the Gallery in between.
A deliberate Gallery selection (or compare/multi-select) pauses live-follow: it switches the preview off and stamps a pause time, and the next submission resumes it. An explicit toggle clears that pause, but a later selection stamped a new one, so Invoke treated the user's opt-out as a selection pause and switched the preview back on.
Now a selection records a pause only when live-follow is on or already paused. With the preview explicitly off, a selection updates the Gallery and nothing else.
The selection pause itself is unchanged: if the user never turned the preview off, selecting an image still pauses it, and the next Invoke still resumes it.
Related Issues / Discussions
Closes #9795
QA Instructions
pnpm check:release(webv2) passed: lint/types/architecture, unit (10177), browser (2895), architecture performance, project-file journeys, accessibility.keeps an explicit live-follow opt-out through later Gallery selections and submissionscovers select + compare followed by submit. It fails onmainand passes here.enqueue_batchstubbed): turn off the hourglass toggle in Preview, select a Gallery item, press Invoke.main: the toggle flips back to "Hide in-progress diffusion" (pressed).Review
No material findings. Limitations:
Checklist
What's Newcopy (if doing a release after this PR)Need help on this PR? Tag
@codesmith-botwith what you need.