Skip to content

feature(app, components, shared-data): Allow add fixture Modal to choose and place AA #18492

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

Conversation

TamarZanzouri
Copy link
Contributor

@TamarZanzouri TamarZanzouri commented Jun 2, 2025

Overview

closes https://opentrons.atlassian.net/browse/EXEC-1241 and https://opentrons.atlassian.net/browse/EXEC-1414.
Allow add fixture modal to show only AA items to place on the deck.

** known issue - when removing a combo fixture it removes both aa. will fix in a follow up.

Selecting a AA will find the fixture match to update deck configuration.
Screenshot 2025-06-12 at 3 47 30 PM
Screenshot 2025-06-12 at 3 47 37 PM
Screenshot 2025-06-12 at 3 47 47 PM
Screenshot 2025-06-12 at 3 47 56 PM

Test Plan and Hands on Testing

  • make sure you are able to add a waste chute in slot D3 only. (and slot D4 stays empty)
  • make sure you are able to add a waste chute in slot D3 only and then a staging area in D4
  • make sure you are able to add a staging area in D4 and then a waste chute in slot D3 only.
  • make sure you are able to add a staging area in D4 and D3 stays empty.
  • make sure you are able to add a staging area in D4 and then a mag block D3 only.
  • smoke test columns 1+2.
  • smoke test OT2

Changelog

  1. AddFixtureModal component now uses ListItem instead of a Flex component
  2. use ListTable instead of Flex
  3. pass selected aa everywhere related to updating deck config
  4. calculate fixture to update based on aa, cutout and fixture.
  5. refactor logic to use deck def instead of static logic

Review requests

changes make sense? I know its complicated. is there a way I can simplify it? am I missing tets?

Risk assessment

High. need to smoke test PD, Flex app and OT-2

Copy link

codecov bot commented Jun 2, 2025

Codecov Report

Attention: Patch coverage is 31.38833% with 341 lines in your changes missing coverage. Please review.

Project coverage is 25.96%. Comparing base (920312e) to head (e203f3c).
Report is 217 commits behind head on edge.

Files with missing lines Patch % Lines
.../organisms/DeviceDetailsDeckConfiguration/utils.ts 0.00% 230 Missing ⚠️
...DeviceDetailsDeckConfiguration/AddFixtureModal.tsx 0.00% 41 Missing ⚠️
shared-data/js/fixtures.ts 77.40% 40 Missing ⚠️
...uration/hooks/useDeckConfigurationEditingTools.tsx 0.00% 11 Missing ⚠️
app/src/pages/ODD/ProtocolSetup/index.tsx 0.00% 6 Missing ⚠️
...ocolSetup/ProtocolSetupDeckConfiguration/index.tsx 0.00% 5 Missing ⚠️
.../hardware-sim/DeckConfigurator/EmptyConfigItem.tsx 0.00% 4 Missing ⚠️
...onents/src/hardware-sim/DeckConfigurator/index.tsx 0.00% 3 Missing ⚠️
...etupModulesAndDeck/ProtocolSetupModulesAndDeck.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             edge   #18492      +/-   ##
==========================================
- Coverage   26.45%   25.96%   -0.49%     
==========================================
  Files        3266     3285      +19     
  Lines      278189   283917    +5728     
  Branches    32242    34656    +2414     
==========================================
+ Hits        73586    73712     +126     
- Misses     204574   210180    +5606     
+ Partials       29       25       -4     
Flag Coverage Δ
app 3.07% <15.09%> (+<0.01%) ⬆️
components 4.65% <16.29%> (+0.09%) ⬆️
labware-library 3.96% <15.09%> (-0.01%) ⬇️
protocol-designer 19.10% <16.70%> (-0.33%) ⬇️
shared-data 2.54% <29.77%> (+0.16%) ⬆️
step-generation 4.88% <15.09%> (+0.21%) ⬆️

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

Files with missing lines Coverage Δ
components/src/organisms/FixtureOption/index.tsx 100.00% <100.00%> (+15.90%) ⬆️
shared-data/js/constants.ts 100.00% <100.00%> (ø)
...etupModulesAndDeck/ProtocolSetupModulesAndDeck.tsx 0.00% <0.00%> (ø)
...onents/src/hardware-sim/DeckConfigurator/index.tsx 0.79% <0.00%> (+<0.01%) ⬆️
.../hardware-sim/DeckConfigurator/EmptyConfigItem.tsx 32.81% <0.00%> (ø)
...ocolSetup/ProtocolSetupDeckConfiguration/index.tsx 0.00% <0.00%> (ø)
app/src/pages/ODD/ProtocolSetup/index.tsx 0.00% <0.00%> (ø)
...uration/hooks/useDeckConfigurationEditingTools.tsx 0.00% <0.00%> (ø)
shared-data/js/fixtures.ts 71.86% <77.40%> (+11.82%) ⬆️
...DeviceDetailsDeckConfiguration/AddFixtureModal.tsx 0.00% <0.00%> (ø)
... and 1 more

... and 452 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@TamarZanzouri TamarZanzouri requested review from a team as code owners June 12, 2025 19:44
@TamarZanzouri TamarZanzouri requested review from ncdiehl11, sfoster1 and smb2268 and removed request for a team and ncdiehl11 June 12, 2025 19:44
@TamarZanzouri TamarZanzouri requested a review from mjhuff June 12, 2025 20:14
Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

let's fix that known issue before merging IMO

cutoutId: CutoutId,
unconfiguredMods: AttachedModule[]
): CutoutConfigMap[][] => {
let availableOptions: CutoutConfigMap[][] = []
Copy link
Member

Choose a reason for hiding this comment

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

can we refactor this to split it up and avoid the let-binding?

Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

let's fix lint and ci, that might cut down on the diff some; we should also remove changes that were now-unnecessary experiments to fix circular dependencies and so on.

I think there might need to be more testing on addfixturemodal; the test file diff looks a little light for how much changed in the component.

also it kind of seems like that addressable area useState in ODD protocol setup doesn't really do anything? nothing seems to set it. and that seems like it means that conflict modal wouldn't ever pop up on the ODD.

@TamarZanzouri TamarZanzouri requested a review from sfoster1 June 16, 2025 01:20
Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

Nice! Let's get a couple more tests in for the more complicated iterative logic both in the modal component and in s-d fixtures, and then I think we're done here.

Also, please write up the stuff you're doing with the fake replacement fixtures in the PR description - flesh out the "how" a little more. Then we'll make sure that makes it into the commit description.

flexDirection={DIRECTION_ROW}
<ListItem
type="default"
padding="16px"
Copy link
Member

Choose a reason for hiding this comment

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

let's use constants for this instead of literal sizes if possible. also please double check the dqa for the visuals both on odd and desktop

Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

Okay, given the time pressure I think this is solid enough to merge once tests and lint pass. If we have the time, I'd love to see the inner functions i put notes on in AddFixtureModal move to the utils file next to it and their corresponding tests move to utils.test.ts, since some of those inner functions' companions have already done so, but we can also do that in a followup if we need to get it merged right right now.

}),
onClose: closeModal,
closeOnOutsideClick: true,
childrenPadding: SPACING.spacing24,
width: '26.75rem',
}

let availableOptions: CutoutConfig[][] = []
const getUnconfiguredMods = (
Copy link
Member

Choose a reason for hiding this comment

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

this could move to utils

return availableOptions
}

const getModuleOptions = (
Copy link
Member

Choose a reason for hiding this comment

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

this could move to utils

flexDirection={DIRECTION_ROW}
const { onClickHandler, optionName, buttonText } = props
return (
<ListItem
Copy link
Collaborator

Choose a reason for hiding this comment

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

glad you were able to use this DS component 🚀

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.

lgtm! smoke tested PD and it looks good - i did notice a small bug though when adding the thermocycler but its all good, we can fix later on since this is merging into edge 😄 nice work!

@TamarZanzouri TamarZanzouri merged commit ada6450 into edge Jun 17, 2025
55 checks passed
@TamarZanzouri TamarZanzouri deleted the EXEC-1241-component-update-add-fixture-modal-fixture-option-to-use-list-item-component branch June 17, 2025 16:09
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.

4 participants