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(components): create new LabwareStackRender component #15842

Merged
merged 5 commits into from
Aug 5, 2024

Conversation

ncdiehl11
Copy link
Collaborator

@ncdiehl11 ncdiehl11 commented Jul 30, 2024

Overview

According to new modal designs for labware/adapter/module stacks on desktop and ODD, we need to render an isometric view of each element of the stack, maintaining the topography of each stacked element. The isometric views are constructed by transforming and aligning the labware SVG (top face) along with two new rects (front and left side). All three are scaled, skewed, and rotated at 30˚ angles or its derivatives (reference).

The "bottom" labware definition is an optional prop, so we have an affordance for rendering an isometric view of a single labware from the same component. The user can choose to highlight both or none of the labware in the stack, resulting in a fill of blue30.

In addition, adapters are handled in the following way:

  • If the adapter is used as the top definition and there is no bottom definition, we render the non-transformed LabwareAdapter svg
  • if the adapter is used as the bottom definition, we render the isometric transform of the well-less adapter face. NOTE In this PR, the adapter's height is maintained, but we may also consider setting the height for a bottom adapter as a constant, rendering a standard-height rectangular prism with well-less face.
Screenshot 2024-07-24 at 7 04 19 PM

Closes PLAT-374, PLAT-377, PLAT-394, PLAT-375

Test Plan and Hands on Testing

Difficult to test immediately without new clickable stack on deck map.

Changelog

  • create new isometric view LabwareStackRender component with precedent set from LabwareRender component
  • modify props for LabwareOutline, Well, and StaticLabware to accommodate optional fill color (for optional blue highlight in LabwareStackRender)

Review requests

Please check code logic and smoke test instances of LabwareRender on App and PD. I can make changes to the render once the stack modal is ready.

Risk assessment

Low-Medium. LabwareStackRender is not yet implemented anywhere, but peripheral components touched by this PR are used extensively across our applications, but the changes are minimal

According to new modal designs for labware/adapter/module stacks on desktop and ODD, we need to
render an isometric view of each element of the stack, maintaining the topography of each stacked
item.

Closes PLAT-374, PLAT-377, PLAT-394, PLAT-375
@ncdiehl11 ncdiehl11 changed the title Feat components labwarestackrender feat(components): create new LabwareStackRender component Jul 30, 2024
@ncdiehl11 ncdiehl11 self-assigned this Jul 30, 2024
@ncdiehl11 ncdiehl11 requested review from smb2268 and brenthagen July 30, 2024 22:56
@ncdiehl11 ncdiehl11 marked this pull request as ready for review July 31, 2024 14:04
@ncdiehl11 ncdiehl11 requested a review from a team as a code owner July 31, 2024 14:04
@brenthagen
Copy link
Contributor

Could we add something in storybook for this?

@smb2268 smb2268 requested a review from jerader August 1, 2024 16:46
Copy link
Contributor

@smb2268 smb2268 left a comment

Choose a reason for hiding this comment

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

Code changes all look good! Nice work figuring out all of the projection calculations 🤩 I agree we should add a story for this, but fine with me if you put that in a diff PR to prioritize everything for the merge deadline!

@ncdiehl11 ncdiehl11 requested review from a team as code owners August 5, 2024 16:21
@ncdiehl11 ncdiehl11 changed the base branch from edge to chore_release-8.0.0 August 5, 2024 16:22
@ncdiehl11 ncdiehl11 merged commit b5bc2e7 into chore_release-8.0.0 Aug 5, 2024
48 checks passed
@ncdiehl11 ncdiehl11 deleted the feat_components-labwarestackrender branch August 5, 2024 19:00
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.

3 participants