waveterm icon indicating copy to clipboard operation
waveterm copied to clipboard

Undo for Deleting a Command Block

Open reform-chipper opened this issue 1 year ago • 2 comments

As the title says. Currently when a command block is deleted, there's no way to bring it back. There also isn't a confirm dialog box.

The broader goal is to have something like a Jupyter Notebook for shell commands.

Simple example of this vision:

image

All related issues:

https://github.com/wavetermdev/waveterm/issues/415 - Editable Command Blocks https://github.com/wavetermdev/waveterm/issues/416 - Command Block Reordering https://github.com/wavetermdev/waveterm/issues/417 - Editable Markdown Blocks https://github.com/wavetermdev/waveterm/issues/418 - Export/Import Tab or Workspace https://github.com/wavetermdev/waveterm/issues/419 - Allow All Blocks in a Tab To Be Executed Again https://github.com/wavetermdev/waveterm/issues/420 - Allow Tab or Workspace Shell to be Restarted https://github.com/wavetermdev/waveterm/issues/421 - Undo for Deleting a Command Block

reform-chipper avatar Mar 09 '24 12:03 reform-chipper

I think a confirm for this might be annoying. My thought here is to provide some small window of undo (maybe 5 seconds). So, if you accidentally delete a block you have 5 seconds to "undo it" and it will come back. This can be implemented by just deferring the actual delete for 5 seconds (although we'll visually remove it immediately). For the first cut of this feature I'd also only allow one item to be "undone".

I know this isn't a fully general solution, but would this solve enough of the problem for you as a first pass?

sawka avatar Mar 11 '24 23:03 sawka

Yes, that would certainly be better than what we have today. Maybe create an issue to implement a more robust undo system later once there's nothing better to do?

You're right, a confirm dialog would probably be too intrusive. It might only make sense without the undo feature, because the action is irreversible.

reform-chipper avatar Mar 12 '24 10:03 reform-chipper