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): styles and copy in error recovery error #15931

Merged
merged 1 commit into from
Aug 8, 2024
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: 1 addition & 1 deletion app/src/assets/localization/en/error_recovery.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"manually_fill_liquid_in_well": "Manually fill liquid in well {{well}}",
"manually_fill_well_and_skip": "Manually fill well and skip to next step",
"next_step": "Next step",
"next_try_another_action": "Next, you can try another recovery action or cancel the run.",
"no_liquid_detected": "No liquid detected",
"overpressure_is_usually_caused": "Overpressure is usually caused by a tip contacting labware, a clog, or moving viscous liquid too quickly. If the issue persists, cancel the run and make the necessary changes to the protocol.",
"pick_up_tips": "Pick up tips",
Expand All @@ -54,7 +55,6 @@
"retry_with_same_tips": "Retry with same tips",
"retrying_step_succeeded": "Retrying step {{step}} succeeded.",
"return_to_menu": "Return to menu",
"return_to_the_menu": "Return to the menu to choose how to proceed.",
"robot_door_is_open": "Robot door is open",
"robot_is_canceling_run": "Robot is canceling the run",
"robot_is_in_recovery_mode": "Robot is in recovery mode",
Expand Down
24 changes: 17 additions & 7 deletions app/src/organisms/ErrorRecoveryFlows/RecoveryError.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
DIRECTION_COLUMN,
Flex,
Icon,
LegacyStyledText,
StyledText,
SPACING,
ALIGN_CENTER,
JUSTIFY_END,
Expand Down Expand Up @@ -61,7 +61,7 @@ export function ErrorRecoveryFlowError({
<ErrorContent
isOnDevice={isOnDevice}
title={t('recovery_action_failed', { action: userRecoveryOptionCopy })}
subTitle={t('return_to_the_menu')}
subTitle={t('next_try_another_action')}
btnText={t('back_to_menu')}
btnOnClick={onPrimaryClick}
/>
Expand Down Expand Up @@ -103,13 +103,13 @@ export function RecoveryDropTipFlowErrors({
const buildSubTitle = (): string => {
switch (step) {
case ERROR_WHILE_RECOVERING.STEPS.DROP_TIP_GENERAL_ERROR:
return t('return_to_the_menu')
return t('next_try_another_action')
case ERROR_WHILE_RECOVERING.STEPS.DROP_TIP_TIP_DROP_FAILED:
return t('return_to_the_menu')
return t('next_try_another_action')
case ERROR_WHILE_RECOVERING.STEPS.DROP_TIP_BLOWOUT_FAILED:
return t('you_can_still_drop_tips')
default:
return t('return_to_the_menu')
return t('next_try_another_action')
}
}

Expand Down Expand Up @@ -189,8 +189,18 @@ export function ErrorContent({
alignItems={ALIGN_CENTER}
textAlign={ALIGN_CENTER}
>
<LegacyStyledText as="h3Bold">{title}</LegacyStyledText>
<LegacyStyledText as="h4">{subTitle}</LegacyStyledText>
<StyledText
oddStyle="level3HeaderBold"
desktopStyle="headingSmallBold"
>
{title}
</StyledText>
<StyledText
oddStyle="level4HeaderRegular"
desktopStyle="bodyDefaultRegular"
>
{subTitle}
</StyledText>
</Flex>
</Flex>
<Flex justifyContent={JUSTIFY_END}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ describe('RecoveryError', () => {

expect(screen.getByText('Retry step failed')).toBeInTheDocument()
expect(
screen.getByText('Return to the menu to choose how to proceed.')
screen.getByText(
'Next, you can try another recovery action or cancel the run.'
)
).toBeInTheDocument()
expect(screen.getByText('Back to menu')).toBeInTheDocument()
})
Expand All @@ -62,7 +64,9 @@ describe('RecoveryError', () => {

expect(screen.getByText('Retry step failed')).toBeInTheDocument()
expect(
screen.getByText('Return to the menu to choose how to proceed.')
screen.getByText(
'Next, you can try another recovery action or cancel the run.'
)
).toBeInTheDocument()
expect(screen.getByText('Return to menu')).toBeInTheDocument()
})
Expand All @@ -88,7 +92,9 @@ describe('RecoveryError', () => {

expect(screen.getByText('Tip drop failed')).toBeInTheDocument()
expect(
screen.getByText('Return to the menu to choose how to proceed.')
screen.getByText(
'Next, you can try another recovery action or cancel the run.'
)
).toBeInTheDocument()
expect(screen.getByText('Return to menu')).toBeInTheDocument()
})
Expand Down
Loading