-
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
No multiselect controls for selection with the same uids #4251
Conversation
Job #8350: Bundle Size — 62.78MiB (~+0.01%).
Warning Bundle contains 64 duplicate packages - View duplicate packages Bundle metrics (2 changes)
Bundle size by type (1 change)
View job #8350 report View feature/all-uids-the-same-multis... branch activity |
@@ -1139,3 +1139,15 @@ export function getStoryboardPathFromPath(path: ElementPath): ElementPath | null | |||
export function appendTwoPaths(base: ElementPath, other: ElementPath): ElementPath { | |||
return elementPath([...base.parts, ...other.parts]) | |||
} | |||
|
|||
export function multipleElementPathsWithTheSameUid(paths: Array<ElementPath>): boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this be a more suitable name?
export function multipleElementPathsWithTheSameUid(paths: Array<ElementPath>): boolean { | |
export function allPathsHaveTheSameUid(paths: Array<ElementPath>): boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First I used a similar name but I wanted the function to return false
when there is only one uid (or when the array is empty), and for these cases allPathsHaveTheSameUid
would be misleading a name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm I agree with that reasoning, but this name now gives the impression that it is checking for the presence of any duplicate UIDs, rather than checking that all paths end in the same UID. so e.g. given the input [ 'aaa/bbb', 'aaa/ccc', 'aaa/ccc:ddd/bbb' ]
I'd expect this function to return true
because there are two paths ending in bbb
. So I think for that reason it would be better to name this something multiplePathsAllWithTheSameUID
I did a very poor job following the remix track |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's an OK mitigation step, but comes with a big downside: if you actually want to interact with the (multi)selected element on the canvas, you have to unselect it and select it again so you have a single selection.
I think the long term solution should be that we introduce a third type of outline on the canvas, sitting between highlight (temporary) and real selection (permanent, multiseletion usually very deliberate). This "code highlight" should be more permanent than a highlight, and allow you to single click turn it into a "real" selection.
Problem:
When there are two remix scenes in the project, it is really easy to accidentally select the same element in both (by using the code editor). In this case we should a multiselect outline around those elements, which is kinda meaningless for theis special case.
Fix:
When the selected elements all share the same uid we don't show the multiselect outline and the strategy controls.