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): put blocking user flows in new top level modal portal #6821

Merged

Conversation

b-cooper
Copy link
Contributor

@b-cooper b-cooper commented Oct 19, 2020

Overview

There are a number of new calibration calibration flows that launch a wizard style modal in response
to creating a calibration session on the robot. These modals were, like all existing modals in the
app, rendered into a portal component that is a sibling of the two side panels in the main
App layout component.

This meant that users were able to interact with the navigation tabs and the
contents of the side panel during these captive flows that involve precise coordination and movement
on the robot.

In order protect against uncharacterized behavior when users navigate away from the
the current tab during a calibration user flow, this adds a new top level modal portal. Modals
rendered in this portal will span the entire window of the app, and provide assurance that a session
will be deleted any time a user navigates away from, or completes a calibration user flow.

Changelog

  • Add new level prop to the app's Portal component. It will default to the string "page" which specifies the existing portal level.
  • Add portal level "top", which specifies a children to be rendered into a portal that is a sibling of the SidePanel and NavBar components. (one level higher than the page)
  • add level="top" prop to all modals within calibration overhaul flows.

Review requests

  • Please run Deck Calibration, Pipette Offset Calibration, Tip Length Calibration, Calibration Health Check, and the interconnected flows and confirm that the modals span the whole screen and behave as expected.

Risk assessment

Medium, although this doesn't effect modals that exist outside of the new calibration overhaul code, this type of block modal UX hasn't existed in the app before. By introducing a new paradigm we risk trapping users on the modal if something were to go wrong in deleting the session. (users might have previously just navigated away and come back to a tab)

There are a number of new calibration calibration flows that launch a wizard style modal in response
to creating a calibration session on the robot. These modals were, like all existing modals in the
app, rendered into a portal component that is a sibling of the two side panel components in the main
layout component. This meant that users were able to interact with the navigation tabs and the
contents of the sidepanel during these captive flows that involve precise coordination and movement
on the robot. In order protect against uncharacterized behavior when users navigate away from the
the current tab during a calibration user flow, this adds a new top level modal portal. Modals
rendered in this portal will span the entire window of the app, and provide assurance that a session
will be deleted any time a user navigates away from, or completes a calibration user flow.
@b-cooper b-cooper added app Affects the `app` project hmg hardware, motion, and geometry ready for review labels Oct 19, 2020
@b-cooper b-cooper requested review from a team, mcous and Laura-Danielle and removed request for a team October 19, 2020 21:42
@@ -91,6 +91,7 @@ export function App(): React.Node {
<ModalPortalRoot />
<Alerts />
</Box>
<TopPortalRoot />
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like it will render over <Alerts />, which is persistent app alerts that will be rendered regardless of URL route (currently, app update available alert and USB to Ethernet driver outdated alert).

The intention of <Alerts> is to have global app alerts, so I don't think this should render over them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good point. If the intention of the <Alerts> is to be global as well, then perhaps the solution is also move them outside of the page Box?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, something like that could make a lot of sense / might be necessary if this is a larger UI direction we're taking with the app

Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

Tested the app flows; the only kinda weird one is change pipette where you go from a page portal that drives the change pipette flow to a top portal for calibration, which also has that problem we know about where the portal goes away while the session is starting, but I think it's still better.

@b-cooper b-cooper added this to the HMG Sprint 20 milestone Oct 20, 2020
@b-cooper b-cooper marked this pull request as ready for review October 21, 2020 15:14
@b-cooper b-cooper requested a review from a team as a code owner October 21, 2020 15:14
@codecov
Copy link

codecov bot commented Oct 21, 2020

Codecov Report

❗ No coverage uploaded for pull request base (chore_release-4.0.0-beta.0@f3ab314). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@                      Coverage Diff                      @@
##             chore_release-4.0.0-beta.0    #6821   +/-   ##
=============================================================
  Coverage                              ?   89.05%           
=============================================================
  Files                                 ?      101           
  Lines                                 ?     4521           
  Branches                              ?        0           
=============================================================
  Hits                                  ?     4026           
  Misses                                ?      495           
  Partials                              ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f3ab314...63aadfc. Read the comment docs.

Copy link
Contributor

@mcous mcous left a comment

Choose a reason for hiding this comment

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

After thinking through this some more, I don't think this is the best approach we have available to us. Approving for user-testing beta build purposes.

A state-connected component that can determine if it should render based on API session state from Redux, with enough props passed in from its parent to account for the different UI contexts in which it's placed, should solve the problem as it's laid out in the PR description (I think) in a more robust manner.

@b-cooper b-cooper merged commit 0e62ff4 into chore_release-4.0.0-beta.0 Oct 21, 2020
@mcous mcous deleted the app_navigation-full-window-modal-portal branch October 26, 2020 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app Affects the `app` project hmg hardware, motion, and geometry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants