Skip to content
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

Undo removes the partial output of currently running cell; cannot redo changes undone when other cell produces outputs #10694

Closed
krassowski opened this issue Jul 24, 2021 · 5 comments
Assignees
Labels
bug pkg:shared-models status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.

Comments

@krassowski
Copy link
Member

krassowski commented Jul 24, 2021

Description

The new system of storing history of changes in 3.1 introduced with Real Time Collaboration (RTC) has some peculiarities which do not work great with my workflow. The synchronization of outputs and inputs might be neat in some cases, but it can be disruptive for live-editing code while the cell is already running.

Reproduce

Demo isolated to a single cell

undo-affects-output

  1. Open notebook using JupyterLab 3.1rc2
  2. Execute following code:
    from time import sleep
    
    for i in range(20):
        print(i)
        sleep(1)
  3. Try pressing Ctrl + Z while the code is running
  4. See that the last bit of output gets removed
  5. Try to make a change in the code and undo it with Ctrl + Z
  6. See that it will be only undone after removing the bits of output that showed up since making the change in the code

The real problems

  1. I cannot work in other cell when I use a progress reporting in an earlier cell or I will loose bits of output:

Working in other cell disrupted

  1. I cannot redo changes that I undo:

cannot-redo

Expected behavior

I was able to get used to the undo being document-wide rather than cells-specific, but it still can be annoying from time to time.

I think that there are two issues:
a) allowing users to disable the document-wide history tracking when not in RTC mode
b) separating history of outputs from history of inputs, at least when not in RTC mode

Context

  • Browser and version: Chrome
  • JupyterLab version: 3.1.0rc2
@goanpeca
Copy link
Member

goanpeca commented Jul 26, 2021

Thoughts on this one @dmonad ?

Pinging @hbcarlos :)

@hbcarlos
Copy link
Member

Actually, there is a way of preventing Yjs from capturing operations.
see: https://docs.yjs.dev/api/undo-manager#example-stop-capturing

I'm working on this. I'll open a PR.

@mlucool
Copy link
Contributor

mlucool commented Aug 2, 2021

a) allowing users to disable the document-wide history tracking when not in RTC mode

This would be great to do. To some users, this behavior is detrimental to their workflow.

@vidartf
Copy link
Member

vidartf commented Aug 4, 2021

b) separating history of outputs from history of inputs, at least when not in RTC mode

I don't think having undo/redo of outputs makes sense. While it might make sense to keep the history, I think it should be marked in some way to not be included in the undo/redo stream.

@krassowski
Copy link
Member Author

Closing as fixed in #10756 (released in 3.1.2). I opened #10791 to track allowing to disable the history tracking entirely.

@github-actions github-actions bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Feb 6, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug pkg:shared-models status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

No branches or pull requests

5 participants