-
Notifications
You must be signed in to change notification settings - Fork 29.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can the notebooks "run number" not flicker on run? #150924
Comments
We clear the execution order when execution starts, and jupyter itself does not provide the new execution order until slightly after execution starts. All I can think of is doing something on the rendering side, like wait a bit to render a cleared execution order? |
`` |
Found it annoying while testing microsoft/vscode-jupyter#10598. Not that in the video, I was dragging an ipywidgets slider, which somehow is updating execution status. Though it didn't really increment the execution count, it kept flickering. Screen.Recording.2022-06-28.at.10.34.30.AM.movIt's also annoying to see the spinner. Bump it to July as I found this UX a bit unpleasant. |
I wonder if that is related to creating a fake execution to update an output. Should be possible to do that atomically but I can check |
To summarize since this goes on the plan, two related issues:
|
Same for the timer. Also fix spinner delay logic to correctly implement showing for a minimum time. Fixes #150924
So far I have
However, it's hard to avoid this for actual fake executions, because since this is a workaround for our API, it's not really clear how to detect this and treat them differently. We've said that we want an execution to show the progress spinner for a minimum time, 500ms, so that you can definitely tell in the UI that an execution happened, even if it is very fast. So then even if an execution is created and completed within the same js task, we will still show the progress spinner. This is good for fast normal executions and not good for "fake" executions. We could say that an execution that is completed immediately does not get the spinner at all, but I don't like that because it could hurt some simple kernel that doesn't need to do any async work as part of an execution. So I'm very open to ideas on how to improve this. |
For future reference, here is a snippet that does a "fake" execution to update outputs outside of an execution. from ipywidgets import interact, interactive, fixed, interact_manual, widgets
caption = widgets.Label(value='The values of slider is : ')
slider = widgets.IntSlider(min=-5, max=5, value=0, description='Slider')
def handle_slider_change(change):
print(change)
caption.value = 'The values of slider is : ' + str(change.new)
slider.observe(handle_slider_change, names='value')
display(caption, slider) |
Interesting, I hadn't realize this - To understand this usecase I'm looking for an example that updates the output in jupyter lab outside of an execution - I remember there was one which I think involved subprocess, but I can't find an example anywhere. Wondering whether you have one handy @DonJayamanne |
Don't clear execution order immediately when execution starts. Same for the timer. Also fix spinner delay logic to correctly implement showing for a minimum time. Fixes #150924
Verification steps:
from ipywidgets import interact
def func1(x):
return 5*x
interact(func1, x=10);
|
Verified |
Testing microsoft/vscode-jupyter#10170
A lot of flickering goes on when executing a cell, can the number in [] not get its text cleared and instead go from [5] to [6] for example to minimize flickering?
The text was updated successfully, but these errors were encountered: