-
Notifications
You must be signed in to change notification settings - Fork 178
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
feat(protocol-designer): update React DnD from version 6.0.0 to 16.0.1 #14485
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## edge #14485 +/- ##
==========================================
- Coverage 67.79% 67.77% -0.03%
==========================================
Files 2518 2518
Lines 72017 72145 +128
Branches 9244 9283 +39
==========================================
+ Hits 48826 48894 +68
- Misses 20989 21033 +44
- Partials 2202 2218 +16
Flags with carried forward coverage won't be shown. Click here to find out more.
|
0c2cd3a
to
f7a40fb
Compare
if (newSlot != null) { | ||
dispatch(moveDeckItem(newSlot, labwareId)) |
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.
the reason why i am checking for newSlot
here (also in SlotControls
) is because I can't get item
from useDrag
to update to the latest state. If you drag and drop the labware initially, it doesn't update to the new slot in item
- this was causing a bug where you could only drag and drop the labware once. I tried to find documentation about how to fix this but i couldn't find anything so this was my workaround. Any refactor suggestions are welcome!
@@ -486,7 +478,6 @@ export const DeckSetupContents = (props: ContentsProps): JSX.Element => { | |||
</React.Fragment> | |||
) | |||
})} | |||
<DragPreview getRobotCoordsFromDOMCoords={getRobotCoordsFromDOMCoords} /> |
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.
When i updated from mouse backend to html5 backend, the DOM coordinates changed and resulted in the drag preview being mirrored. I tried to fix it but couldn't quite get it right because the EditLabware
was being shown in replace of the cursor and it was being layered on top of the drag preview that was not in the correct place. so I opted to delete it. I showed the current visuals to Felix and he said they are ok! the deck map is getting a whole redesign this year (for 8.2) so this change will be only for the upcoming PD release (8.1).
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.
Smoke tested without any issues or strange behavior!
Bummer about the item
from useDrag
not updating, but the newSlot
approach is easy enough to follow. LGTM! Thanks for spending the time to update 10 versions 🥳
close RAUT-964
Overview
This PR updates React-DnD from version
6
to16.0.1
and it updates the react dnd backend frommouse-backend
toHTML5-backend
(this backend has been updated recently, since mouse-backend was last update 5 years ago 💀 )NOTE: i didn't add test coverage in this because once the vite migration is done, we will be using vitest - figured that is a better time to add test coverage
Test Plan
Test the drag and drop features which include:
doItAllV8
or something! Also test deleting & duplicating a step -> which you can access through right clicking on the step item and seeing the "delete" option in the menu that appears.Please call out anything strange you might see. I tried to smoke test all the options as thoroughly as possible.
Changelog
@ts-expect-errors
due to the react dnd versionReview requests
see test plan
Risk assessment
low