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

Implements undo/redo for draw, pin, and actuation mode #276

Open
wants to merge 16 commits into
base: stage
Choose a base branch
from

Conversation

skuiry
Copy link
Collaborator

@skuiry skuiry commented Jan 21, 2023

No description provided.

@vercel
Copy link

vercel bot commented Jan 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ewod-gui-2-0 ❌ Failed (Inspect) Feb 2, 2024 10:42am

@leofuturer
Copy link
Owner

Looks like the undo and redo is only implemented for "drawing", "pin mapping", and the "actuation" (not from this PR) mode. Did we decide to not include the "select and move" mode?

Besides, since the undo and redo might be coupled with other issues, let's try to merge PR #265 into the stage first before we work on this issue.

@skuiry
Copy link
Collaborator Author

skuiry commented Jan 28, 2023

Looks like the undo and redo is only implemented for "drawing", "pin mapping", and the "actuation" (not from this PR) mode. Did we decide to not include the "select and move" mode?

Besides, since the undo and redo might be coupled with other issues, let's try to merge PR #265 into the stage first before we work on this issue.

The undo should be implemented within the select and move mode as well. I forgot to include that in the PR title. And yeah, I'll look into closing #265 soon.

@leofuturer
Copy link
Owner

I tested again and the undo and redo for "select and move" mode is still missing. The icons for undo and redo disappear if I switch to the "select and move" mode.

Besides, please fix the conflicts here.

@skuiry
Copy link
Collaborator Author

skuiry commented Feb 9, 2023

I tested again and the undo and redo for "select and move" mode is still missing. The icons for undo and redo disappear if I switch to the "select and move" mode.

That's odd, let me look into this right now.

@leofuturer
Copy link
Owner

Thanks, Shounak!
And the undo for mapping mode seems to have some issues:

20230209_154859.mp4
  1. If I map one electrode to a pin number and then click undo (with the current electrode highlighted), the undo erases the previous mapping.
  2. If I map one electrode to a pin number -> click another electrode to highlight it -> click undo, the undo seems to stop working

@skuiry
Copy link
Collaborator Author

skuiry commented Feb 10, 2023

Thanks, Shounak! And the undo for mapping mode seems to have some issues:

20230209_154859.mp4

  1. If I map one electrode to a pin number and then click undo (with the current electrode highlighted), the undo erases the previous mapping.
  2. If I map one electrode to a pin number -> click another electrode to highlight it -> click undo, the undo seems to stop working

Ok, the undo buttons will show up in "select and move" mode now. Let me check what's wrong with the mapping mode. Sorry about that!

@skuiry
Copy link
Collaborator Author

skuiry commented Feb 10, 2023

Ok, I believe I fixed the pin mapping bug. I reproduced it like in the video and the undo function didn't break. It undoes the latest pin as expected. Please let me know if it still doesn't work!

@leofuturer
Copy link
Owner

Looks good! Thank you, Shounak.
When I was testing the undo and redo functions for the "select and move" mode, I found there was still some unexpected behavior of the function. For example, when I cut and pasted some electrodes -> click undo, it only removes the pasted electrodes instead of returning those electrodes to the original position.

I think, for now, we should make a document for a comprehensive list of the expected behavior of the undo and redo (for the 4 modes). This will help us think and test more systematically, and it also helps when you implement Cypress tests for the undo and redo functions. Could you make one? I will comment on it after seeing your draft.
For the "select and move" mode (which is probably the most complicated mode for undo and redo), you can refer to this one: https://ewod-gui-2-0-158jzqwr8-leofuturer.vercel.app/

@skuiry
Copy link
Collaborator Author

skuiry commented Feb 10, 2023

Looks good! Thank you, Shounak. When I was testing the undo and redo functions for the "select and move" mode, I found there was still some unexpected behavior of the function. For example, when I cut and pasted some electrodes -> click undo, it only removes the pasted electrodes instead of returning those electrodes to the original position.

I think, for now, we should make a document for a comprehensive list of the expected behavior of the undo and redo (for the 4 modes). This will help us think and test more systematically, and it also helps when you implement Cypress tests for the undo and redo functions. Could you make one? I will comment on it after seeing your draft. For the "select and move" mode (which is probably the most complicated mode for undo and redo), you can refer to this one: https://ewod-gui-2-0-158jzqwr8-leofuturer.vercel.app/

Yeah, that sounds like a great idea! I'll make a doc in the shared drive and fill it in. Also, by 4 modes, do you mean pin, actuation, draw, and move?

@leofuturer
Copy link
Owner

Yeah, that sounds like a great idea! I'll make a doc in the shared drive and fill it in. Also, by 4 modes, do you mean pin, actuation, draw, and move?

Yes!

@skuiry
Copy link
Collaborator Author

skuiry commented Feb 10, 2023

Looks good! Thank you, Shounak. When I was testing the undo and redo functions for the "select and move" mode, I found there was still some unexpected behavior of the function. For example, when I cut and pasted some electrodes -> click undo, it only removes the pasted electrodes instead of returning those electrodes to the original position.

Also, I just tested cutting and pasting some electrodes on the GUI. It seemed to correctly return the pasted electrodes to the original position. Could you try again and see if you run into the issue again?

@leofuturer
Copy link
Owner

I tested on the Vercel deployment for your latest commit: https://ewod-gui-2-0-158jzqwr8-leofuturer.vercel.app/

20230209_175553.mp4

@leofuturer
Copy link
Owner

Please resolve the conflict here as well @skuiry

@leofuturer
Copy link
Owner

It seems if we select some electrodes -> "move" or "cut and paste" them -> undo, those electrodes returned back to original position can not be selected anymore. After refresh the page, they can be selected again.

20230218_235608.mp4

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

Successfully merging this pull request may close these issues.

3 participants