-
-
Notifications
You must be signed in to change notification settings - Fork 385
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 external consistency of grouping layers so they don't jump to the top of the hierarchy #1627
Fix external consistency of grouping layers so they don't jump to the top of the hierarchy #1627
Conversation
Calculate insert_index when grouping multiple selected layers using Ctrl+G shortcut |
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.
Code looks good and it works well.
I think you might have accidentally committed some unrelated changes though.
@@ -1101,7 +1118,7 @@ impl DocumentMessageHandler { | |||
/// When working with an insert index, deleting the layers may cause the insert index to point to a different location (if the layer being deleted was located before the insert index). | |||
/// | |||
/// This function updates the insert index so that it points to the same place after the specified `layers` are deleted. | |||
fn update_insert_index(&self, layers: &[LayerNodeIdentifier], parent: LayerNodeIdentifier, insert_index: isize) -> isize { | |||
fn updatecalculated_insert_index(&self, layers: &[LayerNodeIdentifier], parent: LayerNodeIdentifier, insert_index: isize) -> isize { |
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'm not quite sure why this was renamed? If this was intentional could you please standardise the formatting with underscores between words? Thanks.
frontend/package.json
Outdated
@@ -56,7 +56,7 @@ | |||
"vite-multiple-assets": "1.2.6" | |||
}, | |||
"optionalDependencies": { | |||
"wasm-pack": "0.12.1" | |||
"wasm-pack": "^0.0.0" |
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 this was probably accidental (web package management can be quite fragile) - would it be possible to revert this change as well as the changes to the package-lock.json files?
Yes those are accidental, I will revert now
…On Mon, Feb 26, 2024 at 6:54 PM 0HyperCube ***@***.***> wrote:
***@***.**** requested changes on this pull request.
Code looks good and it works well.
I think you might have accidentally committed some unrelated changes
though.
------------------------------
In editor/src/messages/portfolio/document/document_message_handler.rs
<#1627 (comment)>
:
> @@ -1101,7 +1118,7 @@ impl DocumentMessageHandler {
/// When working with an insert index, deleting the layers may cause the insert index to point to a different location (if the layer being deleted was located before the insert index).
///
/// This function updates the insert index so that it points to the same place after the specified `layers` are deleted.
- fn update_insert_index(&self, layers: &[LayerNodeIdentifier], parent: LayerNodeIdentifier, insert_index: isize) -> isize {
+ fn updatecalculated_insert_index(&self, layers: &[LayerNodeIdentifier], parent: LayerNodeIdentifier, insert_index: isize) -> isize {
I'm not quite sure why this was renamed? If this was intentional could you
please standardise the formatting with underscores between words? Thanks.
------------------------------
In frontend/package.json
<#1627 (comment)>
:
> @@ -56,7 +56,7 @@
"vite-multiple-assets": "1.2.6"
},
"optionalDependencies": {
- "wasm-pack": "0.12.1"
+ "wasm-pack": "^0.0.0"
I think this was probably accidental (web package management can be quite
fragile) - would it be possible to revert this change as well as the
changes to the package-lock.json files?
—
Reply to this email directly, view it on GitHub
<#1627 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQEFUON3YUHVMENT3FEGRKLYVS45BAVCNFSM6AAAAABDZGWVQCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTSMBRGQ3TONBYGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Mentioned wrong commits fixed |
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.
Thanks for cleaning that up.
Please discard the removal of |
!build |
Do you mean package-lock.json in main folder or frontend/package-lock.json,
I don't know how those changed at all
… Message ID: ***@***.***>
|
|
Please check now
…On Tue, Feb 27, 2024 at 10:42 PM Keavon Chambers ***@***.***> wrote:
frontend/package-lock.json, please do a self-code review here on GitHub
and you'll see it. You can run git restore --source origin/master
frontend/package-lock.json and commit it back.
—
Reply to this email directly, view it on GitHub
<#1627 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQEFUOO7YRJOFPM4CTLW6GDYVZAKXAVCNFSM6AAAAABDZGWVQCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRXGU2TKMBTGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Yes, that's corrected now. I will code review and QA this soon today. |
Thank you
…On Tue, Feb 27, 2024 at 10:56 PM Keavon Chambers ***@***.***> wrote:
Yes, that's corrected now. I will code review and QA this soon today.
—
Reply to this email directly, view it on GitHub
<#1627 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQEFUON3DOYPGSD6LVPYSTDYVZCA5AVCNFSM6AAAAABDZGWVQCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRXGU3TINBQHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Please also fix the CI errors (it looks like a formatting issue) so this can pass and build. |
Sorry I don't know what are CI errors
…On Tue, Feb 27, 2024 at 11:47 PM Keavon Chambers ***@***.***> wrote:
Please also fix the CI errors (it looks like a formatting issue) so this
can pass and build.
—
Reply to this email directly, view it on GitHub
<#1627 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQEFUOIOI3F3YYFUTR46DYDYVZH5PAVCNFSM6AAAAABDZGWVQCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRXGY3DGMBWHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
See the ❌ below the comment section? That's telling you that your code has something wrong with it. Either the tests failed, there's a formatting error, the code can't compile, or something else is wrong. In this case, you need to fix your code formatting. You should set up your editor so it automatically formats your code every time you save your file. This should come as part of our provided VS Code settings if you're using that editor, otherwise you'll need to figure that out yourself if you're using another editor. |
Done 🫡
…On Wed, Feb 28, 2024 at 12:15 AM Keavon Chambers ***@***.***> wrote:
See the ❌ below the comment section? That's telling you that your code has
something wrong with it. Either the tests failed, there's a formatting
error, the code can't compile, or something else is wrong. In this case,
you need to fix your code formatting. You should set up your editor so it
automatically formats your code every time you save your file. This should
come as part of our provided VS Code settings if you're using that editor,
otherwise you'll need to figure that out yourself if you're using another
editor.
—
Reply to this email directly, view it on GitHub
<#1627 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQEFUOJSY4P7B7HTGWKBE5TYVZLG7AVCNFSM6AAAAABDZGWVQCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRXG4ZDONZZGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
!build |
|
717e5e5
to
472f51b
Compare
}); | ||
responses.add(PortfolioMessage::PasteIntoFolder { | ||
clipboard: Clipboard::Internal, | ||
parent: LayerNodeIdentifier::new_unchecked(folder_id), | ||
insert_index: -1, | ||
}); | ||
|
||
let folder_id = NodeId(generate_uuid()); // TODO: Either this is a bug, or its reasoning should be explained in a comment |
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.
This line looks like it was accidentally copied from above (line 490) and put here. But if it has a purpose, please explain it for me so we can discuss if it should be kept.
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.
Yes it's a mistake
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.
Please resolve the potentially extraneous line I commented on.
I committed a change which improves the code to make it follow idiomatic Rust (avoiding mutation, avoiding needing to break from nested loops, etc.). Please look at the diff so you can learn from it. |
Great I will
…On Wed, Feb 28, 2024, 8:04 AM Keavon Chambers ***@***.***> wrote:
I committed a change which improves the code to make it follow idiomatic
Rust (avoiding mutation, avoiding needing to break from nested loops,
etc.). Please look at the diff so you can learn from it.
—
Reply to this email directly, view it on GitHub
<#1627 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQEFUOLXSKLEKEPIGPJKLALYV3CFJAVCNFSM6AAAAABDZGWVQCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRYGI4TINBQGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
!build |
|
… top of the hierarchy (#1627) * Calculate insert_index when grouping multiple layers * no message * Fix wrong commits * no message * restore frontend/package-lock.json * Fix formatting matches * Code review to make it idiomatic * remove wrong line --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
Partly closes #1633 (fixes "Grouping" > "External Consistency").