Skip to content

Do not record undo for no operation. #1884

@jlaurens

Description

@jlaurens

Problem statement

Example of noop: drag a block from the flyout directly to the flyout (the toolbox or the trashcan). This may happen when you started dragging the wrong block and do not want to conclude.

Expected Behavior

For that kind of blank operation, there should be no event recorded at all on the undo stack

Actual Behavior

A Create/Move/Delete event sequence is recorded. There might be side effects too (eg variable creation). When undoing, nothing visible happens. Bad user experience.
If there are side effects, undoing may seem weird. For example, if you drag the randomize block in the Blockly/Demos/toolbox.html from the toolbox flyout to the trash, you have absolutely nothing on the workspace but when undoing many dialogs ask for deleting a variable.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions