@@ -111,6 +111,13 @@ export function MoveLabwareOnDeck(
111
111
? finalCoordinates
112
112
: offDeckCoordinates
113
113
114
+ // The user can't see the splash animation if it happens off-deck.
115
+ // Skip it so there's no pause where it looks like nothing is happening.
116
+ const shouldAnimateSplashBeforeMove =
117
+ animationInitialCoordinates !== offDeckCoordinates
118
+ const shouldAnimateSplashAfterMove =
119
+ animationFinalCoordinates !== offDeckCoordinates
120
+
114
121
const shouldReset = usePositionChangeReset (
115
122
animationInitialCoordinates ,
116
123
animationFinalCoordinates
@@ -127,11 +134,13 @@ export function MoveLabwareOnDeck(
127
134
} ,
128
135
to : [
129
136
{ deckOpacity : 1 } ,
130
- { splashOpacity : 1 } ,
131
- { splashOpacity : 0 } ,
137
+ ...( shouldAnimateSplashBeforeMove
138
+ ? [ { splashOpacity : 1 } , { splashOpacity : 0 } ]
139
+ : [ ] ) ,
132
140
{ ...animationFinalCoordinates } ,
133
- { splashOpacity : 1 } ,
134
- { splashOpacity : 0 } ,
141
+ ...( shouldAnimateSplashAfterMove
142
+ ? [ { splashOpacity : 1 } , { splashOpacity : 0 } ]
143
+ : [ ] ) ,
135
144
{ deckOpacity : 0 } ,
136
145
] ,
137
146
loop : true ,
@@ -144,6 +153,8 @@ export function MoveLabwareOnDeck(
144
153
// updates and not updates to the actual x/y/z components.
145
154
...Object . values ( animationInitialCoordinates ) ,
146
155
...Object . values ( animationFinalCoordinates ) ,
156
+ shouldAnimateSplashBeforeMove ,
157
+ shouldAnimateSplashAfterMove ,
147
158
]
148
159
)
149
160
0 commit comments