Skip to content

Commit 18da739

Browse files
authored
fix(app): App support for new lid commands and fix lid error boundary trigger (#17386)
fix EXEC-1042, RABR-712
1 parent b1684cb commit 18da739

File tree

7 files changed

+72
-5
lines changed

7 files changed

+72
-5
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
"latching_hs_latch": "Latching labware on Heater-Shaker",
3939
"left": "Left",
4040
"load_labware_to_display_location": "Load {{labware}} {{display_location}}",
41+
"load_lid": "Loading lid",
42+
"load_lid_stack": "Loading lid stack",
4143
"load_liquids_info_protocol_setup": "Load {{liquid}} into {{labware}}",
4244
"load_module_protocol_setup": "Load {{module}} in Slot {{slot_name}}",
4345
"load_pipette_protocol_setup": "Load {{pipette_name}} in {{mount_name}} Mount",

app/src/organisms/ErrorRecoveryFlows/hooks/useFailedLabwareUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ export function getFailedCmdRelevantLabware(
287287
const failedLWURI = runRecord?.data.labware.find(
288288
labware => labware.id === recentRelevantFailedLabwareCmd?.params.labwareId
289289
)?.definitionUri
290-
if (failedLWURI != null) {
290+
if (failedLWURI != null && Object.keys(lwDefsByURI).includes(failedLWURI)) {
291291
return {
292292
name: getLabwareDisplayName(lwDefsByURI[failedLWURI]),
293293
nickname: labwareNickname,

components/src/organisms/CommandText/useCommandTextString/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ export function useCommandTextString(
100100

101101
case 'loadLabware':
102102
case 'reloadLabware':
103+
case 'loadLid':
104+
case 'loadLidStack':
103105
case 'loadPipette':
104106
case 'loadModule':
105107
case 'loadLiquid':

components/src/organisms/CommandText/useCommandTextString/utils/commandText/getLoadCommandText.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ export const getLoadCommandText = ({
7373
display_location: displayLocation,
7474
})
7575
}
76+
// TODO(sb, 01/29): Add full support for these commands in run log once location refactor is complete
77+
case 'loadLid': {
78+
return t('load_lid')
79+
}
80+
case 'loadLidStack': {
81+
return t('load_lid_stack')
82+
}
7683
case 'reloadLabware': {
7784
const { labwareId } = command.params
7885
const labware =

shared-data/command/types/setup.ts

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,24 @@ export interface LoadLabwareRunTimeCommand
2929
LoadLabwareCreateCommand {
3030
result?: LoadLabwareResult
3131
}
32+
export interface LoadLidCreateCommand extends CommonCommandCreateInfo {
33+
commandType: 'loadLid'
34+
params: LoadLidParams
35+
}
36+
export interface LoadLidRunTimeCommand
37+
extends CommonCommandRunTimeInfo,
38+
LoadLidCreateCommand {
39+
result?: LoadLidResult
40+
}
41+
export interface LoadLidStackCreateCommand extends CommonCommandCreateInfo {
42+
commandType: 'loadLidStack'
43+
params: LoadLidStackParams
44+
}
45+
export interface LoadLidStackRunTimeCommand
46+
extends CommonCommandRunTimeInfo,
47+
LoadLidStackCreateCommand {
48+
result?: LoadLidStackResult
49+
}
3250
export interface ReloadLabwareCreateCommand extends CommonCommandCreateInfo {
3351
commandType: 'reloadLabware'
3452
params: { labwareId: string }
@@ -89,6 +107,8 @@ export type SetupRunTimeCommand =
89107
| LoadModuleRunTimeCommand
90108
| LoadLiquidRunTimeCommand
91109
| MoveLabwareRunTimeCommand
110+
| LoadLidRunTimeCommand
111+
| LoadLidStackRunTimeCommand
92112

93113
export type SetupCreateCommand =
94114
| ConfigureNozzleLayoutCreateCommand
@@ -98,6 +118,8 @@ export type SetupCreateCommand =
98118
| LoadModuleCreateCommand
99119
| LoadLiquidCreateCommand
100120
| MoveLabwareCreateCommand
121+
| LoadLidCreateCommand
122+
| LoadLidStackCreateCommand
101123

102124
export type LabwareLocation =
103125
| 'offDeck'
@@ -163,7 +185,6 @@ export interface MoveLabwareParams {
163185
interface MoveLabwareResult {
164186
offsetId: string
165187
}
166-
167188
interface LoadModuleParams {
168189
moduleId?: string
169190
location: ModuleLocation
@@ -203,3 +224,30 @@ export interface ConfigureNozzleLayoutParams {
203224
pipetteId: string
204225
configurationParams: NozzleConfigurationParams
205226
}
227+
228+
interface LoadLidStackParams {
229+
location: LabwareLocation
230+
loadName: string
231+
namespace: string
232+
version: number
233+
quantity: number
234+
}
235+
236+
interface LoadLidStackResult {
237+
stackLabwareId: string
238+
labwareIds: string[]
239+
definition: LabwareDefinition2
240+
location: LabwareLocation
241+
}
242+
243+
interface LoadLidParams {
244+
location: LabwareLocation
245+
loadName: string
246+
namespace: string
247+
version: number
248+
}
249+
250+
interface LoadLidResult {
251+
labwareId: string
252+
definition: LabwareDefinition2
253+
}

shared-data/js/helpers/getAddressableAreasInProtocol.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ export function getAddressableAreasInProtocol(
4242
) {
4343
return [...acc, params.newLocation.addressableAreaName]
4444
} else if (
45-
commandType === 'loadLabware' &&
45+
(commandType === 'loadLabware' ||
46+
commandType === 'loadLid' ||
47+
commandType === 'loadLidStack') &&
4648
params.location !== 'offDeck' &&
4749
params.location !== 'systemLocation' &&
4850
'slotName' in params.location &&
@@ -75,7 +77,9 @@ export function getAddressableAreasInProtocol(
7577

7678
return [...acc, ...addressableAreaNames]
7779
} else if (
78-
commandType === 'loadLabware' &&
80+
(commandType === 'loadLabware' ||
81+
commandType === 'loadLid' ||
82+
commandType === 'loadLidStack') &&
7983
params.location !== 'offDeck' &&
8084
params.location !== 'systemLocation' &&
8185
'addressableAreaName' in params.location &&

shared-data/js/helpers/getLoadedLabwareDefinitionsByUri.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ export function getLoadedLabwareDefinitionsByUri(
99
commands: RunTimeCommand[]
1010
): LabwareDefinitionsByUri {
1111
return commands.reduce((acc, command) => {
12-
if (command.commandType === 'loadLabware') {
12+
if (
13+
command.commandType === 'loadLabware' ||
14+
command.commandType === 'loadLid' ||
15+
command.commandType === 'loadLidStack'
16+
) {
1317
const labwareDef: LabwareDefinition2 | undefined =
1418
command.result?.definition
1519
if (labwareDef == null) {

0 commit comments

Comments
 (0)