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

Merged
merged 29 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
7336e63
feat(protocol-designer): add retract for aspirate and dispense to PD
Feb 4, 2025
a88d12e
add retract using MultiInputField and update it to show well position…
Feb 4, 2025
334d6fb
remove unused import
Feb 4, 2025
6daac64
add getFields() for submerge/retract fields
Feb 4, 2025
ca190b6
add new type to ListButton and add fields to migration
Feb 5, 2025
caf9a50
add unit test
Feb 5, 2025
ae35542
fix MultiInputField test
Feb 6, 2025
8c2e416
update files to add retract well position fields for the modal
Feb 6, 2025
c6cca8a
update test
Feb 6, 2025
efca52f
add onColor to ListButton stories file
Feb 7, 2025
1649f3a
add test and update fixtures
Feb 10, 2025
d808780
update test to check PositionField component
Feb 10, 2025
4201027
update ListButton test
Feb 10, 2025
90750c0
update MultiInputField test
Feb 10, 2025
04aaf56
update modal.json
Feb 11, 2025
9f049c5
Merge branch 'edge' into pd-retract
syao1226 Feb 11, 2025
b152e8c
Update files with the refactored MoveLiquidTools
Feb 11, 2025
f85b9e3
adding retract position tooltip
Feb 12, 2025
423e45a
fix failing cypress mixSetting test
Feb 12, 2025
34f6dcc
Merge branch 'edge' of https://github.com/Opentrons/opentrons into pd…
Feb 12, 2025
7b5b035
Merge branch 'edge' into pd-retract
syao1226 Feb 12, 2025
1fbb993
add mapping
Feb 21, 2025
2d8c856
remove unuse import
Feb 21, 2025
786c336
update param of addFielldNamePrefix
Feb 21, 2025
683b828
add retract mmFromBotom fields to fieldMap
Feb 21, 2025
ed3ae1f
merge edge
Feb 24, 2025
75277a5
update isWhiteButton to isNested in MultilInputField
Feb 24, 2025
4ed9093
move prefixMap to pd resource utils folder
Feb 24, 2025
49ada9c
update ListButton and add test for prefixMap in utils
Feb 26, 2025
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
2 changes: 1 addition & 1 deletion components/src/atoms/ListButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function ListButton(props: ListButtonProps): JSX.Element {

&:focus-visible {
outline: 2px solid ${COLORS.blue50};
outline-offset: 0.25rem;
outline-offset: 0.125rem;
}
`

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 Down Expand Up @@ -176,6 +181,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 Down Expand Up @@ -208,6 +213,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 Down Expand Up @@ -226,6 +231,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 Down Expand Up @@ -189,6 +194,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 Down Expand Up @@ -146,6 +151,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 Down Expand Up @@ -90,6 +95,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 Down Expand Up @@ -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 Expand Up @@ -126,6 +136,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 Down Expand Up @@ -153,6 +168,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 @@ -148,5 +150,6 @@
"well_order_title": "{{prefix}} well order",
"well_position": "Well position: X {{x}} Y {{y}} Z {{z}} (mm)",
"well_position_z_only": "Well position: 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 @@ -273,6 +288,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 @@ -413,16 +433,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 @@ -17,6 +17,7 @@ import {
InputField,
TYPOGRAPHY,
} from '@opentrons/components'
import { prefixMap } from '../../resources/utils'
import { getIsTouchTipField } from '../../form-types'
import { LINK_BUTTON_STYLE } from '../../atoms'
import { getMainPagePortalEl } from '../Portal'
Expand Down Expand Up @@ -238,7 +239,7 @@ export function TipPositionModal(
type="info"
width="37.125rem"
closeOnOutsideClick
title={t('shared:tip_position', { prefix })}
title={t('shared:tip_position', { prefix: prefixMap[prefix] })}
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