Skip to content

fix(components): Fix module positioning in more deck maps #18874

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

Merged
merged 7 commits into from
Jul 10, 2025

Conversation

SyntaxColoring
Copy link
Contributor

Overview

Exactly the same thing as #18871 / EXEC-1645, just in different places.

Test Plan and Hands on Testing

  • Checked the protocol details page to make sure its deck map has the Thermocycler positioned correctly now.

    Screenshot 2025-07-10 at 10 56 20 AM
  • Audited all uses of <Module> to see if there are any other places I missed. Found one in protocol-designer, see comments.

Review requests

See comments.

Risk assessment

Medium. Fixing the positioning of <Module> means it's possible that things that were previously aligned to the incorrect positioning of <Module> will now be misaligned and look wrong.

@SyntaxColoring SyntaxColoring requested review from mjhuff and jerader July 10, 2025 15:01
@SyntaxColoring SyntaxColoring requested a review from a team as a code owner July 10, 2025 15:01
Copy link

codecov bot commented Jul 10, 2025

Codecov Report

Attention: Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.

Project coverage is 56.51%. Comparing base (9964abd) to head (784125e).
Report is 5 commits behind head on edge.

Files with missing lines Patch % Lines
components/src/hardware-sim/BaseDeck/BaseDeck.tsx 50.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             edge   #18874       +/-   ##
===========================================
+ Coverage   23.82%   56.51%   +32.69%     
===========================================
  Files        3329     3329               
  Lines      287227   287340      +113     
  Branches    35927    36607      +680     
===========================================
+ Hits        68420   162404    +93984     
+ Misses     218781   124730    -94051     
- Partials       26      206      +180     
Flag Coverage Δ
app 47.42% <57.14%> (+47.09%) ⬆️
protocol-designer 19.02% <57.14%> (-0.01%) ⬇️
step-generation 5.32% <0.00%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
components/src/hardware-sim/Module/index.tsx 86.06% <100.00%> (+21.35%) ⬆️
...ner/src/pages/Designer/DeckSetup/SelectedItems.tsx 98.30% <100.00%> (+0.02%) ⬆️
components/src/hardware-sim/BaseDeck/BaseDeck.tsx 54.37% <50.00%> (+52.22%) ⬆️

... and 1759 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.

Comment on lines +106 to +111
{/*
todo(mm, 2025-07-10): This <Module> and <ModuleLabel> positioning is not
quite right, most obviously for the Thermocycler on a Flex. We aren't
passing a targetSlotId and targetDeckId down to <Module>, which means
it isn't applying slot-specific adjustments.
*/}
Copy link
Contributor Author

@SyntaxColoring SyntaxColoring Jul 10, 2025

Choose a reason for hiding this comment

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

@jerader Heads up for this.

I tried to fix this here, but fixing the positioning of <Module> leaves the <ModuleLabel> behind so then the <ModuleLabel> looks misaligned, and it wasn't immediately clear how that could be solved. We could pass targetSlotId and targetDeckId to <ModuleLabel> too, and have <ModuleLabel> duplicate <Module>'s math for applying slot-specific transforms, I guess? Kind of a bummer.

In other contexts, I've been exploring extracting the positioning transform logic into separate components. If we did that here, we could have something like:

<AlignModuleToSlot deckDef=... moduleDef=... slotId=...>
  <Module moduleDef=... /* no slotId or deckId needed */ />
  <ModuleLabel ... /* no slotId or deckId needed */ />
</AlignModuleToSlot>

But that was a bit much for me to attempt right here and now.

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.

Looks good, one comment to consider.

@SyntaxColoring SyntaxColoring requested a review from a team as a code owner July 10, 2025 18:26
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.

Perfect, thanks

@SyntaxColoring SyntaxColoring merged commit 9c22e13 into edge Jul 10, 2025
69 of 70 checks passed
@SyntaxColoring SyntaxColoring deleted the more_module_positioning_fixes branch July 10, 2025 19:29
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