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

Fix some issues with undo/redo in mask editor #2649

Merged
merged 1 commit into from
Sep 10, 2023

Conversation

hikaru-y
Copy link
Contributor

@hikaru-y hikaru-y commented Sep 9, 2023

Fixes some issues with undo/redo in the IO mask editor. See the commit message for details.

Also adds a small UI improvement:
The undo/redo buttons are now disabled when there is no action to undo/redo.

Issues:
- The `change` event was not dispatched in MaskEditor.svelte when an
undo/redo was performed. Therefore, if the user then closed the editor
or switched to another note without performing an operation that would
cause the `change` event to be dispatched, the undone or redone changes
were not saved to DB.
- When `IOMode.kind === "edit"` (i.e., Edit Current or Browse), the
beginning of the undo history was a blank canvas, not a canvas with
existing masks. Therefore, if you continued to undo to the beginning of
the history, the masks that existed when you opened the editor would be
lost, and they would not be restored even when you performed a redo.
- In the 'Add' dialog, the undo history was not reset when starting to
create a new IO note after adding an IO note.

Also add a small UI improvement:
The undo/redo buttons are now disabled when there is no action to
undo/redo.
@dae
Copy link
Member

dae commented Sep 10, 2023

Thank you very much for these Hikaru!

@dae dae merged commit 3742fa9 into ankitects:main Sep 10, 2023
@dae
Copy link
Member

dae commented Sep 10, 2023

Just curious, does this resolve #2620?

@hikaru-y
Copy link
Contributor Author

I'll comment over there.

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.

2 participants