-
Notifications
You must be signed in to change notification settings - Fork 172
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
Fix selection issues #6128
Merged
Merged
Fix selection issues #6128
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#13559 Bundle Size — 62.65MiB (~+0.01%).
Warning Bundle contains 70 duplicate packages – View duplicate packages Bundle metrics
|
Current #13559 |
Baseline #13540 |
|
---|---|---|
Initial JS | 45.72MiB (~+0.01% ) |
45.72MiB |
Initial CSS | 0B |
0B |
Cache Invalidation | 21.57% |
21.55% |
Chunks | 31 |
31 |
Assets | 34 |
34 |
Modules | 4380 |
4380 |
Duplicate Modules | 525 |
525 |
Duplicate Code | 31.64% |
31.64% |
Packages | 469 |
469 |
Duplicate Packages | 70 |
70 |
Bundle size by type 2 changes
1 regression
1 improvement
Current #13559 |
Baseline #13540 |
|
---|---|---|
JS | 62.64MiB (~+0.01% ) |
62.64MiB |
HTML | 11.16KiB (-0.33% ) |
11.2KiB |
Bundle analysis report Branch fix/selection-problems Project dashboard
bkrmendy
approved these changes
Jul 29, 2024
Rheeseyb
approved these changes
Jul 29, 2024
liady
approved these changes
Jul 29, 2024
liady
pushed a commit
that referenced
this pull request
Dec 13, 2024
**Problem:** 1. In a selected scene, dragging an element should drag the scene not the element 2. In a selected scene, clicking on an element should select the element 3. In a selected scene, dragging an element under the threshold not move anything, but select the element 4. In a selected scene, cmd-dragging an element should drag the element not the scene 5. In a selected scene, cmd-clicking an element should select the element 6. In a selected scene, cmd-dragging an element under the drag threshold should not move anything, but select the element **Fix:** To fix 1-2-3 we need to make sure that dragging below the threshold is handled as a "click", so the selection happens on mouse up. To fix 4-5-6 we need to make sure the cmd-mousedown already selects the element, which guarantees that the following dragging operates on the element (and not the scene) Meanwhile, the failing tests uncovered that we have an extra bug: you can deselect a selected item if you click on a non-visible (e.g. cropped) part of it. To fix it I modified the behavior of `findValidTarget` in `dont-prefer-selected` mode: it means we should change our selection to something different if possible, but we should still not deselect it. To make this clearer I renamed `don't-prefer-selected` to `prefer-more-specific-selection` As I fixed the tests I had to realize that our dragging helper functions are not good enough: we can specifiy modifier keys, but we can not specify separate modifier keys for the mouse down and for the mouse move events. Which is necessary because e.g. cmd changes the behavior differently in the two cases: cmd on mouse down changes how selection work, so it changes what will be dragged, while cmd on mouse move changes which strategy will be applied (cmd allows reparenting). **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 #6012
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem:
In a selected scene, dragging an element should drag the scene not the element
In a selected scene, clicking on an element should select the element
In a selected scene, dragging an element under the threshold not move anything, but select the element
In a selected scene, cmd-dragging an element should drag the element not the scene
In a selected scene, cmd-clicking an element should select the element
In a selected scene, cmd-dragging an element under the drag threshold should not move anything, but select the element
Fix:
To fix 1-2-3 we need to make sure that dragging below the threshold is handled as a "click", so the selection happens on mouse up.
To fix 4-5-6 we need to make sure the cmd-mousedown already selects the element, which guarantees that the following dragging operates on the element (and not the scene)
Meanwhile, the failing tests uncovered that we have an extra bug: you can deselect a selected item if you click on a non-visible (e.g. cropped) part of it. To fix it I modified the behavior of
findValidTarget
indont-prefer-selected
mode: it means we should change our selection to something different if possible, but we should still not deselect it. To make this clearer I renameddon't-prefer-selected
toprefer-more-specific-selection
As I fixed the tests I had to realize that our dragging helper functions are not good enough: we can specifiy modifier keys, but we can not specify separate modifier keys for the mouse down and for the mouse move events. Which is necessary because e.g. cmd changes the behavior differently in the two cases: cmd on mouse down changes how selection work, so it changes what will be dragged, while cmd on mouse move changes which strategy will be applied (cmd allows reparenting).
Manual Tests:
I hereby swear that:
Fixes #6012