Skip to content

Conversation

@SyntaxColoring
Copy link
Contributor

@SyntaxColoring SyntaxColoring commented Dec 5, 2025

Overview

Continued efforts to migrate away from positioningMode="offsetInSlot"/"offsetToSlot", where <LabwareRender> and <Module> have some built-in SVG transforms, to positioningMode="passThrough", where they don't. This goes towards EXEC-1278. See the documentation on <LabwareRender> and <Module> for more background on positioningMode.

After this PR, it looks like the only things left that are using positioningMode="offsetInSlot"/"offsetToSlot" are in protocol-designer.

This depends on PR #20285 and will need to merge after it.

Test Plan and Hands on Testing

The JogToWell/LPCLabwareJogRender changes are the ones that worried me the most, and I've checked those in the desktop app.

Changelog

Update various call sites of <LabwareRender> to use positioningMode="passThrough". This involves understanding what each call site was trying to do and making adjustments to its stack of SVG transforms, if necessary.

Review requests

See the individual commit messages for notes on each call site.

Risk assessment

Low risk, given the test plan above, I think. But there's a chance this will cause labware or modules to be rendered in the wrong position.

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.

Super, thank you!

No further changes needed for this one. This labware thumbnail was already using getLabwareViewBox(), so passThrough was correct.
This one is tricky for a few reasons.

1. We're hard-coding an SVG viewbox that's a bit bigger than a deck slot, and expecting the labware to show up roughly in the middle of it when we plop it in.
2. We're rendering not only a labware, but also a pipette that's supposed to go show up over the labware's wells. So the pipette component needs to be in the same coordinate system as the labware component. I think this was actually buggy before. The labware offset itself by `cornerOffsetFromSlot` (because it had `positioningMode="offsetInSlot"`), but the pipette didn't match that.

Therefore:

1. We need `<CenterLabwareInSlot>`, even though we're not rendering a deck slot.
2. We need the `<CenterLabwareInSlot>` to wrap the labware component *and* the pipette component, not just the labware component.
This one is a pretty straightforward labware thumbnail. Formerly, we were making the labware offset itself (`positioningMode="offsetInSlot"`), then manually predicting where it ended up using `getSchema2CornerOffsetFromSlot()`. Now we don't let the labware offset itself (`positioningMode="passThrough"`), and we directly get the thumbnail viewbox with `getLabwareViewBox()`.
This code was already using a `useLayoutEffect()` to automatically compute an SVG viewbox that enclosed the labware, so it never really mattered how the labware was translated in 2D space. The viewbox would automatically translate to follow it, no matter what. So we can just flip `offsetInSlot` to `passThrough` here without needing to change anything else.
@SyntaxColoring SyntaxColoring requested review from a team as code owners December 9, 2025 18:47
@SyntaxColoring SyntaxColoring changed the base branch from fix_labware_rendered_off_center to edge December 9, 2025 18:47
@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

❌ Patch coverage is 0% with 42 lines in your changes missing coverage. Please review.
✅ Project coverage is 25.58%. Comparing base (7512850) to head (17a098c).
⚠️ Report is 25 commits behind head on edge.

Files with missing lines Patch % Lines
...ProtocolVisualization/DeckView/DeckViewModules.tsx 0.00% 17 Missing ⚠️
...ProtocolVisualization/DeckView/DeckViewLabware.tsx 0.00% 13 Missing ⚠️
...re/EditOffset/CheckLabware/LPCLabwareJogRender.tsx 0.00% 3 Missing ⚠️
...organisms/LegacyLabwarePositionCheck/JogToWell.tsx 0.00% 3 Missing ⚠️
...tup/ProtocolSetupLabware/SetupLabwareStackView.tsx 0.00% 3 Missing ⚠️
...p/ProtocolVisualization/DeckView/LabwareOnDeck.tsx 0.00% 1 Missing ⚠️
...ProtocolVisualization/TipPickupContainer/index.tsx 0.00% 1 Missing ⚠️
...re-creator/components/ConditionalLabwareRender.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             edge   #20302      +/-   ##
==========================================
- Coverage   25.58%   25.58%   -0.01%     
==========================================
  Files        3640     3640              
  Lines      303120   303129       +9     
  Branches    42327    42327              
==========================================
  Hits        77552    77552              
- Misses     225544   225553       +9     
  Partials       24       24              
Flag Coverage Δ
protocol-designer 19.35% <0.00%> (-0.01%) ⬇️
step-generation 5.62% <0.00%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
...p/ProtocolVisualization/DeckView/LabwareOnDeck.tsx 0.00% <0.00%> (ø)
...ProtocolVisualization/TipPickupContainer/index.tsx 0.00% <0.00%> (ø)
...re-creator/components/ConditionalLabwareRender.tsx 36.73% <0.00%> (ø)
...re/EditOffset/CheckLabware/LPCLabwareJogRender.tsx 0.00% <0.00%> (ø)
...organisms/LegacyLabwarePositionCheck/JogToWell.tsx 0.00% <0.00%> (ø)
...tup/ProtocolSetupLabware/SetupLabwareStackView.tsx 0.00% <0.00%> (ø)
...ProtocolVisualization/DeckView/DeckViewLabware.tsx 0.00% <0.00%> (ø)
...ProtocolVisualization/DeckView/DeckViewModules.tsx 0.00% <0.00%> (ø)
🚀 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.

@SyntaxColoring SyntaxColoring merged commit 6d5e788 into edge Dec 9, 2025
128 of 129 checks passed
@SyntaxColoring SyntaxColoring deleted the refactor_offsetinslot branch December 9, 2025 21:27
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