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

Modifiers for reparenting and convert to absolute strategies #6054

Merged
merged 22 commits into from
Jul 12, 2024

Conversation

gbalint
Copy link
Contributor

@gbalint gbalint commented Jul 9, 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:

  • I opened a hydrogen project and it loaded
  • I could navigate to various routes in Preview mode

Fixes #6047

Copy link
Contributor

github-actions bot commented Jul 9, 2024

Try me

Copy link

relativeci bot commented Jul 9, 2024

#13346 Bundle Size — 62.66MiB (~+0.01%).

fd6912d(current) vs 6339ece master#13341(baseline)

Warning

Bundle contains 70 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes Regression 1 regression
                 Current
#13346
     Baseline
#13341
Regression  Initial JS 45.71MiB(~+0.01%) 45.71MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 21.62% 22.26%
No change  Chunks 30 30
No change  Assets 33 33
No change  Modules 4374 4374
No change  Duplicate Modules 524 524
No change  Duplicate Code 31.7% 31.7%
No change  Packages 469 469
No change  Duplicate Packages 70 70
Bundle size by type  Change 2 changes Regression 1 regression Improvement 1 improvement
                 Current
#13346
     Baseline
#13341
Regression  JS 62.65MiB (~+0.01%) 62.64MiB
Improvement  HTML 11.16KiB (-0.33%) 11.2KiB

Bundle analysis reportBranch feature/modifiers-for-reparent-a...Project dashboard

@gbalint gbalint marked this pull request as ready for review July 11, 2024 14:57
@gbalint gbalint merged commit 67abcdd into master Jul 12, 2024
14 checks passed
@gbalint gbalint deleted the feature/modifiers-for-reparent-and-convert-to-absolute branch July 12, 2024 10:33
liady pushed a commit that referenced this pull request 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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Canvas Interactions: ctrl-to-absolute, cmd-to-reparent
3 participants