-
Notifications
You must be signed in to change notification settings - Fork 175
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
refactor(app): currentOffsetModal only displays latest offsets #11913
refactor(app): currentOffsetModal only displays latest offsets #11913
Conversation
Codecov Report
@@ Coverage Diff @@
## edge #11913 +/- ##
==========================================
- Coverage 74.17% 73.97% -0.20%
==========================================
Files 2164 2186 +22
Lines 59753 60727 +974
Branches 6265 6526 +261
==========================================
+ Hits 44323 44925 +602
- Misses 13953 14271 +318
- Partials 1477 1531 +54
Flags with carried forward coverage won't be shown. Click here to find out more.
|
9ee5ed3
to
2d58aa1
Compare
export function getLatestCurrentOffsets( | ||
currentOffsets: LabwareOffset[] | ||
): LabwareOffset[] { | ||
const reverseCurrentOffsets = [...currentOffsets].reverse() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we reversing the array here? We shouldn't be relying on the inherent order of the offsets that we get back from the robot.
const latestCurrentOffsets = reverseCurrentOffsets.filter( | ||
(currentOffset, index) => | ||
currentOffset.location.slotName === uniqueSlots[index] && | ||
!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we've use isEqual(currentOffset.vector, IDENTITY_VECTOR)
else for this comparison
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code lgtm, will test on a robot in a sec
@@ -82,5 +82,6 @@ | |||
"labware_position_check_description": "<block>Labware Position Check is a guided workflow that checks every labware on the deck for an added degree of precision in your protocol.</block><block>Labware Position Check first checks tip racks, and then checks all other labware used in your protocol.</block>", | |||
"all_modules_and_labware_from_protocol": "All modules and labware used in the protocol", | |||
"module_in_slot": "{{module}} in {{slot}}", | |||
"run_labware_position_check": "run labware position check" | |||
"run_labware_position_check": "run labware position check", | |||
"get_labware_offset_data": "Get Labware Offset Data" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not introduced by this PR, and probably warrants a bigger discussion with the whole app & ui team, but we probably shouldn't be having any sort of formatting (like capitalization) being done inside of these i18n files. i think we should instead always have these json files have lower case text, and hoist the responsibility of any formatting to be done by the consuming component.
will make a note to self to bring this up when everyone is back
const latestCurrentOffsets = nonIdentityOffsets.reduce<LabwareOffset[]>( | ||
(acc, offset) => { | ||
const previousMatchIndex = acc.findIndex( | ||
ao => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, can we name ao
something more descriptive? reduce's are sorta tough to read as is
uh so i'm not sure what is going on, but i can't run LPC at all using protocols generated from prod PD on a robot running with sw version this line in const labwareDef = labwareDefinitions[currentLabware.definitionUri] the protocol's labware key does not have a there was some change regarding definitionId vs definitionUri that happened recently right @smb2268? |
Yeah we removed the translation of When @b-cooper and I were pairing on resolving the conflicts between the schemaV6Adapter removal stuff and his new LPC changes, we decided not to invest the time to make sure the old LPC still worked since it won't ever be accessible in a release. So all of the |
I can test LPC with the ff turned on with my robot this morning, and if it works I am leaning towards leaving this as is since we will be removing the deprecated components in the q1 release. @shlokamin @smb2268 |
0d29c1c
to
026ff49
Compare
After discussing with Shlok yesterday, it seems that we want to be able to get through LPC on a robot to test this out before merging. However, it does work properly on simulator & emulator. When attempting to test on a robot that is up to date with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
closes RLAB-200
Overview
CurrentOffsetModal
used to display all offsets even duplicates and labware offsets where the vector values are all 0. This PR creates a utilgetLatestCurrentOffsets
that filters out the old offsets and the offsets that are 0. Additionally, this PR wires up the LPC cta inCurrentOffsetModal
as well as keeping the disabled reason the same as in the main LPC CTA button.Changelog
getLatestCurrentOffsets
and testCurrentOffsetsModal
CurrentOffsetModal
testuseLPCDisabledReason
hook that is used inLaunchLabwarePositionCheck
andCurrentOffsetsModal
, create test for the hookReview requests
go through LPC and add some offsets - go through it a few times, the
CurrentOffsetModal
should display only the latest offsets that were created. if there is a reason for the LPC CTA to be disabled, it should also be reflected in the modalRisk assessment
low