Skip to content

Commit 638d91f

Browse files
committed
pass in layout, get location name for skip steps
1 parent 46b8879 commit 638d91f

File tree

3 files changed

+30
-11
lines changed

3 files changed

+30
-11
lines changed

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

+15-10
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ interface RelevantFailedLabwareLocations {
5050
newLoc: LabwareLocation | null
5151
}
5252

53-
export type interventionLayout = 'default' | 'stacked'
54-
5553
export type UseFailedLabwareUtilsResult = UseTipSelectionUtilsResult & {
5654
/* The name of the labware relevant to the failed command, if any. */
5755
failedLabwareName: string | null
@@ -63,7 +61,6 @@ export type UseFailedLabwareUtilsResult = UseTipSelectionUtilsResult & {
6361
failedLabwareNickname: string | null
6462
/* Details relating to the labware location. */
6563
failedLabwareLocations: RelevantFailedLabwareLocations
66-
layout: interventionLayout
6764
labwareQuantity: string | null
6865
}
6966

@@ -128,26 +125,20 @@ export function useFailedLabwareUtils({
128125
errorKind,
129126
})
130127

131-
console.log('WTFFFF: ', recentRelevantFailedLabwareCmd)
128+
console.log('WTFFFF: ', failedLabwareLocations)
132129
const labwareQuantity = getFailedLabwareQuantity(
133130
runCommands,
134131
recentRelevantFailedLabwareCmd,
135132
errorKind
136133
)
137134

138-
let layout
139-
if (errorKind !== ERROR_KINDS.STALL_WHILE_STACKING) {
140-
layout = 'default'
141-
} else layout = 'stacked'
142-
143135
return {
144136
...tipSelectionUtils,
145137
failedLabwareName: failedLabwareDetails?.name ?? null,
146138
failedLabware,
147139
relevantWellName,
148140
failedLabwareNickname: failedLabwareDetails?.nickname ?? null,
149141
failedLabwareLocations,
150-
layout,
151142
labwareQuantity,
152143
}
153144
}
@@ -478,6 +469,7 @@ export function useRelevantFailedLwLocations({
478469
RelevantFailedLabwareLocations,
479470
'displayNameNewLoc' | 'newLoc'
480471
> => {
472+
console.log('in new location:', failedCommandByRunRecord?.commandType)
481473
switch (failedCommandByRunRecord?.commandType) {
482474
case 'moveLabware':
483475
return {
@@ -487,6 +479,19 @@ export function useRelevantFailedLwLocations({
487479
}),
488480
newLoc: failedCommandByRunRecord.params.newLocation,
489481
}
482+
case 'flexStacker/retrieve':
483+
case 'flexStacker/store':
484+
return {
485+
displayNameNewLoc: getLabwareDisplayLocation({
486+
...BASE_DISPLAY_PARAMS,
487+
location: BASE_DISPLAY_PARAMS.loadedModules.find(
488+
m => m.id === failedCommandByRunRecord?.params.moduleId
489+
).location,
490+
}),
491+
newLoc: {
492+
moduleId: failedCommandByRunRecord?.params.moduleId,
493+
},
494+
}
490495
default:
491496
return {
492497
displayNameNewLoc: null,

app/src/organisms/ErrorRecoveryFlows/shared/LeftColumnLabwareInfo.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type { RecoveryContentProps } from '../types'
66
type LeftColumnLabwareInfoProps = RecoveryContentProps & {
77
title: string
88
type: ComponentProps<typeof InterventionContent>['infoProps']['type']
9+
layout: ComponentProps<typeof InterventionContent>['infoProps']['layout']
910
/* Renders a warning InlineNotification if provided. */
1011
bannerText?: string
1112
}
@@ -15,13 +16,13 @@ export function LeftColumnLabwareInfo({
1516
title,
1617
failedLabwareUtils,
1718
type,
19+
layout,
1820
bannerText,
1921
}: LeftColumnLabwareInfoProps): JSX.Element | null {
2022
const {
2123
failedLabwareName,
2224
failedLabwareNickname,
2325
failedLabwareLocations,
24-
layout,
2526
labwareQuantity,
2627
} = failedLabwareUtils
2728
const { displayNameNewLoc, displayNameCurrentLoc } = failedLabwareLocations

app/src/organisms/ErrorRecoveryFlows/shared/TwoColLwInfoAndDeck.tsx

+13
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,18 @@ export function TwoColLwInfoAndDeck(
133133
}
134134
}
135135

136+
const buildLayoutType = (): ComponentProps<
137+
typeof InterventionContent
138+
>['infoProps']['layout'] => {
139+
switch (selectedRecoveryOption) {
140+
case MANUAL_LOAD_IN_STACKER_AND_SKIP.ROUTE:
141+
case MANUAL_REPLACE_STACKER_AND_RETRY.ROUTE:
142+
return 'stacked'
143+
default:
144+
return 'default'
145+
}
146+
}
147+
136148
// TODO(jh, 10-22-24): Componentize an app-only abstraction above MoveLabwareOnDeck. EXEC-788.
137149
const buildDeckView = (): JSX.Element => {
138150
switch (selectedRecoveryOption) {
@@ -210,6 +222,7 @@ export function TwoColLwInfoAndDeck(
210222
{...props}
211223
title={buildTitle()}
212224
type={buildType()}
225+
layout={buildLayoutType()}
213226
bannerText={buildBannerText()}
214227
/>
215228
<Flex marginTop="0.7rem">{buildDeckView()}</Flex>

0 commit comments

Comments
 (0)