fix: debounce output clearing during cell re-execution#12947
Merged
Conversation
|
E2E Tests 🚀 |
seeM
reviewed
Apr 10, 2026
Contributor
seeM
left a comment
There was a problem hiding this comment.
Yay thank you! These sorts of visual flickers really bother me - glad I'm not alone.
-
Should this rather happen in the UI layer? There are other consumers of cell outputs and they probably don't want this debounced behavior. E.g. could create a derived/debounced observable from
outputsin theNotebookCodeCell. Maybe the existingdebouncedObservableworks? -
Out of scope of this change, but can we also debounce the execution status indicator and the execution count change?
3890434 to
c9ff264
Compare
Contributor
Author
|
Good call. The approach I took (a new |
Uses useDebouncedObservedValue with default isUndefinedOrNull predicate so the transient undefined during re-execution is suppressed, preventing the [1] -> - -> [2] flash.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
When a notebook cell is re-run, the runtime immediately clears outputs before sending new ones. This caused the output container to briefly disappear and reappear, producing a distracting flash.
lotsa-bouncing.mov
To address we defer the clear by a small amount when execution is active so fast-completing cells never flash. We also flush the deferred clear immediately when execution ends.
Result:
Screen.Recording.2026-04-10.at.1.40.28.PM.mov
Release Notes
New Features
Bug Fixes
QA Notes
@:notebooks @:positron-notebooks
print("hello"))import time; time.sleep(2); print("done")) -- output should clear only after the delay, not flash