Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlight current selection #892

Closed
15 tasks done
dethe opened this issue Jan 17, 2015 · 0 comments
Closed
15 tasks done

Highlight current selection #892

dethe opened this issue Jan 17, 2015 · 0 comments
Assignees

Comments

@dethe
Copy link
Member

dethe commented Jan 17, 2015

We should put a CSS outline around selections or otherwise mark them (outline won't follow the shape of blocks well). Users can interact with selections in several ways:

There should almost always be 2 selected things: 1 step, context, or contains, and 1 value that is block-droppable. Exceptions are if there are no valid targets for the selection, or if the user intentionally multi-selects several blocks for another operation (cut/copy).

Selection after adding a block

  1. Adding a step makes the step selected
  2. Adding a context makes the context's wb-contains block selected
  3. Adding an expression makes the first empty value of the expression selected, if any
  4. Selecting a step or context also selects its first empty value.

Click blocks in script workspace to change selection

  • Clicking on a block in the script workspace selects the block as if it were just added.
  • Ctrl-click or Cmd-click will select a block without unselecting the previous block.
  • Shift-click or drag should select contiguous blocks. [deferred, "contiguous" is tricky]
  • Selecting a block should select the values of the block as if it were just added.

Click blocks in block menu to add block to script at selection

  • Clicking on a block in the block menu should ATTEMPT to insert the block into the selection.

Clicking on a step or context:

  • If contains is selected: insert into contains as first block (prepend)
  • If a step or context is selected: insert after that block as a sibling

Clicking on an expression:

  • If the selected value has a matching type, insert there
  • If the selected value has a sibling with and open value and matching type, insert there
  • Do not auto-insert into another block than the one with selected value.

Clicking on a block in a :

  • Only add the block if it is in scope in the insert location
  • If the user has multiple blocks selected, the first valid block in the selection should be treated as the selected block.
  • If a block cannot be placed when clicked, the user should be informed why using the message view.

In all cases, once a block is added by clicking a block in the block menu, the new selection is the same as described above in "Selection after adding a block".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants