google/blockly-ios

Set up Events

CoryDCode opened this issue · 3 comments

We need to implement events, to support Undo functionality and cross-platform workspace replay.

When we take a look at the design for this, we need to look into decoupling FieldVariableLayout and WorkspaceLayoutCoordinator again. We linked them as a stop-gap, but may want to decouple them with this rework, as well.

vicng commented

Things to consider during implementation:

  1. NSNotifications that are being generated/listened to within Blockly iOS should most likely be refactored as part of this Events implementation (eg. MutatorProcedureDefinitionLayout, WorkspaceLayoutCoordinator, ProcedureCoordinator).
  2. As part of this implementation, EventManager should combine events that are valid merge partners (eg. two move events on the same block that are part of the same group).
  3. Disabling events during undo/redo avoids echoing for the library code, but it may prevent behavior for clients that rely on automatically state based on events being re-fired. We need to figure out a consistent behavior here.
vicng commented

Fixed in #320, #322, #323, #328, #329, #332, #333 (phew!).

Decoupling FieldVariableLayout from WorkspaceLayoutCoordinator has been moved to its own issue #334.