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, components): add retract for aspirate and dispense to PD #17411

Open
wants to merge 21 commits into
base: edge
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/src/atoms/ListButton/ListButton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const meta: Meta<typeof ListButtonComponent> = {
type: {
control: {
type: 'select',
options: ['noActive', 'success', 'warning'],
options: ['noActive', 'success', 'warning', 'onColor'],
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ describe('ListButton', () => {
const listButton = screen.getByTestId('ListButton_notConnected')
expect(listButton).toHaveStyle(`backgroundColor: ${COLORS.yellow30}`)
})
it('should render correct style - onColor', () => {
props.type = 'onColor'
render(props)
const listButton = screen.getByTestId('ListButton_onColor')
expect(listButton).toHaveStyle(`backgroundColor: ${COLORS.white}`)
})
it('should call on click when pressed', () => {
render(props)
fireEvent.click(screen.getByText('mock ListButton content'))
Expand Down
10 changes: 9 additions & 1 deletion components/src/atoms/ListButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import type { StyleProps } from '../../primitives'

export * from './ListButtonChildren/index'

export type ListButtonType = 'noActive' | 'connected' | 'notConnected'
export type ListButtonType =
| 'noActive'
| 'connected'
| 'notConnected'
| 'onColor'

interface ListButtonProps extends StyleProps {
type: ListButtonType
Expand All @@ -35,6 +39,10 @@ const LISTBUTTON_PROPS_BY_TYPE: Record<
backgroundColor: COLORS.yellow30,
hoverBackgroundColor: COLORS.yellow35,
},
onColor: {
backgroundColor: COLORS.white,
hoverBackgroundColor: COLORS.grey10,
},
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@
"aspirate_mix_times": "2",
"aspirate_mix_volume": "30",
"aspirate_mmFromBottom": 1,
"aspirate_retract_delay_seconds": null,
"aspirate_retract_mmFromBottom": null,
"aspirate_retract_speed": null,
"aspirate_retract_x_position": 0,
"aspirate_retract_y_position": 0,
"aspirate_submerge_delay_seconds": null,
"aspirate_submerge_speed": null,
"aspirate_touchTip_checkbox": true,
Expand All @@ -175,6 +180,11 @@
"dispense_mix_times": null,
"dispense_mix_volume": null,
"dispense_mmFromBottom": 0.5,
"dispense_retract_delay_seconds": null,
"dispense_retract_mmFromBottom": null,
"dispense_retract_speed": null,
"dispense_retract_x_position": 0,
"dispense_retract_y_position": 0,
"dispense_submerge_delay_seconds": null,
"dispense_submerge_speed": null,
"dispense_touchTip_checkbox": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@
"aspirate_mix_times": null,
"aspirate_mix_volume": null,
"aspirate_mmFromBottom": 1,
"aspirate_retract_delay_seconds": null,
"aspirate_retract_mmFromBottom": null,
"aspirate_retract_speed": null,
"aspirate_retract_x_position": 0,
"aspirate_retract_y_position": 0,
"aspirate_submerge_delay_seconds": null,
"aspirate_submerge_speed": null,
"aspirate_touchTip_checkbox": false,
Expand All @@ -207,6 +212,11 @@
"dispense_mix_times": null,
"dispense_mix_volume": null,
"dispense_mmFromBottom": 0.5,
"dispense_retract_delay_seconds": null,
"dispense_retract_mmFromBottom": null,
"dispense_retract_speed": null,
"dispense_retract_x_position": 0,
"dispense_retract_y_position": 0,
"dispense_submerge_delay_seconds": null,
"dispense_submerge_speed": null,
"dispense_touchTip_checkbox": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@
"aspirate_mix_times": null,
"aspirate_mix_volume": null,
"aspirate_mmFromBottom": null,
"aspirate_retract_delay_seconds": null,
"aspirate_retract_mmFromBottom": null,
"aspirate_retract_speed": null,
"aspirate_retract_x_position": 0,
"aspirate_retract_y_position": 0,
"aspirate_submerge_delay_seconds": null,
"aspirate_submerge_speed": null,
"aspirate_touchTip_checkbox": false,
Expand All @@ -225,6 +230,11 @@
"dispense_mix_times": null,
"dispense_mix_volume": null,
"dispense_mmFromBottom": null,
"dispense_retract_delay_seconds": null,
"dispense_retract_mmFromBottom": null,
"dispense_retract_speed": null,
"dispense_retract_x_position": 0,
"dispense_retract_y_position": 0,
"dispense_submerge_delay_seconds": null,
"dispense_submerge_speed": null,
"dispense_touchTip_checkbox": false,
Expand Down
10 changes: 10 additions & 0 deletions protocol-designer/fixtures/protocol/8/doItAllV8.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@
"aspirate_mix_times": null,
"aspirate_mix_volume": null,
"aspirate_mmFromBottom": null,
"aspirate_retract_delay_seconds": null,
"aspirate_retract_mmFromBottom": null,
"aspirate_retract_speed": null,
"aspirate_retract_x_position": 0,
"aspirate_retract_y_position": 0,
"aspirate_submerge_delay_seconds": null,
"aspirate_submerge_speed": null,
"aspirate_touchTip_checkbox": false,
Expand All @@ -188,6 +193,11 @@
"dispense_mix_times": null,
"dispense_mix_volume": null,
"dispense_mmFromBottom": null,
"dispense_retract_delay_seconds": null,
"dispense_retract_mmFromBottom": null,
"dispense_retract_speed": null,
"dispense_retract_x_position": 0,
"dispense_retract_y_position": 0,
"dispense_submerge_delay_seconds": null,
"dispense_submerge_speed": null,
"dispense_touchTip_checkbox": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@
"aspirate_mix_times": 3,
"aspirate_mix_volume": "2",
"aspirate_mmFromBottom": 1,
"aspirate_retract_delay_seconds": null,
"aspirate_retract_mmFromBottom": null,
"aspirate_retract_speed": null,
"aspirate_retract_x_position": 0,
"aspirate_retract_y_position": 0,
"aspirate_submerge_delay_seconds": null,
"aspirate_submerge_speed": null,
"aspirate_touchTip_checkbox": true,
Expand All @@ -145,6 +150,11 @@
"dispense_mix_times": 2,
"dispense_mix_volume": "3",
"dispense_mmFromBottom": 2.5,
"dispense_retract_delay_seconds": null,
"dispense_retract_mmFromBottom": null,
"dispense_retract_speed": null,
"dispense_retract_x_position": 0,
"dispense_retract_y_position": 0,
"dispense_submerge_delay_seconds": null,
"dispense_submerge_speed": null,
"dispense_touchTip_checkbox": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
"aspirate_mix_times": null,
"aspirate_mix_volume": null,
"aspirate_mmFromBottom": 29,
"aspirate_retract_delay_seconds": null,
"aspirate_retract_mmFromBottom": null,
"aspirate_retract_speed": null,
"aspirate_retract_x_position": 0,
"aspirate_retract_y_position": 0,
"aspirate_submerge_delay_seconds": null,
"aspirate_submerge_speed": null,
"aspirate_touchTip_checkbox": false,
Expand All @@ -89,6 +94,11 @@
"dispense_mix_times": null,
"dispense_mix_volume": null,
"dispense_mmFromBottom": null,
"dispense_retract_delay_seconds": null,
"dispense_retract_mmFromBottom": null,
"dispense_retract_speed": null,
"dispense_retract_x_position": 0,
"dispense_retract_y_position": 0,
"dispense_submerge_delay_seconds": null,
"dispense_submerge_speed": null,
"dispense_touchTip_checkbox": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@
"aspirate_mix_times": null,
"aspirate_mix_volume": null,
"aspirate_mmFromBottom": null,
"aspirate_retract_delay_seconds": null,
"aspirate_retract_mmFromBottom": null,
"aspirate_retract_speed": null,
"aspirate_retract_x_position": 0,
"aspirate_retract_y_position": 0,
"aspirate_submerge_delay_seconds": null,
"aspirate_submerge_speed": null,
"aspirate_touchTip_checkbox": false,
Expand All @@ -88,6 +93,11 @@
"dispense_mix_times": null,
"dispense_mix_volume": null,
"dispense_mmFromBottom": null,
"dispense_retract_delay_seconds": null,
"dispense_retract_mmFromBottom": null,
"dispense_retract_speed": null,
"dispense_retract_x_position": 0,
"dispense_retract_y_position": 0,
"dispense_submerge_delay_seconds": null,
"dispense_submerge_speed": null,
"dispense_touchTip_checkbox": false,
Expand Down Expand Up @@ -124,6 +134,11 @@
"aspirate_mix_times": null,
"aspirate_mix_volume": null,
"aspirate_mmFromBottom": null,
"aspirate_retract_delay_seconds": null,
"aspirate_retract_mmFromBottom": null,
"aspirate_retract_speed": null,
"aspirate_retract_x_position": 0,
"aspirate_retract_y_position": 0,
"aspirate_submerge_delay_seconds": null,
"aspirate_submerge_speed": null,
"aspirate_touchTip_checkbox": false,
Expand All @@ -150,6 +165,11 @@
"dispense_mix_times": null,
"dispense_mix_volume": null,
"dispense_mmFromBottom": null,
"dispense_retract_delay_seconds": null,
"dispense_retract_mmFromBottom": null,
"dispense_retract_speed": null,
"dispense_retract_x_position": 0,
"dispense_retract_y_position": 0,
"dispense_submerge_delay_seconds": null,
"dispense_submerge_speed": null,
"dispense_touchTip_checkbox": false,
Expand Down
4 changes: 3 additions & 1 deletion protocol-designer/src/assets/localization/en/modal.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@
"dispense_touchTip_mmFromTop": "Change from where in the well the robot performs the touch tip.",
"mix_touchTip_mmFromTop": "Change from where in the well the robot performs the touch tip.",
"aspirate_delay_mmFromBottom": "Change from where in the well the robot delays after aspirating.",
"dispense_delay_mmFromBottom": "Change from where in the well the robot delays after dispensing."
"dispense_delay_mmFromBottom": "Change from where in the well the robot delays after dispensing.",
"aspirate_retract_mmFromBottom": "Change where in the well the robot retracts the tip to.",
"dispense_retract_mmFromBottom": "Change where in the well the robot retracts the tip from."
},
"field_titles": {
"z_position": "Z position",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@
"protocol_timeline": "Protocol timeline",
"rename": "Rename",
"rename_error": "Oops! Your step name is too long.",
"retract": "Retract",
"retract_speed": "Retract speed",
"save_errors": "{{stepType}} has been saved with {{numErrors}} error(s)",
"save_no_errors": "{{stepType}} has been saved",
"save_warnings": "{{stepType}} has been saved with {{numWarnings}} warning(s)",
Expand Down Expand Up @@ -147,5 +149,6 @@
"well_name": "Well {{wellName}}",
"well_order_title": "{{prefix}} well order",
"well_position": "Well position: X {{x}} Y {{y}} Z {{z}} (mm)",
"well_position_xyz": "Well position (x,y,z): {{x}}mm, {{y}}mm, {{z}}mm",
"unknown_module": "Unknown module"
}
4 changes: 4 additions & 0 deletions protocol-designer/src/assets/localization/en/tooltip.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
"aspirate_mmFromBottom": "Adjust tip position for aspirate",
"aspirate_touchTip_checkbox": "Touch tip to each side of the well after aspirating",
"aspirate_touchTip_mmFromTop": "Distance from the top of the well",
"aspirate_retract": "Withdraw the tip from the liquid after aspirating",
"aspirate_retract_mmFromBottom": "Adjust tip position for retract after aspirate",
"aspirate_submerge": "Lower the tip into the liquid before aspirating",
"aspirate_wells": "First select a source labware",
"blowout_checkbox": "Blow extra air through the tip",
Expand All @@ -51,6 +53,8 @@
"dispense_labware": "Pipette unable to access labware in staging area",
"dispense_mix_checkbox": "Aspirate and dispense repeatedly after main dispense",
"dispense_mmFromBottom": "Adjust tip position for dispense",
"dispense_retract": "Withdraw the tip from the liquid after dispensing",
"dispense_retract_mmFromBottom": "Adjust tip position for retract after dispense",
"dispense_submerge": "Lower the tip into the liquid before dispensing",
"dispense_touchTip_checkbox": "Touch tip to each side of the well after dispensing",
"dispense_touchTip_mmFromTop": "Distance from the top of the well",
Expand Down
26 changes: 26 additions & 0 deletions protocol-designer/src/form-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ export type StepFieldName = string
// | 'aspirate_mix_times'
// | 'aspirate_mix_volume'
// | 'aspirate_mmFromBottom'
// | 'aspirate_retract_delay_seconds'
// | 'aspirate_retract_mmFromBottom'
// | 'aspirate_retract_speed'
// | 'aspirate_retract_x_position'
// | 'aspirate_retract_y_position'
// | 'aspirate_submerge_delay_seconds'
// | 'aspirate_submerge_speed'
// | 'aspirate_touchTip_checkbox'
Expand All @@ -53,6 +58,11 @@ export type StepFieldName = string
// | 'dispense_mix_times'
// | 'dispense_mix_volume'
// | 'dispense_mmFromBottom'
// | 'dispense_retract_delay_seconds'
// | 'dispense_retract_mmFromBottom'
// | 'dispense_retract_speed'
// | 'dispense_retract_x_position'
// | 'dispense_retract_y_position'
// | 'dispense_submerge_delay_seconds'
// | 'dispense_submerge_speed'
// | 'dispense_touchTip_checkbox'
Expand Down Expand Up @@ -256,6 +266,11 @@ export interface HydratedMoveLiquidFormData extends AnnotationFields {
aspirate_mix_times?: number | null
aspirate_mix_volume?: number | null
aspirate_mmFromBottom?: number | null
aspirate_retract_delay_seconds?: number | null
aspirate_retract_mmFromBottom?: number | null
aspirate_retract_speed?: number | null
aspirate_retract_x_position?: number | null
aspirate_retract_y_position?: number | null
aspirate_submerge_delay_seconds?: number | null
aspirate_submerge_speed?: number | null
aspirate_touchTip_mmFromTop?: number | null
Expand All @@ -272,6 +287,11 @@ export interface HydratedMoveLiquidFormData extends AnnotationFields {
dispense_mix_times?: number | null
dispense_mix_volume?: number | null
dispense_mmFromBottom?: number | null
dispense_retract_delay_seconds?: number | null
dispense_retract_mmFromBottom?: number | null
dispense_retract_speed?: number | null
dispense_retract_x_position?: number | null
dispense_retract_y_position?: number | null
dispense_submerge_delay_seconds?: number | null
dispense_submerge_speed?: number | null
dispense_touchTip_mmFromTop?: number | null
Expand Down Expand Up @@ -411,16 +431,22 @@ export type TipZOffsetFields =
| 'aspirate_delay_mmFromBottom'
| 'dispense_delay_mmFromBottom'
| 'mix_touchTip_mmFromTop'
| 'aspirate_retract_mmFromBottom'
| 'dispense_retract_mmFromBottom'

export type TipYOffsetFields =
| 'aspirate_y_position'
| 'dispense_y_position'
| 'mix_y_position'
| 'aspirate_retract_y_position'
| 'dispense_retract_y_position'

export type TipXOffsetFields =
| 'aspirate_x_position'
| 'dispense_x_position'
| 'mix_x_position'
| 'aspirate_retract_x_position'
| 'dispense_retract_x_position'

export type DelayCheckboxFields =
| 'aspirate_delay_checkbox'
Expand Down
4 changes: 4 additions & 0 deletions protocol-designer/src/load-file/migration/8_5_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@
matchingDispenseLabwareWellDepth,
1
),
aspirate_retract_delay_seconds: null,
dispense_retract_delay_seconds: null,
aspirate_retract_speed: null,
dispense_retract_speed: null,

Check warning on line 102 in protocol-designer/src/load-file/migration/8_5_0.ts

View check run for this annotation

Codecov / codecov/patch

protocol-designer/src/load-file/migration/8_5_0.ts#L99-L102

Added lines #L99 - L102 were not covered by tests
aspirate_submerge_delay_seconds: null,
dispense_submerge_delay_seconds: null,
aspirate_submerge_speed: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,15 @@ export function TipPositionModal(
parseInt(yValue) < PERCENT_RANGE_TO_SHOW_WARNING * yMinWidth)
const isZValueAtBottom = zValue != null && zValue === '0'

const prefixTitle = prefix.includes('retract') ? 'retract' : prefix

return createPortal(
<Modal
marginLeft="0"
type="info"
width="37.125rem"
closeOnOutsideClick
title={t('shared:tip_position', { prefix })}
title={t('shared:tip_position', { prefix: prefixTitle })}
onClose={handleCancel}
footer={
<Flex
Expand Down
2 changes: 2 additions & 0 deletions protocol-designer/src/organisms/TipPositionModal/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export function getDefaultMmFromEdge(args: { name: StepFieldName }): number {
case 'dispense_delay_mmFromBottom':
case 'aspirate_delay_mmFromBottom':
case 'aspirate_mmFromBottom':
case 'aspirate_retract_mmFromBottom':
case 'dispense_retract_mmFromBottom':
return DEFAULT_MM_OFFSET_FROM_BOTTOM

default:
Expand Down
Loading
Loading