Skip to content

Commit 741382d

Browse files
authored
fix(app): fix multi-location tip selection during error recovery (#17454)
Closes RQA-3927
1 parent 71bfaf6 commit 741382d

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

app/src/organisms/ErrorRecoveryFlows/shared/TipSelection.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export function TipSelection(props: TipSelectionProps): JSX.Element {
3737
relevantActiveNozzleLayout
3838
)}
3939
allowSelect={allowTipSelection}
40+
allowMultiDrag={false}
4041
/>
4142
)
4243
}

app/src/organisms/ErrorRecoveryFlows/shared/__tests__/TipSelection.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ describe('TipSelection', () => {
4242
channels:
4343
props.failedPipetteUtils.failedPipetteInfo?.data.channels ?? 1,
4444
allowSelect: props.allowTipSelection,
45+
allowMultiDrag: false,
4546
pipetteNozzleDetails: undefined,
4647
}),
4748
{}

app/src/organisms/WellSelection/index.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useState } from 'react'
22
import reduce from 'lodash/reduce'
3+
import pick from 'lodash/pick'
34

45
import { COLORS, Labware, RobotCoordinateSpace } from '@opentrons/components'
56
import {
@@ -29,6 +30,8 @@ interface WellSelectionProps {
2930
pipetteNozzleDetails?: NozzleLayoutDetails
3031
/* Whether highlighting and selectWells() updates are permitted. */
3132
allowSelect?: boolean
33+
/* Whether selecting more than the channel count of well locations is permitted. */
34+
allowMultiDrag?: boolean
3235
}
3336

3437
export function WellSelection(props: WellSelectionProps): JSX.Element {
@@ -40,6 +43,7 @@ export function WellSelection(props: WellSelectionProps): JSX.Element {
4043
channels,
4144
pipetteNozzleDetails,
4245
allowSelect = true,
46+
allowMultiDrag = true,
4347
} = props
4448
const [highlightedWells, setHighlightedWells] = useState<WellGroup>({})
4549

@@ -61,16 +65,21 @@ export function WellSelection(props: WellSelectionProps): JSX.Element {
6165
})
6266
if (!wellSet) {
6367
return acc
68+
} else if (allowMultiDrag) {
69+
return { ...acc, [wellSet[0]]: null }
70+
} else {
71+
return { [wellSet[0]]: null }
6472
}
65-
return { ...acc, [wellSet[0]]: null }
6673
},
6774
{}
6875
)
6976
return primaryWells
77+
} else {
78+
// single-channel or ingred selection mode
79+
return allowMultiDrag
80+
? selectedWells
81+
: pick(selectedWells, Object.keys(selectedWells)[0])
7082
}
71-
72-
// single-channel or ingred selection mode
73-
return selectedWells
7483
}
7584

7685
const _getWellsFromRect: (rect: GenericRect) => WellGroup = rect => {

0 commit comments

Comments
 (0)