Skip to content

Commit

Permalink
fix(protocol-designer): fix OffDeckDetails container flicker (#17479)
Browse files Browse the repository at this point in the history
Refactors padding logic in PD `OffDeckDetails` outer container to
justify right with padding, rather than justifying center and
dynamically calculating left padding based on the presence of the
details element. This prevents flickering when hovering an added offdeck
labware

Closes RQA-3953
  • Loading branch information
ncdiehl11 authored Feb 10, 2025
1 parent 8b833e7 commit e734350
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions protocol-designer/src/pages/Designer/OffDeck/OffDeckDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
EmptySelectorButton,
Flex,
JUSTIFY_CENTER,
JUSTIFY_FLEX_END,
LabwareRender,
OVERFLOW_AUTO,
RobotWorkSpace,
Expand Down Expand Up @@ -59,27 +60,19 @@ export function OffDeckDetails(props: OffDeckDetailsProps): JSX.Element {
)
const containerWidth = tab === 'startingDeck' ? '100vw' : '75vw'

const paddingLeftWithHover =
hoverSlot == null
? `calc((${containerWidth} - (${SPACING.spacing24} * 2) - ${OFF_DECK_MAP_WIDTH}) / 2)`
: SPACING.spacing24
const paddingLeft = tab === 'startingDeck' ? paddingLeftWithHover : undefined
const padding =
tab === 'protocolSteps'
? SPACING.spacing24
: `${SPACING.spacing40} ${paddingLeft}`
const stepDetailsContainerWidth = `calc(((${containerWidth} - ${OFF_DECK_MAP_WIDTH}) / 2) - (${SPACING.spacing24} * 3))`
const paddingRight = `calc((100% - ${OFF_DECK_MAP_WIDTH}) / 2)`

return (
<Flex
backgroundColor={COLORS.white}
borderRadius={BORDERS.borderRadius12}
width="100%"
height="100%"
padding={padding}
padding={`${SPACING.spacing40} ${paddingRight} ${SPACING.spacing40} 0`}
gridGap={SPACING.spacing24}
alignItems={ALIGN_CENTER}
justifyContent={JUSTIFY_CENTER}
justifyContent={JUSTIFY_FLEX_END}
>
{hoverSlot != null ? (
<Flex width={stepDetailsContainerWidth} height="6.25rem">
Expand Down

0 comments on commit e734350

Please sign in to comment.