Skip to content

Commit e1b6afa

Browse files
ncdiehl11TamarZanzouri
authored andcommitted
fix(protocol-designer, step-generation): update prewet behavior in PD (#17433)
This PR adds prewet to distribute, and updates the logic for when to use prewet for all compound liquid handling command creators. The prewet volume should always be set to the volume of the aspiration that is about to be called (including disposal volume for `distribute`). Prewet commands should be emmitted anytime a new tip is used for an aspiration. Also, I update the UI for the prewet form field in MoveLiquidTools Closes AUTH-908
1 parent 27c5045 commit e1b6afa

File tree

9 files changed

+277
-25
lines changed

9 files changed

+277
-25
lines changed

protocol-designer/src/assets/localization/en/tooltip.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"newLocation": "New location to move the selected labware",
6666
"nozzles": "Partial pickup requires a tip rack directly on the deck. Full rack pickup requires the Flex 96 Tip Rack Adapter.",
6767
"pipette": "Select the pipette you want to use",
68-
"preWetTip": "Pre-wet by aspirating and dispensing 2/3 of the tip’s max volume",
68+
"preWetTip": "Pre-wet by aspirating and dispensing the total aspiration volume",
6969
"setTemperature": "Select the temperature to set your module to",
7070
"wells": "Select wells",
7171
"volume": "Volume to dispense in each well"

protocol-designer/src/molecules/ToggleStepFormField/index.tsx

+21-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {
22
ALIGN_CENTER,
3+
Check,
34
COLORS,
45
DIRECTION_COLUMN,
56
Flex,
@@ -16,12 +17,13 @@ import { ToggleButton } from '../../atoms/ToggleButton'
1617
interface ToggleStepFormFieldProps {
1718
title: string
1819
isSelected: boolean
19-
onLabel: string
20-
offLabel: string
2120
toggleUpdateValue: (value: unknown) => void
2221
toggleValue: unknown
2322
tooltipContent: string | null
24-
isDisabled: boolean
23+
isDisabled?: boolean
24+
onLabel?: string
25+
offLabel?: string
26+
toggleElement?: 'toggle' | 'checkbox'
2527
}
2628
export function ToggleStepFormField(
2729
props: ToggleStepFormFieldProps
@@ -34,34 +36,32 @@ export function ToggleStepFormField(
3436
toggleUpdateValue,
3537
toggleValue,
3638
tooltipContent,
37-
isDisabled,
39+
isDisabled = false,
40+
toggleElement = 'toggle',
3841
} = props
3942
const [targetProps, tooltipProps] = useHoverTooltip()
4043

4144
return (
4245
<>
4346
<ListButton
4447
type="noActive"
45-
padding={SPACING.spacing12}
48+
padding={SPACING.spacing16}
4649
onClick={() => {
4750
if (!isDisabled) {
4851
toggleUpdateValue(!toggleValue)
4952
}
5053
}}
5154
disabled={isDisabled}
5255
>
53-
{tooltipContent != null ? (
54-
<Tooltip tooltipProps={tooltipProps}>{tooltipContent}</Tooltip>
55-
) : null}
56-
57-
<Flex width="100%" flexDirection={DIRECTION_COLUMN} {...targetProps}>
56+
<Flex width="100%" flexDirection={DIRECTION_COLUMN}>
5857
<Flex
5958
justifyContent={JUSTIFY_SPACE_BETWEEN}
6059
alignItems={ALIGN_CENTER}
6160
>
6261
<StyledText
6362
desktopStyle="bodyDefaultRegular"
6463
color={isDisabled ? COLORS.grey40 : COLORS.black90}
64+
{...targetProps}
6565
>
6666
{title}
6767
</StyledText>
@@ -72,15 +72,21 @@ export function ToggleStepFormField(
7272
>
7373
{isSelected ? onLabel : offLabel}
7474
</StyledText>
75-
<ToggleButton
76-
disabled={isDisabled}
77-
label={isSelected ? onLabel : offLabel}
78-
toggledOn={isSelected}
79-
/>
75+
{toggleElement === 'toggle' ? (
76+
<ToggleButton
77+
label={isSelected ? onLabel : offLabel}
78+
toggledOn={isSelected}
79+
/>
80+
) : (
81+
<Check color={COLORS.blue50} isChecked={isSelected} />
82+
)}
8083
</Flex>
8184
</Flex>
8285
</Flex>
8386
</ListButton>
87+
{tooltipContent != null ? (
88+
<Tooltip tooltipProps={tooltipProps}>{tooltipContent}</Tooltip>
89+
) : null}
8490
</>
8591
)
8692
}

protocol-designer/src/pages/Designer/ProtocolSteps/StepForm/PipetteFields/LabwareField.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export function LabwareField(props: FieldProps): JSX.Element {
3131
onExit={() => {
3232
dispatch(hoverSelection({ id: null, text: null }))
3333
}}
34+
width="100%"
3435
/>
3536
)
3637
}

protocol-designer/src/pages/Designer/ProtocolSteps/StepForm/StepFormToolbox.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ export function StepFormToolbox(props: StepFormToolboxProps): JSX.Element {
360360
</StyledText>
361361
</Flex>
362362
}
363+
width="21.875rem"
363364
>
364365
<div
365366
ref={toolsComponentRef}

protocol-designer/src/pages/Designer/ProtocolSteps/StepForm/StepTools/MoveLiquidTools/index.tsx

+7-5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
import {
2828
CheckboxExpandStepFormField,
2929
InputStepFormField,
30+
ToggleStepFormField,
3031
} from '../../../../../../molecules'
3132
import {
3233
BlowoutLocationField,
@@ -398,15 +399,16 @@ export function MoveLiquidTools(props: StepFormProps): JSX.Element {
398399
{t('protocol_steps:advanced_settings')}
399400
</StyledText>
400401
{tab === 'aspirate' ? (
401-
<CheckboxExpandStepFormField
402+
<ToggleStepFormField
402403
title={i18n.format(
403404
t('form:step_edit_form.field.preWetTip.label'),
404405
'capitalize'
405406
)}
406-
checkboxValue={propsForFields.preWetTip.value}
407-
isChecked={propsForFields.preWetTip.value === true}
408-
checkboxUpdateValue={propsForFields.preWetTip.updateValue}
409-
tooltipText={propsForFields.preWetTip.tooltipContent}
407+
toggleValue={propsForFields.preWetTip.value}
408+
isSelected={propsForFields.preWetTip.value === true}
409+
toggleUpdateValue={propsForFields.preWetTip.updateValue}
410+
toggleElement="checkbox"
411+
tooltipContent={propsForFields.preWetTip.tooltipContent ?? null}
410412
/>
411413
) : null}
412414
<CheckboxExpandStepFormField

0 commit comments

Comments
 (0)