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): Add quick transfer tab and details view #15600

Merged
merged 15 commits into from
Jul 11, 2024

Conversation

smb2268
Copy link
Contributor

@smb2268 smb2268 commented Jul 9, 2024

Fix PLAT-231, PLAT-232, PLAT-233, PLAT-344

Overview

This PR adds all functionality needed for the quick transfer dashboard and details pages. It also addresses a discrepancy in the number of wells selected vs number of wells in the stored stateful object

Test Plan

Smoke test all added functionality - create new quick transfer, see that it shows up on the quick transfer dashboard and not the protocols dashboard, pin and unpin it, view the details page, delete it

Changelog

  1. Added new getSelectedWellCount util and use it to determine more accurate volume limitations
  2. Add protocolKind to ProtocolResource type and use this to filter between protocols and quick transfers in details tabs
  3. Add quick transfer dashboard and details view - this is copy/pasted from the protocols view with some stripped down functionality and copy updates but no new functionality
  4. Add new migration and config type to store pinned quick transfer id's in the same pattern as we do for protocols

Review requests

Does the protocolKind type match the robot server?
Smoke test the new tab and details view including long press, pinning, unpinning, deleting etc

Risk assessment

Low, behind FF

@smb2268 smb2268 self-assigned this Jul 9, 2024
@smb2268 smb2268 marked this pull request as ready for review July 9, 2024 14:09
@smb2268 smb2268 requested review from a team as code owners July 9, 2024 14:09
@smb2268 smb2268 requested review from shlokamin, vegano1 and jerader and removed request for a team July 9, 2024 14:09
Copy link
Collaborator

@jerader jerader left a comment

Choose a reason for hiding this comment

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

nice work! I got through a bit of reviewing so far - this is a massive pr.

app/src/pages/QuickTransferDashboard/LongPressModal.tsx Outdated Show resolved Hide resolved
app/src/pages/QuickTransferDashboard/PinnedTransfer.tsx Outdated Show resolved Hide resolved
app/src/pages/QuickTransferDashboard/QuickTransferCard.tsx Outdated Show resolved Hide resolved
Comment on lines +87 to +89
const pipetteDisplayName =
usePipetteNameSpecs((protocolHardware as ProtocolPipette).pipetteName)
?.displayName ?? ''
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is a todo in the future but since usePipetteNameSpecs returns the v1 specs, it should be deprecated and we shouldn't use it. I think instead we should make a new util that returns the pipetteName given the pipetteV2Specs info

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah I thought about this -- I think we should leave as is for now to match ProtocolDetails and since v1 is already anonymized for OEM mode and we haven't done that for v2 yet. But I agree we should try to find some time in continuing work to complete the migration over to the new schema!

shared-data/js/types.ts Show resolved Hide resolved
@smb2268 smb2268 force-pushed the app_quick-transfer-tab-updates branch from c012069 to 8b7ed0e Compare July 10, 2024 15:55
import { useNetworkConnection } from '../../../resources/networking/hooks/useNetworkConnection'
import { NavigationMenu } from '../NavigationMenu'
import { Navigation } from '..'
import { when } from 'vitest-when'
Copy link
Contributor

Choose a reason for hiding this comment

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

this line can be moved up

// TODO(sb:7/10/24): update this wrapper to fade on both sides only when not scrolled completely to that side
// This will be accomplished in PLAT-399
const CarouselWrapper = styled.div`
display: flex;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
display: flex;
display:${DISPLAY_FLEX};

flex-direction: ${DIRECTION_ROW};
align-items: ${ALIGN_FLEX_START};
width: 650px;
overflow-x: scroll;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
overflow-x: scroll;
overflow-x: ${OVERFLOW_SCROLL};

display: flex;
flex-direction: ${DIRECTION_ROW};
align-items: ${ALIGN_FLEX_START};
width: 650px;
Copy link
Contributor

Choose a reason for hiding this comment

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

If there is no specific reason to use px

Suggested change
width: 650px;
width: 40.625rem;

Copy link
Contributor

Choose a reason for hiding this comment

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

and probably a bit wider (1.5rem or so) to eyeball the full width from figma. 42.25rem works for me:

Screen Shot 2024-07-11 at 11 08 51 AM

} = {
full: {
fontSize: TYPOGRAPHY.fontSize32,
height: '8.875rem',
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure that we need to use the same height, but I updated the height for RTP Csv file support.

the following two cases too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I'm not sure either - Quick Transfer protocols won't have RTP so the previous height is probably sufficient space wise but I'll flag this for Felix to look at in design QA.

Comment on lines +160 to +166
&:active {
background-color: ${longpress.isLongPressed
? ''
: isFailedAnalysis
? COLORS.red40
: COLORS.grey50};
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we avoid using a nested ternary.

Copy link
Contributor

@vegano1 vegano1 left a comment

Choose a reason for hiding this comment

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

I pushed this to a Flex, I was able to create and successfully run a quick transfer protocol first try! The protocolKind form data looks good and protocols are correctly being filtered and shown in their corresponding tabs.
Awesome work!

Comment on lines +32 to +33
import type { ProtocolHardware, ProtocolPipette } from '../Protocols/hooks'
import type { TFunction } from 'i18next'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
import type { ProtocolHardware, ProtocolPipette } from '../Protocols/hooks'
import type { TFunction } from 'i18next'
import type { TFunction } from 'i18next'
import type { ProtocolHardware, ProtocolPipette } from '../Protocols/hooks'

Copy link

codecov bot commented Jul 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.91%. Comparing base (3479875) to head (60b53b0).
Report is 20 commits behind head on edge.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             edge   #15600      +/-   ##
==========================================
+ Coverage   60.12%   62.91%   +2.78%     
==========================================
  Files         190      218      +28     
  Lines       10627    12829    +2202     
==========================================
+ Hits         6390     8071    +1681     
- Misses       4237     4758     +521     
Flag Coverage Δ
shared-data 76.33% <ø> (?)

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

see 28 files with indirect coverage changes

Copy link
Contributor

@brenthagen brenthagen left a comment

Choose a reason for hiding this comment

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

LGTM !

@smb2268 smb2268 merged commit f4c38c2 into edge Jul 11, 2024
34 checks passed
@smb2268 smb2268 deleted the app_quick-transfer-tab-updates branch July 11, 2024 16:16
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.

6 participants