fix(app): Fix "run again" button after cancelling a run #15987
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes RQA-2982
Overview
After error recovery and drop tip changes, run context is required after the run is cancelled. Before, if the run was cancelled, the app would implicitly close the run context. We can't do that any longer, but in order for some setup buttons to work properly, we need to close the run context somehow.
Currently, after a run is cancelled, the "run again" button is greyed out if a user hasn't calibrated their instruments, although they were just running the protocol prior to cancelling it (note that users can't actually play a run without calibration, but they can create a run). Let's allow users to "run again" (create a run), and then be in the proper run state to perform setup. I don't know if this ever was the intended behavior of protocol runs in the past, but a lot of the existing copy points to this behavior being desired, anyway.
EDIT: After giving this more thought, while I do think we should make the "run again" button selectable to remain consistent with copy and behavioral expectations, it's possible to retain the old behavior as well and close the current run when run status is stopped. It requires more special casing within
ProtocolRunHeader
, butisRunCurrent
is really something only utilized by drop tip CTAs at the end of the day, so it's not too difficult to reason about. Given the overall complexity of these interactions, I think it's best not to push our luck in assuming what does/doesn't work until we formally refactor all of this.TLDR: From an end user perspective, nothing changes between 7.X and 8.0. Functionally, we special-case the drop tip logic to play nicely with run currenting/uncurrenting, tie the new recovery error rendering logic to
isMostRecentRun
(effectively what we were doing in 7.X), and now give the client an escape hatch if the run is cancelled but doesn't close the current run context.Test Plan and Hands on Testing
Changelog
Risk assessment
low