Skip to content

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jerader committed Jan 29, 2025
1 parent e70cb18 commit c6f5f64
Show file tree
Hide file tree
Showing 14 changed files with 87 additions and 95 deletions.
2 changes: 1 addition & 1 deletion app/src/assets/localization/en/quick_transfer.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
"touch_tip_position_mm": "Touch tip position from top of well (mm)",
"touch_tip_value": "{{position}} mm from bottom",
"use_deck_slots": "<block>Quick transfers use deck slots B2-D2. These slots hold a tip rack, a source labware, and a destination labware.</block><block>Make sure that your deck configuration is up to date to avoid collisions.</block>",
"value_out_of_range": "Value must be between {{min}}-{{max}}",
"value_out_of_range": "Value must be between {{min}} to {{max}}",
"too_many_pins_body": "Remove a quick transfer in order to add more transfers to your pinned list.",
"too_many_pins_header": "You've hit your max!",
"transfer_analysis_failed": "quick transfer analysis failed",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ describe('TouchTip', () => {
expect(vi.mocked(InputField)).toHaveBeenCalledWith(
{
title: 'Touch tip position from top of well (mm)',
error: 'Value must be between -25-0',
error: 'Value must be between -25 to 0',
readOnly: true,
type: 'number',
value: -98,
Expand All @@ -171,7 +171,7 @@ describe('TouchTip', () => {
expect(vi.mocked(InputField)).toHaveBeenCalledWith(
{
title: 'Touch tip position from top of well (mm)',
error: 'Value must be between -100-0',
error: 'Value must be between -100 to 0',
readOnly: true,
type: 'number',
value: 1,
Expand Down
16 changes: 4 additions & 12 deletions protocol-designer/src/organisms/TipPositionModal/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,18 @@ export function getDefaultMmFromEdge(args: { name: StepFieldName }): number {
const { name } = args

switch (name) {
case 'aspirate_mmFromBottom':
return DEFAULT_MM_OFFSET_FROM_BOTTOM

case 'aspirate_delay_mmFromBottom':
return DEFAULT_MM_OFFSET_FROM_BOTTOM

case 'mix_mmFromBottom':
case 'dispense_mmFromBottom':
return DEFAULT_MM_OFFSET_FROM_BOTTOM

case 'dispense_delay_mmFromBottom':
return DEFAULT_MM_OFFSET_FROM_BOTTOM

case 'mix_mmFromBottom':
case 'aspirate_delay_mmFromBottom':
case 'aspirate_mmFromBottom':
return DEFAULT_MM_OFFSET_FROM_BOTTOM

default:
// touch tip fields
console.assert(
getIsTouchTipField(name),
`getDefaultMmFromBottom fn does not know what to do with field ${name}`
`getDefaultMmFromEdge fn does not know what to do with field ${name}`
)
return DEFAULT_MM_TOUCH_TIP_OFFSET_FROM_TOP
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const mixFormToArgs = (
)
const touchTip = Boolean(hydratedFormData.mix_touchTip_checkbox)
const touchTipMmFromTop =
hydratedFormData.mix_touchTip_mmFromTop ||
hydratedFormData.mix_touchTip_mmFromTop ??
DEFAULT_MM_TOUCH_TIP_OFFSET_FROM_TOP
const volume = hydratedFormData.volume || 0
const times = hydratedFormData.times || 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@ export const moveLiquidFormToArgs = (
hydratedFormData.aspirate_touchTip_checkbox
)
const touchTipAfterAspirateOffsetMmFromTop =
hydratedFormData.aspirate_touchTip_mmFromTop ||
hydratedFormData.aspirate_touchTip_mmFromTop ??
DEFAULT_MM_TOUCH_TIP_OFFSET_FROM_TOP
const touchTipAfterDispense = Boolean(
hydratedFormData.dispense_touchTip_checkbox
)
const touchTipAfterDispenseOffsetMmFromTop =
hydratedFormData.dispense_touchTip_mmFromTop ||
hydratedFormData.dispense_touchTip_mmFromTop ??
DEFAULT_MM_TOUCH_TIP_OFFSET_FROM_TOP
const mixBeforeAspirate = getMixData(
hydratedFormData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,14 @@ describe('move liquid step form -> command creator args', () => {
},
{
checkboxField: 'dispense_touchTip_checkbox',
formFields: { dispense_touchTip_mmFromTop: -42 },
formFields: { dispense_touchTip_mmFromTop: -22 },
expectedArgsUnchecked: {
touchTipAfterDispense: false,
touchTipAfterDispenseOffsetMmFromTop: -42,
touchTipAfterDispenseOffsetMmFromTop: -22,
},
expectedArgsChecked: {
touchTipAfterDispense: true,
touchTipAfterDispenseOffsetMmFromTop: -42,
touchTipAfterDispenseOffsetMmFromTop: -22,
},
},
// MIXES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ describe('generateSubstepItem', () => {
volume: 50,
times: 2,
touchTip: false,
touchTipMmFromTop: 5,
touchTipMmFromTop: -5,
changeTip: 'always',
blowoutLocation: null,
blowoutFlowRateUlSec: 3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ describe('generateRobotStateTimeline', () => {
dispenseAirGapVolume: null,
mixInDestination: null,
touchTipAfterAspirate: false,
touchTipAfterAspirateOffsetMmFromTop: 13.81,
touchTipAfterAspirateOffsetMmFromTop: -13.81,
touchTipAfterDispense: false,
touchTipAfterDispenseOffsetMmFromTop: 13.81,
touchTipAfterDispenseOffsetMmFromTop: -13.81,
name: 'transfer',
commandCreatorFnName: 'transfer',
blowoutLocation: null,
Expand Down Expand Up @@ -80,9 +80,9 @@ describe('generateRobotStateTimeline', () => {
dispenseAirGapVolume: null,
mixInDestination: null,
touchTipAfterAspirate: false,
touchTipAfterAspirateOffsetMmFromTop: 13.81,
touchTipAfterAspirateOffsetMmFromTop: -13.81,
touchTipAfterDispense: false,
touchTipAfterDispenseOffsetMmFromTop: 13.81,
touchTipAfterDispenseOffsetMmFromTop: -13.81,
name: 'transfer',
commandCreatorFnName: 'transfer',
blowoutLocation: null,
Expand Down Expand Up @@ -110,7 +110,7 @@ describe('generateRobotStateTimeline', () => {
volume: 5,
times: 2,
touchTip: false,
touchTipMmFromTop: 13.81,
touchTipMmFromTop: -13.81,
changeTip: 'always',
blowoutLocation: null,
pipette: DEFAULT_PIPETTE,
Expand Down
4 changes: 2 additions & 2 deletions protocol-designer/src/ui/steps/__fixtures__/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const getMockMoveLiquidStep = (): SavedStepFormState => ({
aspirate_mix_volume: '5',
aspirate_mmFromBottom: 1,
aspirate_touchTip_checkbox: true,
aspirate_touchTip_mmFromTop: 1,
aspirate_touchTip_mmFromTop: -1,
dispense_flowRate: null,
dispense_labware: 'dispense_labware_id',
dispense_wells: ['A1'],
Expand All @@ -27,7 +27,7 @@ export const getMockMoveLiquidStep = (): SavedStepFormState => ({
dispense_mix_volume: null,
dispense_mmFromBottom: 0.5,
dispense_touchTip_checkbox: true,
dispense_touchTip_mmFromTop: 1,
dispense_touchTip_mmFromTop: -1,
disposalVolume_checkbox: true,
disposalVolume_volume: '20',
blowout_checkbox: true,
Expand Down
10 changes: 5 additions & 5 deletions protocol-designer/src/ui/steps/test/selectors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ describe('_getSavedMultiSelectFieldValues', () => {
isIndeterminate: false,
},
aspirate_touchTip_mmFromTop: {
value: 1,
value: -1,
isIndeterminate: false,
},
// dispense settings
Expand Down Expand Up @@ -570,7 +570,7 @@ describe('_getSavedMultiSelectFieldValues', () => {
isIndeterminate: false,
},
dispense_touchTip_mmFromTop: {
value: 1,
value: -1,
isIndeterminate: false,
},
blowout_checkbox: {
Expand Down Expand Up @@ -760,7 +760,7 @@ describe('_getSavedMultiSelectFieldValues', () => {
},
aspirate_touchTip_mmFromTop: {
isIndeterminate: false,
value: 1,
value: -1,
},
// dispense settings
dispense_labware: {
Expand Down Expand Up @@ -812,7 +812,7 @@ describe('_getSavedMultiSelectFieldValues', () => {
},
dispense_touchTip_mmFromTop: {
isIndeterminate: false,
value: 1,
value: -1,
},
blowout_checkbox: {
isIndeterminate: true,
Expand Down Expand Up @@ -974,7 +974,7 @@ describe('_getSavedMultiSelectFieldValues', () => {
dispense_delay_checkbox: true,
dispense_delay_seconds: '3',
mix_touchTip_checkbox: true,
mix_touchTip_mmFromTop: '14',
mix_touchTip_mmFromTop: '-14',
nozzles: null,
},
}
Expand Down
36 changes: 18 additions & 18 deletions step-generation/src/__tests__/consolidate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ describe('consolidate single-channel', () => {
preWetTip: true,
aspirateDelay: { seconds: 11, mmFromBottom: 15 },
touchTipAfterAspirate: true,
touchTipAfterAspirateOffsetMmFromTop: 14.5,
touchTipAfterAspirateOffsetMmFromTop: -14.5,
aspirateAirGapVolume: 31,
// dispense column
dispenseDelay: { seconds: 12, mmFromBottom: 14 },
Expand Down Expand Up @@ -1209,7 +1209,7 @@ describe('consolidate single-channel', () => {
wellLocation: {
origin: 'top',
offset: {
z: 14.5,
z: -14.5,
},
},
},
Expand Down Expand Up @@ -1302,7 +1302,7 @@ describe('consolidate single-channel', () => {
wellLocation: {
origin: 'top',
offset: {
z: 14.5,
z: -14.5,
},
},
},
Expand Down Expand Up @@ -1451,7 +1451,7 @@ describe('consolidate single-channel', () => {
wellLocation: {
origin: 'top',
offset: {
z: 3.4,
z: -3.4,
},
},
},
Expand Down Expand Up @@ -1568,7 +1568,7 @@ describe('consolidate single-channel', () => {
wellLocation: {
origin: 'top',
offset: {
z: 14.5,
z: -14.5,
},
},
},
Expand Down Expand Up @@ -1717,7 +1717,7 @@ describe('consolidate single-channel', () => {
wellLocation: {
origin: 'top',
offset: {
z: 3.4,
z: -3.4,
},
},
},
Expand Down Expand Up @@ -1773,7 +1773,7 @@ describe('consolidate single-channel', () => {
preWetTip: true,
aspirateDelay: { seconds: 11, mmFromBottom: 15 },
touchTipAfterAspirate: true,
touchTipAfterAspirateOffsetMmFromTop: 14.5,
touchTipAfterAspirateOffsetMmFromTop: -14.5,
aspirateAirGapVolume: 31,
// dispense column
dispenseDelay: { seconds: 12, mmFromBottom: 14 },
Expand Down Expand Up @@ -1908,7 +1908,7 @@ describe('consolidate single-channel', () => {
wellLocation: {
origin: 'top',
offset: {
z: 14.5,
z: -14.5,
},
},
},
Expand Down Expand Up @@ -2001,7 +2001,7 @@ describe('consolidate single-channel', () => {
wellLocation: {
origin: 'top',
offset: {
z: 14.5,
z: -14.5,
},
},
},
Expand Down Expand Up @@ -2165,7 +2165,7 @@ describe('consolidate single-channel', () => {
wellLocation: {
origin: 'top',
offset: {
z: 3.4,
z: -3.4,
},
},
},
Expand Down Expand Up @@ -2282,7 +2282,7 @@ describe('consolidate single-channel', () => {
wellLocation: {
origin: 'top',
offset: {
z: 14.5,
z: -14.5,
},
},
},
Expand Down Expand Up @@ -2446,7 +2446,7 @@ describe('consolidate single-channel', () => {
wellLocation: {
origin: 'top',
offset: {
z: 3.4,
z: -3.4,
},
},
},
Expand Down Expand Up @@ -2499,7 +2499,7 @@ describe('consolidate single-channel', () => {
preWetTip: true,
aspirateDelay: { seconds: 11, mmFromBottom: 15 },
touchTipAfterAspirate: true,
touchTipAfterAspirateOffsetMmFromTop: 14.5,
touchTipAfterAspirateOffsetMmFromTop: -14.5,
aspirateAirGapVolume: 31,
// dispense column
dispenseDelay: { seconds: 12, mmFromBottom: 14 },
Expand Down Expand Up @@ -2634,7 +2634,7 @@ describe('consolidate single-channel', () => {
wellLocation: {
origin: 'top',
offset: {
z: 14.5,
z: -14.5,
},
},
},
Expand Down Expand Up @@ -2727,7 +2727,7 @@ describe('consolidate single-channel', () => {
wellLocation: {
origin: 'top',
offset: {
z: 14.5,
z: -14.5,
},
},
},
Expand Down Expand Up @@ -2891,7 +2891,7 @@ describe('consolidate single-channel', () => {
wellLocation: {
origin: 'top',
offset: {
z: 3.4,
z: -3.4,
},
},
},
Expand Down Expand Up @@ -3051,7 +3051,7 @@ describe('consolidate single-channel', () => {
wellLocation: {
origin: 'top',
offset: {
z: 14.5,
z: -14.5,
},
},
},
Expand Down Expand Up @@ -3215,7 +3215,7 @@ describe('consolidate single-channel', () => {
wellLocation: {
origin: 'top',
offset: {
z: 3.4,
z: -3.4,
},
},
},
Expand Down
Loading

0 comments on commit c6f5f64

Please sign in to comment.