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): Don't render ProtocolRunHeader TerminalBanner on CurrentRun #14233

Merged
merged 3 commits into from
Dec 18, 2023

Conversation

mjhuff
Copy link
Contributor

@mjhuff mjhuff commented Dec 18, 2023

Closes RQA-2013

Overview

This PR fixes an issue where opening the error banner would de-render the error banner. Instead of conditionally rendering the error banner on whether a run is current, let's follow the new pattern we use for the drop tip banner: render it if the mostRecentRunId is the currently viewed run.

Addresses the same issue for clicking on "remove tips" within the drop tip banner - the wizard would never properly start after viewing the error message (since it clears the run).

PR includes some refactoring for the getMostRecentRunId hook to make it a bit safer.

Current Behavior

2023-12-06_15-59-22.1.mp4

Fixed Behavior

Screen.Recording.2023-12-18.at.1.55.58.PM.mov

Test Plan

  • Follow video: Throw an error during a run, then confirm that the error banner/drop tip banner persists after opening the error modal.

Changelog

  • Fixed a bug in which viewing the error modal in a protocol run unrenders the drop tip banner.

Risk assessment

low

The error modal render should not be tied to CurrentRun but rather if the mostRecentRun is the
currently viewed run.
@mjhuff mjhuff requested review from koji and a team December 18, 2023 19:00
@mjhuff mjhuff requested a review from a team as a code owner December 18, 2023 19:00
@@ -1054,26 +1054,4 @@ describe('ProtocolRunHeader', () => {
expect(queryByText('Tips may be attached.')).not.toBeInTheDocument()
})
})

Copy link
Contributor Author

@mjhuff mjhuff Dec 18, 2023

Choose a reason for hiding this comment

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

This test is functionally a duplicate of the one above now that we don't tie the drop tip banners to currentRunId, therefore I removed it.

Copy link

codecov bot commented Dec 18, 2023

Codecov Report

Merging #14233 (0917d9e) into chore_release-7.1.0 (d2e9f57) will increase coverage by 0.02%.
Report is 1 commits behind head on chore_release-7.1.0.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@                   Coverage Diff                   @@
##           chore_release-7.1.0   #14233      +/-   ##
=======================================================
+ Coverage                70.38%   70.41%   +0.02%     
=======================================================
  Files                     2513     1636     -877     
  Lines                    71332    54490   -16842     
  Branches                  9030     4034    -4996     
=======================================================
- Hits                     50210    38369   -11841     
+ Misses                   18917    15421    -3496     
+ Partials                  2205      700    -1505     
Flag Coverage Δ
app 38.83% <ø> (-28.67%) ⬇️

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

see 878 files with indirect coverage changes

@mjhuff mjhuff requested a review from ncdiehl11 December 18, 2023 19:06
@@ -1,8 +1,9 @@
import { useAllRunsQuery } from '@opentrons/react-api-client'
import { last } from 'lodash'
Copy link
Contributor

Choose a reason for hiding this comment

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

Basically we import a specific one instead of importing the entire lodash

Suggested change
import { last } from 'lodash'
import last from 'lodash/last'

return allRuns != null && allRuns.data.length > 0
? allRuns.data[allRuns.data.length - 1].id
return allRuns != null && allRuns.data?.length > 0
? last(allRuns.data)?.id ?? null
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@koji koji left a comment

Choose a reason for hiding this comment

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

The changes look good to me.
Thank you for fixing this.

@mjhuff mjhuff merged commit 87b2993 into chore_release-7.1.0 Dec 18, 2023
22 checks passed
@mjhuff mjhuff deleted the app_error-modal-no-cancel-run branch December 18, 2023 19:48
ncdiehl11 pushed a commit that referenced this pull request Dec 20, 2023
…#14233)

Closes RQA-2013

* fix(app): fix viewing error modal dismissing error and drop tip banners

* refactor(app): refactor useMostRunRecentId to be safer
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.

2 participants