Skip to content

Commit

Permalink
feat(app): highlight ODD tappable labware
Browse files Browse the repository at this point in the history
adds a labware highlight outline to tappable labware on the ODD labware map view modal

closes PLAT-371
  • Loading branch information
brenthagen committed Jul 23, 2024
1 parent d61e4bf commit f50ade5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export function LabwareMapViewModal(
handleLabwareClick(topLabwareDefinition, topLabwareId)
}
: undefined,
highlightLabware: true,
moduleChildren: null,
}
})
Expand All @@ -105,6 +106,7 @@ export function LabwareMapViewModal(
handleLabwareClick(topLabwareDefinition, topLabwareId)
},
labwareChildren: null,
highlight: true,
}
}
)
Expand Down
6 changes: 6 additions & 0 deletions components/src/hardware-sim/BaseDeck/BaseDeck.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export interface LabwareOnDeck {
/** generic prop to render self-positioned children for each labware */
labwareChildren?: React.ReactNode
onLabwareClick?: () => void
highlight?: boolean
}

export interface ModuleOnDeck {
Expand All @@ -65,6 +66,7 @@ export interface ModuleOnDeck {
/** generic prop to render self-positioned children for each module */
moduleChildren?: React.ReactNode
onLabwareClick?: () => void
highlightLabware?: boolean
}
interface BaseDeckProps {
deckConfig: DeckConfiguration
Expand Down Expand Up @@ -240,6 +242,7 @@ export function BaseDeck(props: BaseDeckProps): JSX.Element {
innerProps,
moduleChildren,
onLabwareClick,
highlightLabware,
}) => {
const slotPosition = getPositionFromSlotId(
moduleLocation.slotName,
Expand All @@ -266,6 +269,7 @@ export function BaseDeck(props: BaseDeckProps): JSX.Element {
inferModuleOrientationFromXCoordinate(slotPosition[0]) ===
'left' && moduleModel === HEATERSHAKER_MODULE_V1
}
highlight={highlightLabware}
/>
) : null}
{moduleChildren}
Expand All @@ -281,6 +285,7 @@ export function BaseDeck(props: BaseDeckProps): JSX.Element {
wellFill,
missingTips,
onLabwareClick,
highlight,
}) => {
if (
labwareLocation === 'offDeck' ||
Expand Down Expand Up @@ -308,6 +313,7 @@ export function BaseDeck(props: BaseDeckProps): JSX.Element {
onLabwareClick={onLabwareClick}
wellFill={wellFill ?? undefined}
missingTips={missingTips}
highlight={highlight}
/>
{labwareChildren}
</g>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export function LabwareOutline(props: LabwareOutlineProps): JSX.Element {
<feGaussianBlur stdDeviation="6" />
</filter>
</defs>
{/* TODO(bh, 2024-07-22): adjust gaussian blur for stacks */}
<LabwareBorder
borderThickness={1.5 * OUTLINE_THICKNESS_MM}
xDimension={dimensions.xDimension}
Expand All @@ -56,7 +57,7 @@ export function LabwareOutline(props: LabwareOutlineProps): JSX.Element {
ry="8"
/>
<LabwareBorder
borderThickness={1.5 * OUTLINE_THICKNESS_MM}
borderThickness={2.2 * OUTLINE_THICKNESS_MM}
xDimension={dimensions.xDimension}
yDimension={dimensions.yDimension}
stroke={COLORS.blue50}
Expand Down

0 comments on commit f50ade5

Please sign in to comment.