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
  • Loading branch information
jerader authored Dec 18, 2024
1 parent c24cdfb commit bc17aa4
Show file tree
Hide file tree
Showing 2 changed files with 10 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
12 changes: 9 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 Down Expand Up @@ -275,17 +279,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 bc17aa4

Please sign in to comment.