Skip to content

Commit

Permalink
fix(app): fix multi-location tip selection during error recovery (#17454
Browse files Browse the repository at this point in the history
)

Closes RQA-3927
  • Loading branch information
mjhuff authored Feb 6, 2025
1 parent 71bfaf6 commit 741382d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export function TipSelection(props: TipSelectionProps): JSX.Element {
relevantActiveNozzleLayout
)}
allowSelect={allowTipSelection}
allowMultiDrag={false}
/>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ describe('TipSelection', () => {
channels:
props.failedPipetteUtils.failedPipetteInfo?.data.channels ?? 1,
allowSelect: props.allowTipSelection,
allowMultiDrag: false,
pipetteNozzleDetails: undefined,
}),
{}
Expand Down
17 changes: 13 additions & 4 deletions app/src/organisms/WellSelection/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useState } from 'react'
import reduce from 'lodash/reduce'
import pick from 'lodash/pick'

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

export function WellSelection(props: WellSelectionProps): JSX.Element {
Expand All @@ -40,6 +43,7 @@ export function WellSelection(props: WellSelectionProps): JSX.Element {
channels,
pipetteNozzleDetails,
allowSelect = true,
allowMultiDrag = true,
} = props
const [highlightedWells, setHighlightedWells] = useState<WellGroup>({})

Expand All @@ -61,16 +65,21 @@ export function WellSelection(props: WellSelectionProps): JSX.Element {
})
if (!wellSet) {
return acc
} else if (allowMultiDrag) {
return { ...acc, [wellSet[0]]: null }
} else {
return { [wellSet[0]]: null }
}
return { ...acc, [wellSet[0]]: null }
},
{}
)
return primaryWells
} else {
// single-channel or ingred selection mode
return allowMultiDrag
? selectedWells
: pick(selectedWells, Object.keys(selectedWells)[0])
}

// single-channel or ingred selection mode
return selectedWells
}

const _getWellsFromRect: (rect: GenericRect) => WellGroup = rect => {
Expand Down

0 comments on commit 741382d

Please sign in to comment.