homotopy-rs icon indicating copy to clipboard operation
homotopy-rs copied to clipboard

"Undo" beahaviour

Open mlharaujo opened this issue 2 years ago • 9 comments

I think any changes to what one is currently viewing (i.e. which slice/depth) shouldn't count as actions, for the purposes of the "undo" command. At the moment it's a bit frustrating trying to find out how many times I need to click "undo" to undo the last actually meaningful action performed. When I change slice/depth to try to check if I got back to the state I want, I end up adding more actions to the stack and I get stuck in a swamp.

mlharaujo avatar Sep 16 '22 16:09 mlharaujo

Very good point Manuel.

jamievicary avatar Sep 16 '22 16:09 jamievicary

I've often been frustrated by the way undo works. I think this is a very good suggestion.

calintat avatar Sep 16 '22 16:09 calintat

I see that this is fixed now, which is great! What would be even better would be if Undo and Redo didn't change the current view, so I could see what is happening from the view that I have selected.

mlharaujo avatar Sep 20 '22 16:09 mlharaujo

Hmm, that's an interesting suggestion, I will think about it.

calintat avatar Sep 20 '22 20:09 calintat

I am reopening this because I had to revert the change due to an unforeseen problem. I will re-implement it as well as your other suggestion about undo/redo not changing the view as part of a proposed refactoring of proof state (#837).

calintat avatar Sep 21 '22 12:09 calintat

I have abandoned the proposal in #837 and I think we need to store the view state in the history for things to work correctly.

However, there are other ways we could achieve this. We could for example make it so that when you undo, it skips over all the non-meaningful actions like SwitchSlice. So we will still store these actions in the history, thereby ensuring the action dump is deterministic, but we allow undo to undo more than one action at a time.

calintat avatar Nov 21 '22 17:11 calintat

I see that this is fixed now, which is great! What would be even better would be if Undo and Redo didn't change the current view, so I could see what is happening from the view that I have selected.

This is however impossible (or at least too difficult to get right).

calintat avatar Nov 21 '22 17:11 calintat

I feel like it should be possible in limited circumstances (e.g. if the workspace diagram didn't change, then undo/redo could preserve the current view)

NickHu avatar Nov 22 '22 15:11 NickHu

But that's already the case...

What Manuel wanted is that if you have done a contraction and are looking inside a slice, pressing undo should undo the contraction while leaving you inside that slice (or the corresponding slice in the diagram before the contraction).

calintat avatar Nov 22 '22 15:11 calintat