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

feat(app): complete error handling for calibration on Opentrons Flex #12656

Merged
merged 4 commits into from
May 12, 2023

Conversation

jerader
Copy link
Collaborator

@jerader jerader commented May 8, 2023

closes RLIQ-385

Overview

Previously, when calibrating a pipette, there is erorr handling when attaching the probe. However, there is no way to detach the probe. Now, when you run into that error, it prompts you to detach the probe and then exits the flow.

Screen Shot 2023-05-08 at 1 31 54 PM

Screen Shot 2023-05-08 at 1 49 26 PM

Test Plan

  • test on both desktop app and ODD. Go through calibration, when an error occurs when executing the calibratePipette command, there is now an error modal with information about the error, then prompting the user to hit the next button and then showing the detach probe page. Once you hit "exit calibration", the robot homes and closes the flow. Should be the same for both ODD and desktop.

Changelog

  • create error modal CalibrationErrorModal. Change logic in AttachProbe to show modal when there is an error and then clicking on next shows DetachProbe with no back button and proceeds to exit.
  • add logic to PipetteWizardFlows to show correct wizard header info when exiting from calibration error
  • fix tests

Review requests

see test plan

Risk assessment

low

proceed={proceed}
back={goBack}
back={errorMessage != null ? undefined : goBack}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

figured it made sense to not allow users to go back when you run into this error.

Copy link
Contributor

Choose a reason for hiding this comment

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

definitely!

Comment on lines +319 to +304
const isCalibrationErrorExiting =
currentStep.section === SECTIONS.ATTACH_PROBE && errorMessage != null

Copy link
Collaborator Author

@jerader jerader May 8, 2023

Choose a reason for hiding this comment

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

Basically, when you reach page 1 of the 2 in the error sequence, the exit button from the wizard header is not rendered, this forces the user to hit next and see the 2nd page where the user is prompted to detach the probe.

Comment on lines +331 to +316
const progressBarForCalError =
currentStep.section === SECTIONS.DETACH_PROBE && errorMessage != null

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am not sure if this logic is needed? So when you hit errors elsewhere in the flow, the progress bar stays the same as the page you hit the error on. When you reach the DetachProbe page, this is technically step 2 (at least for calibration flowtype) of the flow but since we hit an error, I am making it say current step - 1, so the progress bar does not progress.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's a good thought, but let's remove for now to keep the logic as simple as possible and then if something comes up in design QA we can reconsider!

@codecov
Copy link

codecov bot commented May 8, 2023

Codecov Report

Merging #12656 (cb9da86) into edge (7b9c8e0) will increase coverage by 0.00%.
The diff coverage is 81.81%.

Impacted file tree graph

@@           Coverage Diff           @@
##             edge   #12656   +/-   ##
=======================================
  Coverage   73.54%   73.55%           
=======================================
  Files        2282     2283    +1     
  Lines       62672    62682   +10     
  Branches     6711     6718    +7     
=======================================
+ Hits        46095    46103    +8     
  Misses      14977    14977           
- Partials     1600     1602    +2     
Flag Coverage Δ
app 72.12% <81.81%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...p/src/organisms/PipetteWizardFlows/AttachProbe.tsx 85.71% <ø> (ø)
app/src/organisms/PipetteWizardFlows/index.tsx 64.64% <60.00%> (-0.62%) ⬇️
...nisms/PipetteWizardFlows/CalibrationErrorModal.tsx 100.00% <100.00%> (ø)
...p/src/organisms/PipetteWizardFlows/DetachProbe.tsx 100.00% <100.00%> (ø)

@jerader jerader force-pushed the app_calibration-error-handling branch from a55b703 to 72ee02d Compare May 8, 2023 17:30
@jerader jerader marked this pull request as ready for review May 8, 2023 17:31
@jerader jerader requested a review from a team as a code owner May 8, 2023 17:31
@jerader jerader requested review from b-cooper, smb2268 and a team and removed request for a team and b-cooper May 8, 2023 17:31
@jerader
Copy link
Collaborator Author

jerader commented May 11, 2023

@ecormany, thoughts on what the modal should say? The one attached in this pr. The modal pops up if you run into an error when attaching the calibration probe. The subheader is the error string. What should the header say?

Copy link
Contributor

@smb2268 smb2268 left a comment

Choose a reason for hiding this comment

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

Tested this out and it looks great!

@ecormany
Copy link
Contributor

The subheader is the error string. What should the header say?

I think we can keep it simple: Pipette calibration failed

This PR may not address it, but the subheader should give context like Detach the probe from the pipette and try calibrating again.

@jerader jerader force-pushed the app_calibration-error-handling branch from 3ecf9be to cb9da86 Compare May 11, 2023 21:16
@jerader jerader merged commit 1e81662 into edge May 12, 2023
25 checks passed
@jerader jerader deleted the app_calibration-error-handling branch May 12, 2023 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants