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

[editor] Ctrl+Z does not return the prompts - input however returns the outputs - data #1457

Open
vanshb03 opened this issue Mar 13, 2024 · 6 comments

Comments

@vanshb03
Copy link
Contributor

Proposed Solution:

When the user presses Ctrl+Z, the editor should undo the last action, including both the input and output, to restore the previous state compared to solely the output as it is right now. This behavior would be consistent with the interface, where Ctrl+Z typically undoes the last text entry or command. By restoring the input as well, users can easily revert to a previous state for their prompt input.

Expected Behavior:

  • User inputs a command or text in the editor.
  • User presses Ctrl+Z.
  • The editor undoes the last action, including both the input and output.
  • The editor returns to the state before the last action, showing the previous input prompt and removing the output data.
  • The user can continue working from the restored state, with the option to redo the undone action if needed.

Current Behavior:

  • User inputs a command or text in the editor.
  • The user presses Ctrl+Z when clicking on the input box.
  • The editor undoes the last action, which is solely the previous output.

LASTMILE #1457

@vanshb03
Copy link
Contributor Author

Suggested Labels:

@saqadri
Copy link
Contributor

saqadri commented Mar 19, 2024

@vanshb03 thanks a lot for reporting, and for your suggestion. @rholinshead what do you think about this? We are currently doing undo/redo just based on the state that is propagated to the TextDocument

@rholinshead
Copy link
Contributor

Hmm, @vanshb03 may I ask which version of the extension you are using? Undo/redo was added a little while ago and should include undo/redo on the prompt inputs. Here's what I experience, for reference (on lastest extension version v0.0.21):

Screen.Recording.2024-03-19.at.12.06.12.PM.mov

If we can rule out the version as a potential cause of the issue, we can debug further to see what might be happening on your end to not have it working as expected.

@vanshb03
Copy link
Contributor Author

So to recreate the issue, you have to click in the box before you Ctrl+Z, that is when the output box is the only one that changes and the input box remains the same as shown on the issue.

@rholinshead @saqadri

@rholinshead
Copy link
Contributor

With clicking the input box I'm still able to get the input to be undone

Screen.Recording.2024-03-19.at.4.12.33.PM.mov

But, maybe I misunderstood the expected behaviour? For context, the series of events that happens when updating the input and running is: (update input) -> (run, clear existing input) -> (run, update output). When I Ctrl+Z I can see these events being undone in reverse.

In your experience, is that not the case? Or are you instead proposing that Ctrl+Z in this case should undo the three events together as one step?

If the latter, there is a complication with doing so. It's possible that there could be some other unrelated event between (update input) and (run) for that input (e.g. adding another cell), or it's possible that there are a series of (update input) events before running -- this is actually the case, as you type with short pauses -- which would then need some heuristic to understand how many updates to undo.

Or, alternatively if you are proposing that Ctrl+Z should only undo the input and NOT the output, then that does resonate, since that's the behaviour in colab/jupyter for notebooks. If this is the case, the good news is I believe this will naturally happen as a result of some future updates to aiconfig.

@vanshb03
Copy link
Contributor Author

vanshb03 commented Apr 6, 2024

Yes, I was proposing that Ctrl+Z would only undo the input and not the output solely as it is currently.

Suggested Labels:

status: planned sdk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants