Skip to content

Commit f8dd413

Browse files
committed
Update styling for labware setup on desktop
1 parent d72ee2c commit f8dd413

File tree

15 files changed

+67
-108
lines changed

15 files changed

+67
-108
lines changed

app/src/assets/localization/en/protocol_setup.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"calibration_required_calibrate_pipette_first": "Calibration required Calibrate pipette first",
4444
"calibration_status": "calibration status",
4545
"cancel_and_restart_to_edit": "Cancel the run and restart setup to edit",
46+
"check_locations_and_volumes": "Check locations and volumes",
4647
"choose_csv_file": "Choose CSV file",
4748
"choose_enum": "Choose {{displayName}}",
4849
"closing": "Closing...",
@@ -110,9 +111,11 @@
110111
"labware": "Labware",
111112
"labware_latch": "Labware Latch",
112113
"labware_latch_instructions": "Use latch control for easy placement of labware.",
114+
"labware_liquids_setup_step_description": "Gather your labware & liquids and place them on the deck to finish setting up your protocol.",
115+
"labware_liquids_setup_step_title": "Labware & Liquids",
113116
"labware_location": "Labware Location",
114117
"labware_name": "Labware name",
115-
"labware_placement": "labware placement",
118+
"labware_placement": "labware and liquid placement",
116119
"labware_position_check": "Labware Position Check",
117120
"labware_position_check_not_available": "Labware Position Check is not available after run has started",
118121
"labware_position_check_not_available_analyzing_on_robot": "Labware Position Check is not available while protocol is analyzing on robot",
@@ -121,8 +124,6 @@
121124
"labware_position_check_step_title": "Labware Position Check",
122125
"labware_position_check_text": "Labware Position Check is a recommended workflow that helps you verify the position of each labware on the deck. During this check, you can create Labware Offsets that adjust how the robot moves to each labware in the X, Y and Z directions.",
123126
"labware_quantity": "Quantity: {{quantity}}",
124-
"labware_setup_step_description": "Gather the following labware and full tip racks. To run your protocol without Labware Position Check, place and secure labware in their initial locations.",
125-
"labware_setup_step_title": "Labware",
126127
"last_calibrated": "Last calibrated: {{date}}",
127128
"learn_how_it_works": "Learn how it works",
128129
"learn_more": "Learn more",

app/src/molecules/ToggleGroup/useToggleGroup.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ import type { ReactNode } from 'react'
77
export const useToggleGroup = (
88
left: string,
99
right: string,
10-
trackEventName?: string
10+
trackEventName?: string,
11+
selectRightFirst?: boolean
1112
): [string, ReactNode] => {
12-
const [selectedValue, setSelectedValue] = useState<string>(left)
13+
const [selectedValue, setSelectedValue] = useState<string>(
14+
selectRightFirst ? right : left
15+
)
1316
const trackEvent = useTrackEvent()
1417
const handleLeftClick = (): void => {
1518
setSelectedValue(left)

app/src/organisms/Desktop/Devices/ProtocolRun/ProtocolRunHeader/RunHeaderModalContainer/modals/ConfirmMissingStepsModal.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
import {
1616
LPC_STEP_KEY,
1717
LABWARE_SETUP_STEP_KEY,
18-
LIQUID_SETUP_STEP_KEY,
1918
MODULE_SETUP_STEP_KEY,
2019
ROBOT_CALIBRATION_STEP_KEY,
2120
} from '/app/redux/protocol-runs'
@@ -24,7 +23,6 @@ import type { StepKey } from '/app/redux/protocol-runs'
2423
const STEP_KEY_TO_I18N_KEY = {
2524
[LPC_STEP_KEY]: 'applied_labware_offsets',
2625
[LABWARE_SETUP_STEP_KEY]: 'labware_placement',
27-
[LIQUID_SETUP_STEP_KEY]: 'liquids',
2826
[MODULE_SETUP_STEP_KEY]: 'module_setup',
2927
[ROBOT_CALIBRATION_STEP_KEY]: 'robot_calibration',
3028
}

app/src/organisms/Desktop/Devices/ProtocolRun/ProtocolRunSetup.tsx

+16-47
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
FLEX_MAX_CONTENT,
1111
Flex,
1212
Icon,
13+
StyledText,
1314
LegacyStyledText,
1415
Link,
1516
NO_WRAP,
@@ -47,7 +48,6 @@ import {
4748
MODULE_SETUP_STEP_KEY,
4849
LPC_STEP_KEY,
4950
LABWARE_SETUP_STEP_KEY,
50-
LIQUID_SETUP_STEP_KEY,
5151
updateRunSetupStepsComplete,
5252
getMissingSetupSteps,
5353
} from '/app/redux/protocol-runs'
@@ -56,7 +56,6 @@ import { SetupLabwarePositionCheck } from './SetupLabwarePositionCheck'
5656
import { SetupRobotCalibration } from './SetupRobotCalibration'
5757
import { SetupModuleAndDeck } from './SetupModuleAndDeck'
5858
import { SetupStep } from './SetupStep'
59-
import { SetupLiquids } from './SetupLiquids'
6059
import { EmptySetupStep } from './EmptySetupStep'
6160
import { HowLPCWorksModal } from './SetupLabwarePositionCheck/HowLPCWorksModal'
6261
import { useFeatureFlag } from '/app/redux/config'
@@ -119,8 +118,6 @@ export function ProtocolRunSetup({
119118

120119
const isMissingModule = missingModuleIds.length > 0
121120

122-
const liquids = protocolAnalysis?.liquids ?? []
123-
const hasLiquids = liquids.length > 0
124121
const hasModules = protocolAnalysis != null && modules.length > 0
125122
// need config compatibility (including check for single slot conflicts)
126123
const requiredDeckConfigCompatibility = getRequiredDeckConfig(
@@ -250,14 +247,7 @@ export function ProtocolRunSetup({
250247
})
251248
)
252249
if (confirmed) {
253-
const nextStep =
254-
orderedApplicableSteps.findIndex(
255-
v => v === LABWARE_SETUP_STEP_KEY
256-
) ===
257-
orderedApplicableSteps.length - 1
258-
? null
259-
: LIQUID_SETUP_STEP_KEY
260-
setExpandedStepKey(nextStep)
250+
setExpandedStepKey(null)
261251
}
262252
}}
263253
/>
@@ -268,37 +258,17 @@ export function ProtocolRunSetup({
268258
complete: !missingSteps.includes(LABWARE_SETUP_STEP_KEY),
269259
completeText: t('placements_ready'),
270260
incompleteText: null,
271-
incompleteElement: null,
272-
},
273-
},
274-
[LIQUID_SETUP_STEP_KEY]: {
275-
stepInternals: (
276-
<SetupLiquids
277-
robotName={robotName}
278-
runId={runId}
279-
protocolAnalysis={protocolAnalysis}
280-
isLiquidSetupConfirmed={!missingSteps.includes(LIQUID_SETUP_STEP_KEY)}
281-
setLiquidSetupConfirmed={(confirmed: boolean) => {
282-
dispatch(
283-
updateRunSetupStepsComplete(runId, {
284-
[LIQUID_SETUP_STEP_KEY]: confirmed,
285-
})
286-
)
287-
if (confirmed) {
288-
setExpandedStepKey(null)
289-
}
290-
}}
291-
/>
292-
),
293-
description: hasLiquids
294-
? t(`${LIQUID_SETUP_STEP_KEY}_description`)
295-
: i18n.format(t('liquids_not_in_the_protocol'), 'capitalize'),
296-
rightElProps: {
297-
stepKey: LIQUID_SETUP_STEP_KEY,
298-
complete: !missingSteps.includes(LIQUID_SETUP_STEP_KEY),
299-
completeText: t('liquids_ready'),
300-
incompleteText: null,
301-
incompleteElement: null,
261+
incompleteElement: (
262+
<StyledText
263+
color={COLORS.black90}
264+
css={TYPOGRAPHY.pSemiBold}
265+
marginRight={SPACING.spacing16}
266+
id={`RunSetupCard_${LABWARE_SETUP_STEP_KEY}_incompleteText`}
267+
whitespace={NO_WRAP}
268+
>
269+
{t('check_locations_and_volumes')}
270+
</StyledText>
271+
),
302272
},
303273
},
304274
}
@@ -322,10 +292,9 @@ export function ProtocolRunSetup({
322292
orderedSteps.map((stepKey, index) => {
323293
const setupStepTitle = t(`${stepKey}_title`)
324294
const showEmptySetupStep =
325-
(stepKey === 'liquid_setup_step' && !hasLiquids) ||
326-
(stepKey === 'module_setup_step' &&
327-
((!isFlex && !hasModules) ||
328-
(isFlex && !hasModules && !hasFixtures)))
295+
stepKey === 'module_setup_step' &&
296+
((!isFlex && !hasModules) ||
297+
(isFlex && !hasModules && !hasFixtures))
329298
return (
330299
<Flex flexDirection={DIRECTION_COLUMN} key={stepKey}>
331300
{showEmptySetupStep ? (

app/src/organisms/Desktop/Devices/ProtocolRun/SetupLabware/LabwareListItem.tsx

+15-7
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,9 @@ import type { ModuleTypesThatRequireExtraAttention } from '../utils/getModuleTyp
5757
const LabwareRow = styled.div`
5858
display: ${DISPLAY_GRID};
5959
grid-template-columns: 90px 12fr;
60-
border-style: ${BORDERS.styleSolid};
61-
border-width: 1px;
62-
border-color: ${COLORS.grey30};
60+
background-color: ${COLORS.grey20};
6361
border-radius: ${BORDERS.borderRadius4};
64-
padding: ${SPACING.spacing12} ${SPACING.spacing16} ${SPACING.spacing12}
65-
${SPACING.spacing24};
62+
padding: ${SPACING.spacing12} ${SPACING.spacing16} ${SPACING.spacing12};
6663
`
6764

6865
interface LabwareListItemProps extends LabwareSetupItem {
@@ -248,7 +245,11 @@ export function LabwareListItem(
248245

249246
return (
250247
<LabwareRow>
251-
<Flex alignItems={ALIGN_CENTER} gridGap={SPACING.spacing2} width="5rem">
248+
<Flex
249+
alignItems={ALIGN_CENTER}
250+
gridGap={SPACING.spacing2}
251+
width="6.25rem"
252+
>
252253
{slotInfo != null && isFlex ? (
253254
<DeckInfoLabel deckLabel={slotInfo} />
254255
) : (
@@ -259,9 +260,16 @@ export function LabwareListItem(
259260
{slotInfo}
260261
</StyledText>
261262
)}
263+
{moduleType != null ? (
264+
<DeckInfoLabel iconName={MODULE_ICON_NAME_BY_TYPE[moduleType]} />
265+
) : null}
262266
{isStacked ? <DeckInfoLabel iconName="stacked" /> : null}
263267
</Flex>
264-
<Flex flexDirection={DIRECTION_COLUMN} gridGap={SPACING.spacing12}>
268+
<Flex
269+
flexDirection={DIRECTION_COLUMN}
270+
gridGap={SPACING.spacing12}
271+
marginLeft={SPACING.spacing24}
272+
>
265273
<>
266274
<Flex>
267275
{showLabwareSVG && topLabwareDefinition != null ? (

app/src/organisms/Desktop/Devices/ProtocolRun/SetupLabware/SetupLabwareList.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ export function SetupLabwareList(
3838
>
3939
<Flex
4040
gridGap={SPACING.spacing16}
41-
paddingLeft={SPACING.spacing24}
41+
paddingLeft={SPACING.spacing16}
4242
paddingTop={SPACING.spacing20}
4343
>
4444
<StyledText
45-
width="5rem"
45+
width="6.25rem"
4646
desktopStyle="bodyDefaultRegular"
4747
color={COLORS.grey60}
4848
>

app/src/organisms/Desktop/Devices/ProtocolRun/SetupLabware/__tests__/SetupLabware.test.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ describe('SetupLabware', () => {
104104
vi.resetAllMocks()
105105
})
106106

107-
it('should render the list view, clicking the toggle button will turn to map view', () => {
107+
it('should render the map view, clicking the toggle button will turn to list view', () => {
108108
render()
109-
screen.getByText('mock setup labware list')
110-
screen.getByRole('button', { name: 'List View' })
111-
screen.getByRole('button', { name: 'Confirm placements' })
112-
const mapView = screen.getByRole('button', { name: 'Map View' })
113-
fireEvent.click(mapView)
114109
screen.getByText('mock setup labware map')
110+
screen.getByRole('button', { name: 'Map View' })
111+
screen.getByRole('button', { name: 'Confirm placements' })
112+
const listView = screen.getByRole('button', { name: 'List View' })
113+
fireEvent.click(listView)
114+
screen.getByText('mock setup labware list')
115115
})
116116

117117
it('disables the confirmation button if the run has already started', () => {

app/src/organisms/Desktop/Devices/ProtocolRun/SetupLabware/index.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ export function SetupLabware(props: SetupLabwareProps): JSX.Element {
3838
const protocolAnalysis = robotProtocolAnalysis ?? storedProtocolAnalysis
3939
const [selectedValue, toggleGroup] = useToggleGroup(
4040
t('list_view') as string,
41-
t('map_view') as string
41+
t('map_view') as string,
42+
undefined,
43+
true
4244
)
4345
const isFlex = useIsFlex(robotName)
4446

app/src/organisms/Desktop/Devices/ProtocolRun/__tests__/ProtocolRunSetup.test.tsx

+9-18
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { describe, it, beforeEach, vi, afterEach, expect } from 'vitest'
55
import {
66
getSimplestDeckConfigForProtocol,
77
parseAllRequiredModuleModels,
8-
parseLiquidsInLoadOrder,
98
STAGING_AREA_SLOT_WITH_WASTE_CHUTE_RIGHT_ADAPTER_NO_COVER_FIXTURE,
109
simple_v4 as noModulesProtocol,
1110
test_modules_protocol as withModulesProtocol,
@@ -37,7 +36,6 @@ import { useLPCFlows } from '/app/organisms/LabwarePositionCheck'
3736

3837
import { SetupLabware } from '../SetupLabware'
3938
import { SetupRobotCalibration } from '../SetupRobotCalibration'
40-
import { SetupLiquids } from '../SetupLiquids'
4139
import { SetupModuleAndDeck } from '../SetupModuleAndDeck'
4240
import { EmptySetupStep } from '../EmptySetupStep'
4341
import { ProtocolRunSetup } from '../ProtocolRunSetup'
@@ -50,7 +48,6 @@ import type * as SharedData from '@opentrons/shared-data'
5048
vi.mock('../SetupLabware')
5149
vi.mock('../SetupRobotCalibration')
5250
vi.mock('../SetupModuleAndDeck')
53-
vi.mock('../SetupLiquids')
5451
vi.mock('../EmptySetupStep')
5552
vi.mock('/app/resources/runs/useNotifyRunQuery')
5653
vi.mock('/app/resources/runs/useMostRecentCompletedAnalysis')
@@ -74,7 +71,6 @@ vi.mock('@opentrons/shared-data', async importOriginal => {
7471
return {
7572
...actualSharedData,
7673
parseAllRequiredModuleModels: vi.fn(),
77-
parseLiquidsInLoadOrder: vi.fn(),
7874
parseProtocolData: vi.fn(),
7975
getSimplestDeckConfigForProtocol: vi.fn(),
8076
}
@@ -129,18 +125,15 @@ describe('ProtocolRunSetup', () => {
129125
ReduxRuns.MODULE_SETUP_STEP_KEY,
130126
ReduxRuns.LPC_STEP_KEY,
131127
ReduxRuns.LABWARE_SETUP_STEP_KEY,
132-
ReduxRuns.LIQUID_SETUP_STEP_KEY,
133128
],
134129
orderedApplicableSteps: [
135130
ReduxRuns.ROBOT_CALIBRATION_STEP_KEY,
136131
ReduxRuns.MODULE_SETUP_STEP_KEY,
137132
ReduxRuns.LPC_STEP_KEY,
138133
ReduxRuns.LABWARE_SETUP_STEP_KEY,
139-
ReduxRuns.LIQUID_SETUP_STEP_KEY,
140134
],
141135
})
142136
vi.mocked(parseAllRequiredModuleModels).mockReturnValue([])
143-
vi.mocked(parseLiquidsInLoadOrder).mockReturnValue([])
144137
when(vi.mocked(useRobot))
145138
.calledWith(ROBOT_NAME)
146139
.thenReturn(mockConnectedRobot)
@@ -172,7 +165,6 @@ describe('ProtocolRunSetup', () => {
172165
<div>Mock SetupRobotCalibration</div>
173166
)
174167
vi.mocked(SetupModuleAndDeck).mockReturnValue(<div>Mock SetupModules</div>)
175-
vi.mocked(SetupLiquids).mockReturnValue(<div>Mock SetupLiquids</div>)
176168
vi.mocked(EmptySetupStep).mockReturnValue(<div>Mock EmptySetupStep</div>)
177169
vi.mocked(getSimplestDeckConfigForProtocol).mockReturnValue([])
178170
vi.mocked(useDeckConfigurationCompatibility).mockReturnValue([])
@@ -265,19 +257,19 @@ describe('ProtocolRunSetup', () => {
265257
fireEvent.click(robotCalibrationSetup)
266258
expect(screen.getByText('Mock SetupRobotCalibration')).toBeVisible()
267259
})
268-
it('renders labware setup', () => {
260+
it('renders labware and liquid setup', () => {
269261
render()
270262

271263
screen.getByText(
272-
'Gather the following labware and full tip racks. To run your protocol without Labware Position Check, place and secure labware in their initial locations.'
264+
'Gather your labware & liquids and place them on the deck to finish setting up your protocol.'
273265
)
274-
const labwareSetup = screen.getByText('Labware')
266+
const labwareSetup = screen.getByText('Labware & Liquids')
275267
fireEvent.click(labwareSetup)
276268
expect(screen.getByText('Mock SetupLabware')).toBeVisible()
277269
})
278-
it('renders the empty states for modules and liquids when no modules in protocol', () => {
270+
it('renders the empty state for modules when no modules in protocol', () => {
279271
render()
280-
screen.getAllByText('Mock EmptySetupStep')
272+
screen.getByText('Mock EmptySetupStep')
281273
})
282274

283275
it('defaults to no step expanded', () => {
@@ -306,7 +298,6 @@ describe('ProtocolRunSetup', () => {
306298
.calledWith(RUN_ID)
307299
.thenReturn({
308300
...withModulesProtocol,
309-
...MOCK_PROTOCOL_LIQUID_KEY,
310301
} as any)
311302
when(vi.mocked(useRunHasStarted)).calledWith(RUN_ID).thenReturn(false)
312303
when(vi.mocked(useModuleCalibrationStatus))
@@ -412,10 +403,10 @@ describe('ProtocolRunSetup', () => {
412403
screen.getByText('Deck hardware')
413404

414405
screen.getByText('Install the required modules.')
415-
screen.getByText('Labware')
406+
screen.getByText('Labware & Liquids')
416407

417408
screen.getByText(
418-
'Gather the following labware and full tip racks. To run your protocol without Labware Position Check, place and secure labware in their initial locations.'
409+
'Gather your labware & liquids and place them on the deck to finish setting up your protocol.'
419410
)
420411
})
421412

@@ -445,9 +436,9 @@ describe('ProtocolRunSetup', () => {
445436
screen.getByText('Deck hardware')
446437

447438
screen.getByText('Install the required module.')
448-
screen.getByText('Labware')
439+
screen.getByText('Labware & Liquids')
449440
screen.getByText(
450-
'Gather the following labware and full tip racks. To run your protocol without Labware Position Check, place and secure labware in their initial locations.'
441+
'Gather your labware & liquids and place them on the deck to finish setting up your protocol.'
451442
)
452443
})
453444

app/src/organisms/Desktop/Devices/ProtocolRun/__tests__/SetupRobotCalibration.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ describe('SetupRobotCalibration', () => {
9494
})
9595

9696
it('changes Proceed CTA copy based on next step', () => {
97-
render({ nextStep: 'labware_setup_step' })
97+
render({ nextStep: 'labware_liquids_setup_step' })
9898
screen.getByRole('button', { name: 'Proceed to labware' })
9999
})
100100

0 commit comments

Comments
 (0)