Skip to content

Commit 3a74465

Browse files
authored
fix(protocol-designer): fix height and padding in ProtocolSteps (#19140)
This PR fixes the max height of `ProtocolSteps` container in the `Designer` component to account for the NavBar height and exclude excess scrollable white space at the bottom of the container. It also fixes the padding logic in `ProtocolSteps` to show '0' padding if there are timeline errors (since the Export button is no longer position ed relatively)
1 parent a3caaab commit 3a74465

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

protocol-designer/src/pages/Designer/ProtocolSteps/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import {
2525
OT2_ROBOT_TYPE,
2626
} from '@opentrons/shared-data'
2727

28-
import { NAV_BAR_HEIGHT_REM } from '../../../components/atoms'
2928
import { ExportButton, HotKeyDisplay } from '../../../components/molecules'
3029
import {
3130
SlotDetailsContainer,
@@ -234,7 +233,6 @@ export function ProtocolSteps({
234233

235234
<Flex
236235
backgroundColor={COLORS.grey10}
237-
maxHeight={`calc(100vh - ${NAV_BAR_HEIGHT_REM}rem)`}
238236
width="100%"
239237
minHeight={FLEX_MAX_CONTENT}
240238
>
@@ -272,7 +270,7 @@ export function ProtocolSteps({
272270
<Flex
273271
justifyContent={JUSTIFY_END}
274272
position={POSITION_ABSOLUTE}
275-
right="0"
273+
right={SPACING.spacing24}
276274
zIndex={1000}
277275
>
278276
<ExportButton onClick={handleExporting} />
@@ -291,7 +289,9 @@ export function ProtocolSteps({
291289
: CONTENT_MAX_WIDTH
292290
}
293291
justifyContent={JUSTIFY_CENTER}
294-
paddingTop={isZoomedIn ? '0' : SPACING.spacing60}
292+
paddingTop={
293+
isZoomedIn || showTimelineAlerts ? '0' : SPACING.spacing60
294+
}
295295
marginX="auto"
296296
>
297297
{isZoomedIn || selectedTerminalItemId === HARDWARE_ID ? null : (

protocol-designer/src/pages/Designer/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
useOnClickOutside,
1111
} from '@opentrons/components'
1212

13+
import { NAV_BAR_HEIGHT_REM } from '../../components/atoms/constants'
1314
import { DefineLiquidsModal } from '../../components/organisms'
1415
import { useKitchen } from '../../components/organisms/Kitchen/hooks'
1516
import { LiquidsOverflowMenu } from '../../components/organisms/LiquidsOverflowMenu'
@@ -101,7 +102,12 @@ export function Designer(): JSX.Element {
101102
targetWidth={targetWidth}
102103
/>
103104
) : null}
104-
<Flex height="100%" width="100%" overflowY={OVERFLOW_HIDDEN}>
105+
<Flex
106+
height="100%"
107+
maxHeight={`calc(100vh - ${NAV_BAR_HEIGHT_REM}rem )`}
108+
width="100%"
109+
overflowY={OVERFLOW_HIDDEN}
110+
>
105111
<ProtocolSteps
106112
zoomedInSlot={zoomIn.slot}
107113
showLiquidOverflowMenu={showLiquidOverflowMenu}

0 commit comments

Comments
 (0)