Skip to content

Procedure callers are tightly coupled to mutator UI #3725

@BeksOmega

Description

@BeksOmega

Describe the bug

Procedure callers are tightly coupled to the mutator UI implementation. So there are some things that are impossible to do with a new mutator UI.

Specifically, you cannot reorder the parameters because the caller relies on blockIds from the mutator.

To Reproduce

Currently I have a branch of the blockly-samples repo that replicates this behavior. You can pull it here if you would like to replicate it.

  1. Drag out a procedure def and a caller.
  2. Add two params using the plus button.
  3. Add number blocks to the param inputs.
  4. Switch the order of the params using the arrows.
  5. Observe how the param order switches but the blocks are not moved correctly.
    ParamOrder

Expected behavior

Caller should be UI-Agnostic.

Additional context

Problems originate in the procedure caller's setProcedureParameters function.

Here is a demo pull request showing one method of fixing it: #3724
It is based on the idea that this can be fixed by having the procedure caller rely on variable ids instead of block ids.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions