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

Improve undo behavior for edgeless content dragging #5722

Closed
doodlewind opened this issue Dec 14, 2023 · 1 comment · Fixed by #5750
Closed

Improve undo behavior for edgeless content dragging #5722

doodlewind opened this issue Dec 14, 2023 · 1 comment · Fixed by #5750
Assignees
Labels
mod:edgeless Module: related to edgeless mode type:feat Non-bug feature improvements

Comments

@doodlewind
Copy link
Member

See #5613 (review)

Two minor issues:

  1. After dragging out an image, you can undo this operation, but unable to redo it back:
Screen.Recording.2023-12-14.at.21.51.31.mov

This usually happens due to unexpected side effect (model mutation) that comes with the undo, which resets the history stack.

  1. After dragging an image inside the note, the first undo/redo pair works fine. But from this moment, it requires 2 undo operations to make actual undo effect:
Screen.Recording.2023-12-14.at.21.56.45.mov

This usually happens when page.captureSync() is called during a series of model operations, which will add one undo step.

By default, the UndoManger merges all operations from the same user during about 500ms (even if these operations are using multiple page.transact calls) into one undo step. Using page.captureSync() is the way to add more undo steps manually. For certain cases (e.g., batch adding images), adding more undo steps allows user to undo each operation one after another.

@doodlewind doodlewind added mod:edgeless Module: related to edgeless mode type:feat Non-bug feature improvements labels Dec 14, 2023
@doodlewind
Copy link
Member Author

Also relates to (possibly duplicate of) #5407

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mod:edgeless Module: related to edgeless mode type:feat Non-bug feature improvements
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants