Skip to content

Commit 9f3fcfd

Browse files
committed
Merge back 'chore_release-pd-8.5.0' into 'edge' (#19149)
2 parents 50c0277 + 19dfd19 commit 9f3fcfd

File tree

11 files changed

+59
-35
lines changed

11 files changed

+59
-35
lines changed

components/src/molecules/DropdownMenu/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ export function DropdownMenu(props: DropdownMenuProps): JSX.Element {
260260
gridGap={SPACING.spacing8}
261261
width={width}
262262
>
263-
{title !== null ? (
263+
{title != null ? (
264264
<Flex gridGap={SPACING.spacing8} alignItems={ALIGN_CENTER}>
265265
<StyledText
266266
desktopStyle="bodyDefaultRegular"

protocol-designer/src/components/organisms/Ot2Modules/index.tsx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -322,12 +322,7 @@ export function Ot2Modules(): JSX.Element {
322322
) : null}
323323
{changeModuleWarning}
324324
<Flex flexWrap={WRAP} width="100%">
325-
<Flex
326-
flexDirection={DIRECTION_COLUMN}
327-
flex="1.27"
328-
minWidth="30.375rem"
329-
paddingTop={SPACING.spacing120}
330-
>
325+
<Flex flexDirection={DIRECTION_COLUMN} flex="1.27" minWidth="30.375rem">
331326
{filteredSupportedModules.length > 0 ? (
332327
<StyledText
333328
desktopStyle="headingSmallBold"
@@ -416,12 +411,7 @@ export function Ot2Modules(): JSX.Element {
416411
</Flex>
417412
) : null}
418413
</Flex>
419-
<Flex
420-
flex="1.27"
421-
maxHeight="35rem"
422-
minWidth="50%"
423-
paddingTop={SPACING.spacing80}
424-
>
414+
<Flex flex="1.27" maxHeight="35rem" minWidth="50%">
425415
<RobotCoordinateSpaceWithRef
426416
height="100%"
427417
width="100%"

protocol-designer/src/form-types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ export interface HydratedMoveLiquidFormData extends AnnotationFields {
343343
pickUpTip_location?: string | null
344344
pickUpTip_wellNames?: string[] | null
345345
preWetTip?: boolean | null
346-
liquidClass?: string | null
346+
liquidClass?: string | null // a liquid class name like "water" or "none" or null
347347
}
348348

349349
export interface HydratedMoveLabwareFormData extends AnnotationFields {

protocol-designer/src/pages/Designer/DeckSetup/DeckSetupContainer.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,11 @@ export function DeckSetupContainer(
241241
minWidth="auto"
242242
deckDef={deckDef}
243243
viewBox={viewBoxAdjusted}
244-
transform={'scale(1.3, -1.3)'}
244+
transform={
245+
robotType === OT2_ROBOT_TYPE
246+
? 'scale(1.3, -1.3)'
247+
: 'scale(1, -1)'
248+
}
245249
outline="auto"
246250
zoomed={zoomIn.slot != null}
247251
borderRadius={BORDERS.borderRadius12}

protocol-designer/src/pages/Designer/DeckSetup/__tests__/utils.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ describe('getSVGContainerWidth', () => {
129129

130130
it('returns 70% for non-OT2 robot type, not zoomed', () => {
131131
const result = getSVGContainerWidth(FLEX_ROBOT_TYPE, false)
132-
expect(result).toBe('70%')
132+
expect(result).toBe('100%')
133133
})
134134

135135
it('returns 100% for OT2 robot type, and zoomed', () => {

protocol-designer/src/pages/Designer/DeckSetup/utils.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -565,9 +565,6 @@ export const getSVGContainerWidth = (
565565
if (robotType === OT2_ROBOT_TYPE && !isZoomed) {
566566
return '78.5%'
567567
}
568-
if (robotType !== OT2_ROBOT_TYPE && !isZoomed) {
569-
return '70%'
570-
}
571568
return '100%'
572569
}
573570

protocol-designer/src/pages/Designer/ProtocolSteps/StepForm/PipetteFields/PositionField.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ export function PositionField(props: PositionFieldProps): JSX.Element {
109109

110110
const handleOpen = (has3Specs: boolean): void => {
111111
if (
112-
wellDepthMm != null &&
113-
(has3Specs ? wellXWidthMm != null && wellYWidthMm != null : true)
112+
(has3Specs && wellDepthMm && wellXWidthMm && wellYWidthMm) ||
113+
(!has3Specs && wellDepthMm)
114114
) {
115115
setIsModalOpen(true)
116116
}

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

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useMemo, useState } from 'react'
1+
import { useEffect, useMemo, useRef, useState } from 'react'
22
import { useTranslation } from 'react-i18next'
33
import { useDispatch, useSelector } from 'react-redux'
44
import round from 'lodash/round'
@@ -13,6 +13,7 @@ import {
1313
JUSTIFY_END,
1414
JUSTIFY_SPACE_BETWEEN,
1515
OVERFLOW_AUTO,
16+
POSITION_ABSOLUTE,
1617
POSITION_RELATIVE,
1718
SPACING,
1819
StyledText,
@@ -24,7 +25,6 @@ import {
2425
OT2_ROBOT_TYPE,
2526
} from '@opentrons/shared-data'
2627

27-
import { NAV_BAR_HEIGHT_REM } from '../../../components/atoms'
2828
import { ExportButton, HotKeyDisplay } from '../../../components/molecules'
2929
import {
3030
SlotDetailsContainer,
@@ -169,6 +169,23 @@ export function ProtocolSteps({
169169
activeItem?.id !== HARDWARE_ID
170170
const stepDetails = currentStep?.stepDetails ?? null
171171

172+
const stepComponentRef = useRef<HTMLDivElement>(null)
173+
174+
const handleScrollToTop = (): void => {
175+
if (stepComponentRef.current && hasTimelineErrors) {
176+
stepComponentRef.current.scrollIntoView({
177+
behavior: 'smooth',
178+
block: 'start',
179+
})
180+
}
181+
}
182+
183+
useEffect(() => {
184+
if (selectedStepId != null) {
185+
handleScrollToTop()
186+
}
187+
}, [selectedStepId])
188+
172189
let header: string = t(activeItem?.id)
173190
if (currentStep != null) {
174191
header = i18n.format(currentStep.stepName, 'titleCase')
@@ -216,7 +233,6 @@ export function ProtocolSteps({
216233

217234
<Flex
218235
backgroundColor={COLORS.grey10}
219-
maxHeight={`calc(100vh - ${NAV_BAR_HEIGHT_REM}rem)`}
220236
width="100%"
221237
minHeight={FLEX_MAX_CONTENT}
222238
>
@@ -251,7 +267,12 @@ export function ProtocolSteps({
251267
{isZoomedIn ||
252268
formData != null ||
253269
selectedSubstep != null ? null : (
254-
<Flex justifyContent={JUSTIFY_END}>
270+
<Flex
271+
justifyContent={JUSTIFY_END}
272+
position={POSITION_ABSOLUTE}
273+
right={SPACING.spacing24}
274+
zIndex={1000}
275+
>
255276
<ExportButton onClick={handleExporting} />
256277
</Flex>
257278
)}
@@ -268,18 +289,24 @@ export function ProtocolSteps({
268289
: CONTENT_MAX_WIDTH
269290
}
270291
justifyContent={JUSTIFY_CENTER}
271-
paddingTop={isZoomedIn ? '0' : SPACING.spacing60}
292+
paddingTop={
293+
isZoomedIn || showTimelineAlerts ? '0' : SPACING.spacing60
294+
}
272295
marginX="auto"
273296
>
274297
{isZoomedIn || selectedTerminalItemId === HARDWARE_ID ? null : (
275298
<>
276299
{showTimelineAlerts ? (
277-
<TimelineAlerts
278-
justifyContent={JUSTIFY_CENTER}
279-
width="100%"
280-
flexDirection={DIRECTION_COLUMN}
281-
gridGap={SPACING.spacing4}
282-
/>
300+
<>
301+
{/* empty div to scroll to top of timeline alerts */}
302+
<div ref={stepComponentRef} />
303+
<TimelineAlerts
304+
justifyContent={JUSTIFY_CENTER}
305+
width="100%"
306+
flexDirection={DIRECTION_COLUMN}
307+
gridGap={SPACING.spacing4}
308+
/>
309+
</>
283310
) : null}
284311
<Flex
285312
justifyContent={JUSTIFY_SPACE_BETWEEN}

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/useKitchen'
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}

step-generation/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ export type SharedTransferLikeArgs = CommonArgs & {
316316
blowoutFlowRateUlSec: number
317317

318318
// ===== SETTINGS INTRODUCED WITH LIQUID CLASSES =====
319-
liquidClass: string | null
319+
liquidClass: string | null // a liquid class name like "water" or null; "none" is not allowed
320320
aspiratePositionReference: PositionReference
321321
aspirateZOffset: number
322322
aspirateSubmergeSpeed: number | null

0 commit comments

Comments
 (0)