Skip to content

Consider splitting Enter into multiple actions #312

@rachel-fenichel

Description

@rachel-fenichel

I am about to add another meaning for the enter key: when moving a block, pressing enter will place the block at its current location. I was going to just wire it in to handleEnterForWS but as this PR is now in-flight it occured to me that a better approach is to do what we should eventually do anyway, and make it a completely separate action. Similarly, I think the several unrelated activities here should be split in to separate actions:

  1. One which, when on a flyout button, presses the button.
  2. One which, when on a flyout stack, creates new block(s) on the workspace.
  3. One which, when on a field, opens the field editor.
  4. One which, when on a connection or the workspace, runs the insert action (this should be in insert.ts)
  5. One which, when none of the above apply, shows the help message about the context menu.
    • This needs to be registered first, since shortcuts are tried in the reverse of the order they are registered in.

It might be reasonable for 1 and 2 to be kept as part of a single action, but the other three are unrelated and ought to be separated out. (No objection to doing this as part of a separate follow-up PR, or even just filing a bug to do it later.)

Originally posted by @cpcallen in #306 (review)

See comments further down for decision on final implementation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions