Skip to content

Undo and redo fail to re-add comment to block #6708

@cpcallen

Description

@cpcallen

Describe the bug

  • Redo won't re-add a comment to a block that was removed by undoing the addition.
  • Undo won't re-add a comment to a block that was removed by using the Remove Comment context menu item.

To Reproduce failure

Steps to reproduce the redo fail behaviour:

  1. Go to blockly playground.
  2. From the Logic category, add an "if" block to the workspace.
  3. Right-click on the new block, choose "add comment"
  4. Press undo (⌘Z on macOS)
  5. Press redo (⌘⇧Z on macOS)

Steps to reproduce the undo fail behaviour: steps 1-3 as above, then
4. Right-click on the new block, choose "remove comment"
4. Press undo (⌘Z on macOS)

Expected behaviour

  • In the first case, the comment indicator (?) should disappear when undo is pressed, and then reappear when redo is pressed.
  • In the second case, the comment indicator (?) should disappear when "remove comment" is selected, and then reappear when undo is pressed.

Actual behaviour

The comment indicator disappears and does not reappear.

Desktop (please complete the following information):

  • OS: macOS 12.6.1
  • Browser: Firefox 107.0.1 (64-bit), Chrome 108.0.5359.98
  • Version: develop @ 3be3d4a (i.e., 9.2.0 release candidate)

Stack Traces

No console ouptut.

Additional context

By adding additional items to the undo stack it can be observed that the action is undone/redone (i.e., it takes up one step of a sequence of undo/redo steps), but without observable effect.

Adding text to the comment before deleting it causes it to be correctly restored.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions