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

Canvas Interactions: ctrl-to-absolute, cmd-to-reparent #6047

Closed
3 tasks
balazsbajorics opened this issue Jul 9, 2024 · 0 comments · Fixed by #6054
Closed
3 tasks

Canvas Interactions: ctrl-to-absolute, cmd-to-reparent #6047

balazsbajorics opened this issue Jul 9, 2024 · 0 comments · Fixed by #6054
Assignees
Labels
Canvas Affects the visual editor Experiment

Comments

@balazsbajorics
Copy link
Contributor

  • We should only enable "convert to absolute and..." type strategies if the user holds ctrl. (or selects in the strategy selector?)
  • We should only enable reparents if the user holds cmd.
  • By default, an unmodified drag-to-move on the canvas should result in reorder, no_op, or IF the element is already position: absolute, then an absolute move.
@balazsbajorics balazsbajorics added the Canvas Affects the visual editor label Jul 9, 2024
liady pushed a commit that referenced this issue Dec 13, 2024
**Description:**
To make our canvas interactions more predictable I put reparenting and
conversion to absolute behind modifier keys:
- cmd is needed for reparenting
- ctrl is needed for conversion to absolute

**Notes:**
- Nearly 70 tests were broken (nearly all reparenting and
convert-to-absolute tests). In most of the cases I just had to add the
necessary modifiers to make the tests work
- Insertion relies on reparenting, I needed to modify the draw-to-insert
strategy too
- cmd disables snapping, so now it is not possible to have snapping
during reparenting (I needed to disable the tests for this)
- space forces convert to absolute, this is in partial conflict with
ctrl, but they are not really the same: without ctrl convert-to-absolute
strategies are disabled, but even with ctrl other strategies are still
possible, while space really forces convert-to-absolute strategies
- when you have a selection, cmd mouse down on a descendant element will
change the selection to the descendant. If you don't want that, you need
to press cmd after the mouse down.
- with ctrl, you always need to press it after mouse down, otherwise the
context menu will open
- earlier cmd had a special meaning in case of reparenting: it allowed
the element to be reparented into a parent which is smaller than the
element itself. This distinction doesn't exist anymore, because without
pressing cmd there is no reparent at all

**Manual Tests:**
I hereby swear that:

- [x] I opened a hydrogen project and it loaded
- [x] I could navigate to various routes in Preview mode

Fixes #6047
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Canvas Affects the visual editor Experiment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants