Skip to content
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): bring back deck setup drag & drop #17477

Open
wants to merge 12 commits into
base: chore_release-pd-8.4.1
Choose a base branch
from

Conversation

jerader
Copy link
Collaborator

@jerader jerader commented Feb 10, 2025

closes AUTH-1276

Overview

This PR brings back drag/drop to deck setup with the same functionality as it had in the pre-redesign. You can only drag top-level labware and can not drag: modules or adapters. When we add stacking capabilities, we will need to refactor it to account for that level of stacking.

Test Plan and Hands on Testing

Test that you can drag and drop any labware to any slot on the deck (minus trash bins/waste chutes). If the labware is not allowed to that slot, you should see the warning blockedSlot label indicating that you can't drop it there.

Changelog

  • added LabwareControls, AdapterControls, and SlotControls for the deck map and DeckItemHover is now refactored into OffDeckControls since its used only for off deck. The reason why they needed to each have their own is because the react dnd considerations are different for each
  • added DragPreview which is responsible for the lighter container when you are actively dragging something around
  • expand RobotCoordinateSpaceWithRef to return getRobotCoordsFromDOMCoords which is used in DragPreview to determine the DOM coordinates
  • update DeckSetupDetails to accommodate those new controls
  • deleted unused utils that were used for labware<>adapter compatibility, since now, we take the labware def and search for the labware stacking offsets's adapter compatiblity
  • added util for getSwapBlocked to be used for labware<>module compatibility
  • updated moveLabwareFormErrors to also use the new labware<>adapter compatibility method

Risk assessment

mid- affected deck setup and is the bulk of the 8.4.1 release

@jerader jerader requested a review from a team as a code owner February 10, 2025 13:22
@jerader jerader requested review from koji and ncdiehl11 February 10, 2025 13:22
@jerader jerader changed the title feat(protocol-designer): deck setup drag & drop feat(protocol-designer): bring back deck setup drag & drop Feb 10, 2025
@jerader jerader added the DO NOT MERGE Indicates a PR should not be merged, even if there's a shiny green merge button available label Feb 10, 2025
@jerader jerader requested a review from a team as a code owner February 10, 2025 14:57
@jerader
Copy link
Collaborator Author

jerader commented Feb 10, 2025

@alexjoel42 & @y3rsh - i had to update how we are selecting slots in cypress because this PR adds a lot more complexity to it (basically, hovering of a slot, adapter, and labware each have their own hover component now instead of sharing one). instead of our previous logic that had the slot's exact foreign object x,y location, I added a data-testid with the slot id. The reason why i did this is because due to the various hover components, the foreign object x,y location is sometimes 0,0 but the data-testid stays the same regardless 😄

please take a look at my cypress changes when you have time!

@jerader jerader requested review from y3rsh and alexjoel42 February 10, 2025 15:20
@@ -126,6 +126,10 @@ export enum SetupContent {
Save = 'Save',
}

export const RegexSetupContent = {
slotText: /Edit (slot|labware)/i,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

depending on if the hover is on a slot/module or labware/adapter, the copy is different. this was actually always the case so not sure why cypress is mad at it now. Figured a regex to fluctuate between both options was the easiest @alexjoel42 @y3rsh

@jerader jerader changed the base branch from chore_release-pd-8.4.0 to chore_release-pd-8.4.1 February 12, 2025 15:07
@jerader jerader removed the DO NOT MERGE Indicates a PR should not be merged, even if there's a shiny green merge button available label Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant