Skip to content

Commit fd6a8d7

Browse files
authored
feat(protocol-designer): add flex stacker form data (#20320)
This PR introduces the new form data interface and defaults for Flex stacker steps in PD. Note that in addition to the individual fields for various stacker step interaction, I follow the absorbance reader and thermocycler forms paradigm in setting a form type, which will conditionally reveal fields relevant to that form type. The types are as follows: - retrieve - store - fill - empty
1 parent c9f19f3 commit fd6a8d7

File tree

4 files changed

+42
-11
lines changed

4 files changed

+42
-11
lines changed

protocol-designer/src/constants.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ export const ABSORBANCE_READER_COLOR_BY_WAVELENGTH: Record<number, string> = {
9393
650: 'Red',
9494
}
9595

96+
// Values for flex stacker
97+
export const FLEX_STACKER_RETRIEVE: 'retrieve' = 'retrieve'
98+
export const FLEX_STACKER_STORE: 'store' = 'store'
99+
export const FLEX_STACKER_FILL: 'fill' = 'fill'
100+
export const FLEX_STACKER_EMPTY: 'empty' = 'empty'
101+
96102
export const OFFDECK: 'offDeck' = 'offDeck'
97103

98104
export const PROTOCOL_DESIGNER_SOURCE: 'Protocol Designer' = 'Protocol Designer' // protocolSource for tracking analytics in the app

protocol-designer/src/form-types.ts

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ import type {
2121
ABSORBANCE_READER_INITIALIZE_MODE_SINGLE,
2222
ABSORBANCE_READER_LID,
2323
ABSORBANCE_READER_READ,
24+
FLEX_STACKER_EMPTY,
25+
FLEX_STACKER_FILL,
26+
FLEX_STACKER_RETRIEVE,
27+
FLEX_STACKER_STORE,
2428
PAUSE_UNTIL_RESUME,
2529
PAUSE_UNTIL_TC_PROFILE_COMPLETE,
2630
PAUSE_UNTIL_TEMP,
@@ -163,6 +167,7 @@ export type StepType =
163167
| 'absorbanceReader'
164168
| 'camera'
165169
| 'comment'
170+
| 'flexStacker'
166171
| 'heaterShaker'
167172
| 'magnet'
168173
| 'manualIntervention'
@@ -178,16 +183,16 @@ export const stepIconsByType: Record<StepType, IconName> = {
178183
absorbanceReader: 'ot-absorbance',
179184
camera: 'camera',
180185
comment: 'comment',
186+
flexStacker: 'ot-flex-stacker',
187+
heaterShaker: 'ot-heater-shaker',
188+
magnet: 'ot-magnet-v2',
189+
manualIntervention: 'pause-circle',
190+
mix: 'mix',
181191
moveLabware: 'ot-move',
182192
moveLiquid: 'transfer',
183-
mix: 'mix',
184193
pause: 'pause-circle',
185-
manualIntervention: 'pause-circle',
186-
magnet: 'ot-magnet-v2',
187194
temperature: 'ot-temperature-v2',
188195
thermocycler: 'ot-thermocycler',
189-
heaterShaker: 'ot-heater-shaker',
190-
flexStacker: 'ot-flex-stacker',
191196
}
192197
// ===== Unprocessed form types =====
193198
export interface AnnotationFields {
@@ -500,10 +505,19 @@ export interface HydratedAbsorbanceReaderFormData extends AnnotationFields {
500505
wavelengths: string[]
501506
}
502507

503-
// TODO(TZ, 2025-12-03): not fully flushed out, but this is the initial hydrated form data for the flex stacker form
508+
export type FlexStackerFormType =
509+
| typeof FLEX_STACKER_RETRIEVE
510+
| typeof FLEX_STACKER_STORE
511+
| typeof FLEX_STACKER_FILL
512+
| typeof FLEX_STACKER_EMPTY
513+
504514
export interface HydratedFlexStackerFormData extends AnnotationFields {
505515
stepType: 'flexStacker'
506516
id: string
517+
fillLabwareUri: string | null
518+
fillQuantity: number | null
519+
flexStackerFormType: FlexStackerFormType | null
520+
interventionMessage: string | null
507521
moduleId: string
508522
}
509523

@@ -616,6 +630,7 @@ export type CountPerStepType = Partial<Record<StepType, number>>
616630
export type HydratedFormData =
617631
| HydratedAbsorbanceReaderFormData
618632
| HydratedCameraFormData
633+
| HydratedFlexStackerFormData
619634
| HydratedCommentFormData
620635
| HydratedHeaterShakerFormData
621636
| HydratedMagnetFormData

protocol-designer/src/steplist/formLevel/getDefaultsForStepType.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,14 +251,13 @@ export function getDefaultsForStepType(
251251
referenceWavelengthActive: false,
252252
wavelengths: [Object.keys(ABSORBANCE_READER_COLOR_BY_WAVELENGTH)[0]], // default to first known wavelength
253253
}
254-
// TODO(TZ, 2025-12-03): not fully flushed out, but this is the initial state for the flex stacker form
255254
case 'flexStacker':
256255
return {
256+
fillLabwareUri: null,
257+
fillQuantity: null,
258+
flexStackerFormType: null,
259+
interventionMessage: null,
257260
moduleId: null,
258-
labwareInHopper: null,
259-
labwareOnShuttle: null,
260-
maxPoolCount: 0,
261-
storedLabwareDetails: null,
262261
}
263262
default:
264263
return {}

protocol-designer/src/steplist/formLevel/test/getDefaultsForStepType.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,4 +236,15 @@ describe('getDefaultsForStepType', () => {
236236
expect(getDefaultsForStepType('')).toEqual({})
237237
})
238238
})
239+
describe('flex stacker step', () => {
240+
it('should get the correct defaults', () => {
241+
expect(getDefaultsForStepType('flexStacker')).toEqual({
242+
fillLabwareUri: null,
243+
fillQuantity: null,
244+
flexStackerFormType: null,
245+
interventionMessage: null,
246+
moduleId: null,
247+
})
248+
})
249+
})
239250
})

0 commit comments

Comments
 (0)