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): handle non-deterministic protocols #12173

Merged
merged 4 commits into from
Mar 3, 2023

Conversation

jgbowser
Copy link
Contributor

@jgbowser jgbowser commented Feb 16, 2023

Overview

When a protocol run is non-deterministic we now hide the jump to the current step button, hide the progress meter, and only display the total count of commands in the run to avoid any confusion or misdirection.

closes RLAB-299

Test Plan

Tested locally during development with automated tests and by short-circuiting some logic to force a "non-deterministic state"

Changelog

  • conditionally render jump to step button in RunPreview to only show when a run is deterministic
  • Hide progress bar in RunProgressMeter when a protocol is non-deterministic
  • Display current step as total-run-commands/? when a protocol is non-deterministic
  • adds a test file for the RunProgressMeter component

Review requests

Please give this a run on a robot, I am not able to test this in action using only the Sim.

Risk assessment

fairly low, just UI changes for edge cases

@jgbowser jgbowser force-pushed the rlab-299-handle-non-deterministic-protocols branch from 5693664 to 5cbcde1 Compare February 16, 2023 20:47
@codecov
Copy link

codecov bot commented Feb 16, 2023

Codecov Report

Merging #12173 (5bc0ea3) into edge (60efb43) will increase coverage by 0.01%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##             edge   #12173      +/-   ##
==========================================
+ Coverage   74.03%   74.05%   +0.01%     
==========================================
  Files        2172     2172              
  Lines       59831    59842      +11     
  Branches     6145     6151       +6     
==========================================
+ Hits        44297    44313      +16     
+ Misses      14151    14129      -22     
- Partials     1383     1400      +17     
Flag Coverage Δ
app 72.57% <33.33%> (+0.05%) ⬆️

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

Impacted Files Coverage Δ
app/src/organisms/RunPreview/index.tsx 13.04% <0.00%> (-0.60%) ⬇️
app/src/organisms/RunProgressMeter/index.tsx 39.13% <41.66%> (+36.27%) ⬆️
app-shell/src/system-info/usb-devices.ts 81.48% <0.00%> (-3.71%) ⬇️
...ata/js/helpers/getLoadedLabwareDefinitionsByUri.ts 0.00% <0.00%> (ø)

@@ -54,12 +60,20 @@ export function RunProgressMeter(props: RunProgressMeterProps): JSX.Element {
const lastRunCommandKey = useLastRunCommandKey(runId)
const lastRunCommandIndex =
analysisCommands.findIndex(c => c.key === lastRunCommandKey) ?? 0
const lastRunCommandIndexFromAllCommands =
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like the actual value that we want is from the meta of allCommandsQuery response. It includes a totalLength key whose value we should be able to sub in for the numerator in the case that the run is non-deterministic

Copy link
Contributor Author

@jgbowser jgbowser Feb 16, 2023

Choose a reason for hiding this comment

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

just to make sure I understand then, the denominator should be a "?" and the numerator should be the totalLength of the commands: totalLength / ?

Comment on lines 63 to 68
const lastRunCommandIndexFromAllCommands =
runCommands.findIndex(c => c.key === lastRunCommandKey) ?? 0
const { data: commandDetails } = useCommandQuery(
runId,
runCommands[lastRunCommandIndexFromAllCommands]?.id
)
Copy link
Contributor Author

@jgbowser jgbowser Feb 21, 2023

Choose a reason for hiding this comment

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

@b-cooper I'm now grabbing the totalLength from meta and displaying that, but I believe I still need these lines to be able to access the command text from the run rather than the analysis as I'm currently doing in L 89-96, correct?

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, that's correct 👍

@jgbowser jgbowser force-pushed the rlab-299-handle-non-deterministic-protocols branch from ed80b78 to 2d8319c Compare February 21, 2023 21:30
@jgbowser jgbowser marked this pull request as ready for review February 22, 2023 16:56
@jgbowser jgbowser requested a review from a team as a code owner February 22, 2023 16:56
@jgbowser jgbowser requested review from jerader and removed request for a team February 22, 2023 16:56
@jgbowser jgbowser changed the title DRAFT handle non-deterministic protocols feat(app): handle non-deterministic protocols Feb 22, 2023
Copy link
Contributor

@b-cooper b-cooper left a comment

Choose a reason for hiding this comment

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

Changes look good, thanks for making those tweaks 👍

@jgbowser
Copy link
Contributor Author

jgbowser commented Mar 2, 2023

Changes look good, thanks for making those tweaks 👍

No problem, am I good to merge this then, or is there still some dev testing required?

@jgbowser jgbowser merged commit 089fa48 into edge Mar 3, 2023
@jgbowser jgbowser deleted the rlab-299-handle-non-deterministic-protocols branch March 3, 2023 16:45
y3rsh added a commit that referenced this pull request Mar 6, 2023
* edge:
  refactor(protocol-engine): Shorten error docstrings (#12230)
  chore(app): update electron-builder version from v24 alpha to v24 (#12233)
  chore(app): add new icons for ODD hi-fi (#12231)
  docs: more release docs (#12226)
  fix(app, odd): check isOnDevice true instead of if it is null (#12228)
  docs: remove references to make bump in releasing (#12222)
  refactor(app): scroll to current split from jump to tick, qol tweaks to run preview (#12218)
  fix(app): rewire cli and jupyter snippets to offsets modals  (#12180)
  feat(app): handle non-deterministic protocols (#12173)
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