Skip to content

Commit

Permalink
fix(app): App support for new lid commands and fix lid error boundary…
Browse files Browse the repository at this point in the history
… trigger (#17386)

fix EXEC-1042, RABR-712
  • Loading branch information
smb2268 authored Jan 30, 2025
1 parent b1684cb commit 18da739
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 5 deletions.
2 changes: 2 additions & 0 deletions app/src/assets/localization/en/protocol_command_text.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
"latching_hs_latch": "Latching labware on Heater-Shaker",
"left": "Left",
"load_labware_to_display_location": "Load {{labware}} {{display_location}}",
"load_lid": "Loading lid",
"load_lid_stack": "Loading lid stack",
"load_liquids_info_protocol_setup": "Load {{liquid}} into {{labware}}",
"load_module_protocol_setup": "Load {{module}} in Slot {{slot_name}}",
"load_pipette_protocol_setup": "Load {{pipette_name}} in {{mount_name}} Mount",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ export function getFailedCmdRelevantLabware(
const failedLWURI = runRecord?.data.labware.find(
labware => labware.id === recentRelevantFailedLabwareCmd?.params.labwareId
)?.definitionUri
if (failedLWURI != null) {
if (failedLWURI != null && Object.keys(lwDefsByURI).includes(failedLWURI)) {
return {
name: getLabwareDisplayName(lwDefsByURI[failedLWURI]),
nickname: labwareNickname,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ export function useCommandTextString(

case 'loadLabware':
case 'reloadLabware':
case 'loadLid':
case 'loadLidStack':
case 'loadPipette':
case 'loadModule':
case 'loadLiquid':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ export const getLoadCommandText = ({
display_location: displayLocation,
})
}
// TODO(sb, 01/29): Add full support for these commands in run log once location refactor is complete
case 'loadLid': {
return t('load_lid')
}
case 'loadLidStack': {
return t('load_lid_stack')
}
case 'reloadLabware': {
const { labwareId } = command.params
const labware =
Expand Down
50 changes: 49 additions & 1 deletion shared-data/command/types/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,24 @@ export interface LoadLabwareRunTimeCommand
LoadLabwareCreateCommand {
result?: LoadLabwareResult
}
export interface LoadLidCreateCommand extends CommonCommandCreateInfo {
commandType: 'loadLid'
params: LoadLidParams
}
export interface LoadLidRunTimeCommand
extends CommonCommandRunTimeInfo,
LoadLidCreateCommand {
result?: LoadLidResult
}
export interface LoadLidStackCreateCommand extends CommonCommandCreateInfo {
commandType: 'loadLidStack'
params: LoadLidStackParams
}
export interface LoadLidStackRunTimeCommand
extends CommonCommandRunTimeInfo,
LoadLidStackCreateCommand {
result?: LoadLidStackResult
}
export interface ReloadLabwareCreateCommand extends CommonCommandCreateInfo {
commandType: 'reloadLabware'
params: { labwareId: string }
Expand Down Expand Up @@ -89,6 +107,8 @@ export type SetupRunTimeCommand =
| LoadModuleRunTimeCommand
| LoadLiquidRunTimeCommand
| MoveLabwareRunTimeCommand
| LoadLidRunTimeCommand
| LoadLidStackRunTimeCommand

export type SetupCreateCommand =
| ConfigureNozzleLayoutCreateCommand
Expand All @@ -98,6 +118,8 @@ export type SetupCreateCommand =
| LoadModuleCreateCommand
| LoadLiquidCreateCommand
| MoveLabwareCreateCommand
| LoadLidCreateCommand
| LoadLidStackCreateCommand

export type LabwareLocation =
| 'offDeck'
Expand Down Expand Up @@ -163,7 +185,6 @@ export interface MoveLabwareParams {
interface MoveLabwareResult {
offsetId: string
}

interface LoadModuleParams {
moduleId?: string
location: ModuleLocation
Expand Down Expand Up @@ -203,3 +224,30 @@ export interface ConfigureNozzleLayoutParams {
pipetteId: string
configurationParams: NozzleConfigurationParams
}

interface LoadLidStackParams {
location: LabwareLocation
loadName: string
namespace: string
version: number
quantity: number
}

interface LoadLidStackResult {
stackLabwareId: string
labwareIds: string[]
definition: LabwareDefinition2
location: LabwareLocation
}

interface LoadLidParams {
location: LabwareLocation
loadName: string
namespace: string
version: number
}

interface LoadLidResult {
labwareId: string
definition: LabwareDefinition2
}
8 changes: 6 additions & 2 deletions shared-data/js/helpers/getAddressableAreasInProtocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ export function getAddressableAreasInProtocol(
) {
return [...acc, params.newLocation.addressableAreaName]
} else if (
commandType === 'loadLabware' &&
(commandType === 'loadLabware' ||
commandType === 'loadLid' ||
commandType === 'loadLidStack') &&
params.location !== 'offDeck' &&
params.location !== 'systemLocation' &&
'slotName' in params.location &&
Expand Down Expand Up @@ -75,7 +77,9 @@ export function getAddressableAreasInProtocol(

return [...acc, ...addressableAreaNames]
} else if (
commandType === 'loadLabware' &&
(commandType === 'loadLabware' ||
commandType === 'loadLid' ||
commandType === 'loadLidStack') &&
params.location !== 'offDeck' &&
params.location !== 'systemLocation' &&
'addressableAreaName' in params.location &&
Expand Down
6 changes: 5 additions & 1 deletion shared-data/js/helpers/getLoadedLabwareDefinitionsByUri.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ export function getLoadedLabwareDefinitionsByUri(
commands: RunTimeCommand[]
): LabwareDefinitionsByUri {
return commands.reduce((acc, command) => {
if (command.commandType === 'loadLabware') {
if (
command.commandType === 'loadLabware' ||
command.commandType === 'loadLid' ||
command.commandType === 'loadLidStack'
) {
const labwareDef: LabwareDefinition2 | undefined =
command.result?.definition
if (labwareDef == null) {
Expand Down

0 comments on commit 18da739

Please sign in to comment.