Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(protocol-designer): fix OffDeckDetails container flicker #17479

Merged
merged 2 commits into from
Feb 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading