Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(app): App support for new lid commands and fix lid error boundary trigger #17386

Merged
merged 6 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That will do it!

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') &&
Comment on lines +45 to +47
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not in this PR, but could we add a TODO for adding some sort of constant to shared data that contains a list of all possible load commands, and then implement that in the app?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, definitely - we won't want to reference all three of these everywhere we search for loadLabware (we'll want to exclude these from LPC, for example) but it would be good to have this as a type

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
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
Loading