feat: Add "Move Up" / "Move Down" menu items to lib unit components#3111
Conversation
This is a workaround for openedx#1994 "Cannot drag a component past a really long component on a unit page" Since "autoscroll" is disabled in our usage of dnd-kit due to conflicts with our custom collision detection algorithm.
|
Thanks for the pull request, @bradenmacdonald! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
|
@kdmccormick and/or @navinkarkera could you please review? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3111 +/- ##
==========================================
+ Coverage 95.59% 95.63% +0.03%
==========================================
Files 1403 1402 -1
Lines 33239 33222 -17
Branches 7780 7782 +2
==========================================
- Hits 31775 31772 -3
+ Misses 1415 1403 -12
+ Partials 49 47 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude <noreply@anthropic.com>
navinkarkera
left a comment
There was a problem hiding this comment.
@bradenmacdonald Looks good, just found one bug where if you use sidebar menu directly after using the move option once, it uses the old index and breaks the order.
Also, should we use optimistic updates to make the movement instant?
Co-authored-by: Navin Karkera <navin@disroot.org>
|
Good catch - thanks @navinkarkera. I included those changes.
That would be better, but it seems already pretty fast and this is an "emergency workaround" type situation, so I just want to merge the simplest version for now. |
navinkarkera
left a comment
There was a problem hiding this comment.
@bradenmacdonald Looks good. Feel free to merge this.
|
Thanks @navinkarkera. @ChrisChV could you please review/approve this so I can merge? |
ChrisChV
left a comment
There was a problem hiding this comment.
The code looks good! Thanks! 👍
…3111) (#3116) This is a workaround for #1994 "Cannot drag a component past a really long component on a unit page" (Since "autoscroll" is disabled in our usage of dnd-kit due to conflicts with our custom collision detection algorithm.) This implements the workaround proposed in #3110. I also re-organized the menu to put the destructive remove/delete menu options last, below a divider, for better consistency with course authoring.
This is a workaround for #1994 "Cannot drag a component past a really long component on a unit page" (Since "autoscroll" is disabled in our usage of dnd-kit due to conflicts with our custom collision detection algorithm.)
This implements the workaround proposed in #3110.
I also re-organized the menu to put the destructive remove/delete menu options last, below a divider, for better consistency with course authoring.
Description
Testing instructions
Try using both regular drag-and-drop and the new menu items to re-order components in a library unit.
Private ref: MNG-4985