Skip to content

Commit 6864eab

Browse files
authored
feat(app): Add Error Recovery ErrorDetails desktop support (#15784)
Closes EXEC-627
1 parent 75e2ee6 commit 6864eab

File tree

18 files changed

+212
-87
lines changed

18 files changed

+212
-87
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"continue_run_now": "Continue run now",
1717
"continue_to_drop_tip": "Continue to drop tip",
1818
"error": "Error",
19+
"error_details": "Error details",
1920
"error_on_robot": "Error on {{robot}}",
2021
"failed_dispense_step_not_completed": "<block>The failed dispense step will not be completed. The run will continue from the next step with the attached tips.</block><block>Close the robot door before proceeding.</block>",
2122
"failed_step": "Failed step",
@@ -40,6 +41,7 @@
4041
"recovery_action_failed": "{{action}} failed",
4142
"recovery_mode": "Recovery Mode",
4243
"recovery_mode_explanation": "<block>Recovery Mode provides you with guided and manual controls for handling errors at runtime.</block><br/><block>You can make changes to ensure the step in progress when the error occurred can be completed or choose to cancel the protocol. When changes are made and no subsequent errors are detected, the method completes. Depending on the conditions that caused the error, you will only be provided with appropriate options.</block>",
44+
"remove_tips_from_pipette": "Remove tips from {{mount}} pipette before canceling the run?",
4345
"replace_tips_and_select_location": "It's best to replace tips and select the last location used for tip pickup.",
4446
"replace_used_tips_in_rack_location": "Replace used tips in rack location {{location}} in slot {{slot}}",
4547
"replace_with_new_tip_rack": "Replace with new tip rack in slot {{slot}}",
@@ -72,6 +74,5 @@
7274
"tip_not_detected": "Tip not detected",
7375
"view_error_details": "View error details",
7476
"view_recovery_options": "View recovery options",
75-
"you_can_still_drop_tips": "You can still drop the attached tips before proceeding to tip selection.",
76-
"remove_tips_from_pipette": "Remove tips from {{mount}} pipette before canceling the run?"
77+
"you_can_still_drop_tips": "You can still drop the attached tips before proceeding to tip selection."
7778
}

app/src/molecules/InterventionModal/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ const ICON_STYLE = css`
179179
width: ${SPACING.spacing16};
180180
height: ${SPACING.spacing16};
181181
margin: ${SPACING.spacing4};
182+
cursor: pointer;
183+
182184
@media (${RESPONSIVENESS.touchscreenMediaQuerySpecs}) {
183185
width: ${SPACING.spacing32};
184186
height: ${SPACING.spacing32};

app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ export function ProtocolRunHeader({
297297
<>
298298
{isERActive ? (
299299
<ErrorRecoveryFlows
300-
isFlex={true}
301300
runStatus={runStatus}
302301
runId={runId}
303302
failedCommand={failedCommand}

app/src/organisms/ErrorRecoveryFlows/ErrorRecoveryWizard.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as React from 'react'
22
import { useTranslation } from 'react-i18next'
3+
import { css } from 'styled-components'
34

45
import { StyledText } from '@opentrons/components'
56

@@ -101,7 +102,13 @@ export function ErrorRecoveryComponent(
101102
}
102103

103104
const buildIconHeading = (): JSX.Element => (
104-
<StyledText oddStyle="bodyTextSemiBold" desktopStyle="bodyDefaultSemiBold">
105+
<StyledText
106+
oddStyle="bodyTextSemiBold"
107+
desktopStyle="bodyDefaultSemiBold"
108+
css={css`
109+
cursor: pointer;
110+
`}
111+
>
105112
{t('view_error_details')}
106113
</StyledText>
107114
)
@@ -119,18 +126,23 @@ export function ErrorRecoveryComponent(
119126
!isDoorOpen &&
120127
route === RECOVERY_MAP.DROP_TIP_FLOWS.ROUTE &&
121128
step !== RECOVERY_MAP.DROP_TIP_FLOWS.STEPS.BEGIN_REMOVAL
129+
const desktopType = isLargeDesktopStyle ? 'desktop-large' : 'desktop-small'
122130

123131
return (
124132
<RecoveryInterventionModal
125133
iconHeading={buildIconHeading()}
126134
titleHeading={buildTitleHeading()}
127135
iconHeadingOnClick={toggleModal}
128136
iconName="information"
129-
desktopType={isLargeDesktopStyle ? 'desktop-large' : 'desktop-small'}
137+
desktopType={desktopType}
130138
isOnDevice={isOnDevice}
131139
>
132140
{showModal ? (
133-
<ErrorDetailsModal {...props} toggleModal={toggleModal} />
141+
<ErrorDetailsModal
142+
{...props}
143+
toggleModal={toggleModal}
144+
desktopType={desktopType}
145+
/>
134146
) : null}
135147
{buildInterventionContent()}
136148
</RecoveryInterventionModal>

app/src/organisms/ErrorRecoveryFlows/RecoveryOptions/ManageTips.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
StyledText,
1212
RESPONSIVENESS,
1313
} from '@opentrons/components'
14-
import { FLEX_ROBOT_TYPE, OT2_ROBOT_TYPE } from '@opentrons/shared-data'
1514

1615
import { RadioButton } from '../../../atoms/buttons'
1716
import {
@@ -187,10 +186,10 @@ function DropTipFlowsContainer(
187186
props: RecoveryContentProps
188187
): JSX.Element | null {
189188
const {
189+
robotType,
190190
tipStatusUtils,
191191
routeUpdateActions,
192192
recoveryCommands,
193-
isFlex,
194193
currentRecoveryOptionUtils,
195194
} = props
196195
const { DROP_TIP_FLOWS, ROBOT_CANCELING, RETRY_NEW_TIPS } = RECOVERY_MAP
@@ -229,7 +228,7 @@ function DropTipFlowsContainer(
229228
return (
230229
<RecoverySingleColumnContentWrapper>
231230
<DropTipWizardFlows
232-
robotType={isFlex ? FLEX_ROBOT_TYPE : OT2_ROBOT_TYPE}
231+
robotType={robotType}
233232
closeFlow={onCloseFlow}
234233
mount={mount}
235234
instrumentModelSpecs={specs}

app/src/organisms/ErrorRecoveryFlows/RunPausedSplash.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import {
2020
StyledText,
2121
JUSTIFY_END,
2222
PrimaryButton,
23-
ALIGN_FLEX_END,
2423
SecondaryButton,
2524
} from '@opentrons/components'
2625

@@ -115,7 +114,7 @@ export function RunPausedSplash(
115114
<Flex width="49rem" justifyContent={JUSTIFY_CENTER}>
116115
<StepInfo
117116
{...props}
118-
textStyle="level3HeaderBold"
117+
oddStyle="level3HeaderBold"
119118
overflow="hidden"
120119
overflowWrap={OVERFLOW_WRAP_BREAK_WORD}
121120
color={COLORS.white}
@@ -155,7 +154,6 @@ export function RunPausedSplash(
155154
<Flex
156155
gridGap={SPACING.spacing24}
157156
flexDirection={DIRECTION_COLUMN}
158-
alignItems={ALIGN_FLEX_END}
159157
justifyContent={JUSTIFY_SPACE_BETWEEN}
160158
>
161159
<Flex
@@ -180,7 +178,7 @@ export function RunPausedSplash(
180178
<StyledText desktopStyle="headingSmallBold">{title}</StyledText>
181179
<StepInfo
182180
{...props}
183-
textStyle="bodyDefaultRegular"
181+
desktopStyle="bodyDefaultRegular"
184182
overflow="hidden"
185183
overflowWrap={OVERFLOW_WRAP_BREAK_WORD}
186184
textAlign={TEXT_ALIGN_CENTER}

app/src/organisms/ErrorRecoveryFlows/__fixtures__/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ export const mockRecoveryContentProps: RecoveryContentProps = {
5858
robotType: FLEX_ROBOT_TYPE,
5959
runId: 'MOCK_RUN_ID',
6060
isDoorOpen: false,
61-
isFlex: true,
6261
isOnDevice: true,
6362
runStatus: RUN_STATUS_AWAITING_RECOVERY,
6463
recoveryMap: {

app/src/organisms/ErrorRecoveryFlows/__tests__/ErrorRecoveryFlows.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ describe('ErrorRecovery', () => {
129129
runStatus: RUN_STATUS_AWAITING_RECOVERY,
130130
failedCommand: mockFailedCommand,
131131
runId: 'MOCK_RUN_ID',
132-
isFlex: true,
133132
protocolAnalysis: {} as any,
134133
}
135134
vi.mocked(ErrorRecoveryWizard).mockReturnValue(<div>MOCK WIZARD</div>)

app/src/organisms/ErrorRecoveryFlows/constants.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { css } from 'styled-components'
22

3-
import { SPACING, TYPOGRAPHY, RESPONSIVENESS } from '@opentrons/components'
3+
import { SPACING, RESPONSIVENESS } from '@opentrons/components'
44

55
import type { StepOrder } from './types'
66

@@ -204,10 +204,6 @@ export const INVALID = 'INVALID' as const
204204
* Styling
205205
*/
206206

207-
export const BODY_TEXT_STYLE = css`
208-
${TYPOGRAPHY.bodyTextRegular};
209-
`
210-
211207
export const ODD_SECTION_TITLE_STYLE = css`
212208
margin-bottom: ${SPACING.spacing16};
213209
`

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useInstrumentsQuery } from '@opentrons/react-api-client'
2+
import { FLEX_ROBOT_TYPE } from '@opentrons/shared-data'
23

34
import { useRouteUpdateActions } from './useRouteUpdateActions'
45
import { useRecoveryCommands } from './useRecoveryCommands'
@@ -56,7 +57,6 @@ export interface ERUtilsResults {
5657
const SUBSEQUENT_COMMAND_DEPTH = 2
5758
// Builds various Error Recovery utilities.
5859
export function useERUtils({
59-
isFlex,
6060
failedCommand,
6161
runId,
6262
toggleERWizard,
@@ -96,7 +96,7 @@ export function useERUtils({
9696

9797
const tipStatusUtils = useRecoveryTipStatus({
9898
runId,
99-
isFlex,
99+
isFlex: robotType === FLEX_ROBOT_TYPE,
100100
runRecord,
101101
attachedInstruments,
102102
})

0 commit comments

Comments
 (0)