Skip to content

feature(app, shared-data): module setup deck config assignment #18864

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

Open
wants to merge 20 commits into
base: edge
Choose a base branch
from

Conversation

TamarZanzouri
Copy link
Contributor

@TamarZanzouri TamarZanzouri commented Jul 9, 2025

Overview

closes https://opentrons.atlassian.net/browse/EXEC-1418.
implement module setup deck configuration.

Test Plan and Hands on Testing

(test both combo fixtures and simple modules)

  1. trigger module setup flows
  2. place module on a slot
  3. make sure the only slots that you are able to press on are allowed for the module
  4. make sure when clicking the slot the module is added to the deck config.

Changelog

SelectLocation will now check for aa matches with combo fixtures.
calculate logic for placing and removing module from deck.
added tests.

Review requests

changes make sense?

Risk assessment

Medium. changes the logic for placing a module on the deck in module setup. need to smoke test.

Copy link

codecov bot commented Jul 9, 2025

Codecov Report

Attention: Patch coverage is 18.47826% with 150 lines in your changes missing coverage. Please review.

Project coverage is 27.68%. Comparing base (f823458) to head (754e149).
Report is 51 commits behind head on edge.

Files with missing lines Patch % Lines
shared-data/js/fixtures.ts 3.89% 74 Missing ⚠️
...src/organisms/ModuleWizardFlows/SelectLocation.tsx 0.00% 56 Missing ⚠️
.../hardware-sim/DeckConfigurator/EmptyConfigItem.tsx 13.33% 13 Missing ⚠️
...onents/src/hardware-sim/DeckConfigurator/index.tsx 0.00% 6 Missing ⚠️
...anisms/ModuleWizardFlows/getFixtureIdByCutoutId.ts 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             edge   #18864       +/-   ##
===========================================
- Coverage   62.81%   27.68%   -35.13%     
===========================================
  Files        3250     3277       +27     
  Lines      257655   261768     +4113     
  Branches    32754    32750        -4     
===========================================
- Hits       161835    72464    -89371     
- Misses      95622   189286    +93664     
+ Partials      198       18      -180     
Flag Coverage Δ
app 2.89% <17.39%> (-45.00%) ⬇️
opentrons-ai-client 3.20% <18.47%> (+0.07%) ⬆️
protocol-designer 19.01% <18.47%> (-0.15%) ⬇️
shared-data 72.78% <ø> (+0.01%) ⬆️
step-generation 5.33% <17.39%> (-0.02%) ⬇️

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

Files with missing lines Coverage Δ
app/src/organisms/ModuleCard/index.tsx 0.00% <ø> (-69.29%) ⬇️
shared-data/js/constants.ts 100.00% <100.00%> (ø)
...anisms/ModuleWizardFlows/getFixtureIdByCutoutId.ts 0.00% <0.00%> (-10.53%) ⬇️
...onents/src/hardware-sim/DeckConfigurator/index.tsx 1.03% <0.00%> (-0.03%) ⬇️
.../hardware-sim/DeckConfigurator/EmptyConfigItem.tsx 29.48% <13.33%> (-3.33%) ⬇️
...src/organisms/ModuleWizardFlows/SelectLocation.tsx 0.00% <0.00%> (-3.11%) ⬇️
shared-data/js/fixtures.ts 43.27% <3.89%> (-28.18%) ⬇️

... and 1691 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 marked this pull request as ready for review July 14, 2025 17:55
@TamarZanzouri TamarZanzouri requested review from a team as code owners July 14, 2025 17:55
@TamarZanzouri TamarZanzouri requested review from ncdiehl11, sfoster1 and smb2268 and removed request for a team and ncdiehl11 July 14, 2025 17:55
@TamarZanzouri TamarZanzouri changed the title Exec 1418 verify select location screen functionality feature(app, shared-data): module setup deck config assignment Jul 14, 2025
@TamarZanzouri TamarZanzouri requested a review from mjhuff July 14, 2025 18:01
Copy link
Contributor

@mjhuff mjhuff left a comment

Choose a reason for hiding this comment

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

Lookin good overall. Approving to unblock work. A few cleanup comments, the main ones some utility recommendations and some docstrings.

I haven't smoke tested this personally, but I think it would be a really good idea to spend the time doing so via VPN/on a robot if not done already!

Comment on lines +72 to +73
console.log('deckConfig: ', deckConfig)
console.log('editableCutoutIds: ', editableCutoutIds)
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
console.log('deckConfig: ', deckConfig)
console.log('editableCutoutIds: ', editableCutoutIds)

>
<Icon name="add-circle" color={COLORS.blue50} size="2rem" />
{!disableButton && (
<Icon name="add-circle" color={COLORS.blue50} size="2rem" />
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
<Icon name="add-circle" color={COLORS.blue50} size="2rem" />
<Icon name="add-circle" color={COLORS.blue50} size={SPACING.whatever} />

@@ -89,6 +95,8 @@ export function DeckConfigurator(props: DeckConfiguratorProps): JSX.Element {
'fakeStagingSlot'
)

console.log('fakeStagingItems: ', fakeStagingItems)
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
console.log('fakeStagingItems: ', fakeStagingItems)

@@ -641,6 +659,17 @@ export const MODULE_FIXTURES_BY_MODEL: {
[FLEX_STACKER_MODULE_V1]: [FLEX_STACKER_V1_FIXTURE],
}

export const MODULE_AA_TYPE_BY_MODEL: {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe FLEX_MODULE_... if this is just pertaining to flex modules?

fixtureId: CutoutFixtureIdsWithFakes,
moduleModel: ModuleModel
): AddressableAreaNamesWithFakes => {
const deckDef = getDeckDefFromRobotType('OT-3 Standard')
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
const deckDef = getDeckDefFromRobotType('OT-3 Standard')
const deckDef = getDeckDefFromRobotType(FLEX_ROBOT_TYPE)

fixtureId: CutoutFixtureId,
moduleModel: ModuleModel,
deckConfig: CutoutConfig[],
serialNumber?: string
Copy link
Contributor

Choose a reason for hiding this comment

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

This serialNumber is effectively a pass through prop that's adding no value except being redefined. Is there any way we can just not include this and have the callee create a new cutout config with opentronsModuleSerialNumber?

@@ -1209,3 +1266,34 @@ export const isFixtureInUsbModules = (fixtureId: CutoutFixtureId): boolean => {
)
)
}

export const getCutoutConfigReplacmentForModule = (
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this fn is called in any non-test code?

mayMountToCutoutIds.includes(cutoutId) &&
(isCurrentConfiguration ||
SINGLE_SLOT_FIXTURES.includes(cutoutFixtureId) ||
FAKE_FIXTURE_IDS.includes(cutoutFixtureId))) ||
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I dont' have the context here. Why do we allow "fake" slot fixtures to be included in editable cutout ids? If this is definitely what we want, a comment on why we do this would be helpful. A comment on FAKE_FIXTURE_IDS would be helpful, too.

return cc
const updatedDeckConfig = deckConfig.map(cc => {
if (cc.cutoutId in configuredFixtureIdByCutoutId) {
let replacementFixtureId: CutoutFixtureId = SINGLE_LEFT_SLOT_FIXTURE
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
let replacementFixtureId: CutoutFixtureId = SINGLE_LEFT_SLOT_FIXTURE
const replacementFixtureId: CutoutFixtureId = SINGLE_LEFT_SLOT_FIXTURE

No let bindings please. Let's spread in the whole object in each case.

} = props

console.log('addressableAreaId: ', addressableAreaId)
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
console.log('addressableAreaId: ', addressableAreaId)

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