sagemathinc / cocalc

CoCalc: Collaborative Calculation in the Cloud
https://CoCalc.com
Other
1.17k stars 216 forks source link

jupyter notebook: change color state of Stop button to not depend on how long is was mounted #6591

Closed williamstein closed 2 months ago

williamstein commented 1 year ago
  1. Create any jupyter notebook
  2. Start some long running code running (burning cpu)
  3. The Stop button at the top starts green changes slowly to red.
  4. Now change anything about the frame layout, e.g., toggle chat, split the screen, etc.
  5. The button switches back to green.

This is obviously caused by just doing something simple with state in react at the level of the button. It's definitely a bug though, to do this. This is a serious bug, because it sends the message to the user: "Your running computation just got reset!" which is NOT what happened, and is potentially really disturbing.

(There is a basically identical state bug with the "ChatGPT is responding" progress bar.)

williamstein commented 2 months ago

The colored stop button doesn't exist anymore... however, the exact same issue I'm complaining about here happens with the cpu indicator:

image

That said, this is low priority. In any case:

import time
time.sleep(10000)

The cpu indicator goes green, then yellow, then red. Split the frame -- boom indicator is back to green. That's just dumb. If nothing else, use state in the store rather than the component to easily fix this.

williamstein commented 2 months ago

Removing the easy label -- this is difficult because the jupyter usage info isn't implemented in development mode, which makes doing development related to this functionality much more painful.

We should not add new functionality to cocalc that doesn't work in dev mode, unless there is a really good reason.

williamstein commented 2 months ago

I'm just closing this.