-
-
Notifications
You must be signed in to change notification settings - Fork 600
fix(nodeUtil): moved blocks now included in the editor changes #1931
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
Closed
+28
−2
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
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.
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.
Ended up attaching the
draggedBlockId
to the transaction, I'm unsure if this is the ideal approach though 😅Screen.Recording.2025-08-10.at.12.50.38.AM.mp4
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.
No, I don't think this is the right approach. What should happen here is using the order of the blocks only, derive which block has actually moved
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.
That's what I meant here. It's not possible with just indexes.
Say you have an editor with these values:
[1,2,3]
. If you drag2
to the first slot, you end up with[2,1,3]
, but the user could also have dragged1
into the second slot ending up with[2,1,3]
, this is why it's impossible to do it with indexes alone. Knowing which block was dragged is necessary if you want to filter the rest of the blocks.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.
Hm, yea. This is a good argument for over reporting on all of the indexes that have changed.
I don't want for dragged blocks to be handled specially in some sort of way, since that will mean having to maintain every possible way the editor may change (to get the most "fine-grained" update), when this should be a general solution.
Sorry to make you do more work here. I didn't see your comment since it was marked as resolved.
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.
No worries at all, that's fair. In that case, would you rather go with the original approach (i.e., only check for blocks with different indexes)?
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.
@rmolinamir yea, that might be the best way forward here.
Sorry, I've been on holiday & didn't answer this. Did you mean to close this PR?