Skip to content

Commit

Permalink
fix(protocol-designer): highlight used wells when selected on step
Browse files Browse the repository at this point in the history
closes AUTH-1190
  • Loading branch information
jerader committed Dec 18, 2024
1 parent c752197 commit fbce3bb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useSelector, useDispatch } from 'react-redux'
import { useTranslation } from 'react-i18next'
import { useConditionalConfirm } from '@opentrons/components'
import {
getHoveredTerminalItemId,
Expand Down Expand Up @@ -28,7 +29,6 @@ import type {
} from '../../../../ui/steps'
import type { TerminalItemId } from '../../../../steplist'
import type { ThunkDispatch } from '../../../../types'
import { useTranslation } from 'react-i18next'

export interface TerminalItemStepProps {
id: TerminalItemId
Expand Down
13 changes: 10 additions & 3 deletions protocol-designer/src/top-selectors/substep-highlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import { ALL, COLUMN, getWellNamePerMultiTip } from '@opentrons/shared-data'
import * as StepGeneration from '@opentrons/step-generation'
import { selectors as stepFormSelectors } from '../step-forms'
import { selectors as fileDataSelectors } from '../file-data'
import { getHoveredStepId, getHoveredSubstep } from '../ui/steps'
import {
getHoveredStepId,
getHoveredSubstep,
getSelectedStepId,
} from '../ui/steps'
import { getWellSetForMultichannel } from '../utils'
import type { WellGroup } from '@opentrons/components'
import type {
Expand All @@ -14,6 +18,7 @@ import type {
import type { PipetteEntity, LabwareEntity } from '@opentrons/step-generation'
import type { Selector } from '../types'
import type { SubstepItemData } from '../steplist/types'
import { getSelectedSubstep } from '../ui/steps/selectors'

Check failure on line 21 in protocol-designer/src/top-selectors/substep-highlight.ts

View workflow job for this annotation

GitHub Actions / js checks

'getSelectedSubstep' is defined but never used

Check failure on line 21 in protocol-designer/src/top-selectors/substep-highlight.ts

View workflow job for this annotation

GitHub Actions / js checks

'getSelectedSubstep' is defined but never used

function _wellsForPipette(
pipetteEntity: PipetteEntity,
Expand Down Expand Up @@ -275,17 +280,19 @@ export const wellHighlightsByLabwareId: Selector<
getHoveredSubstep,
fileDataSelectors.getSubsteps,
stepFormSelectors.getOrderedStepIds,
getSelectedStepId,
(
robotStateTimeline,
invariantContext,
allStepArgsAndErrors,
hoveredStepId,
hoveredSubstep,
substepsById,
orderedStepIds
orderedStepIds,
selectedStepId
) => {
const timeline = robotStateTimeline.timeline
const stepId = hoveredStepId
const stepId = hoveredStepId || selectedStepId
const timelineIndex = orderedStepIds.findIndex(i => i === stepId)
const frame = timeline[timelineIndex]
const robotState = frame && frame.robotState
Expand Down

0 comments on commit fbce3bb

Please sign in to comment.