@@ -9,12 +9,14 @@ import {
9
9
CommandText ,
10
10
CURSOR_POINTER ,
11
11
DIRECTION_COLUMN ,
12
+ Divider ,
12
13
Flex ,
13
14
getLabwareDefinitionsFromCommands ,
14
15
Icon ,
15
16
LegacyStyledText ,
16
17
OVERFLOW_AUTO ,
17
18
SPACING ,
19
+ StyledText ,
18
20
TYPOGRAPHY ,
19
21
} from '@opentrons/components'
20
22
import { FLEX_ROBOT_TYPE } from '@opentrons/shared-data'
@@ -79,13 +81,13 @@ export function AnnotatedSteps(props: AnnotatedStepsProps): JSX.Element {
79
81
< Flex
80
82
css = { HIDE_SCROLLBAR }
81
83
flexDirection = { DIRECTION_COLUMN }
82
- maxHeight = "82vh"
83
- flex = "1 1 0"
84
+ // maxHeight="82vh"
85
+ // flex="1 1 0"
84
86
overflowY = { OVERFLOW_AUTO }
85
87
>
86
88
< Flex
87
89
flexDirection = { DIRECTION_COLUMN }
88
- marginY = { SPACING . spacing16 }
90
+ // marginY={SPACING.spacing16}
89
91
gridGap = { SPACING . spacing4 }
90
92
>
91
93
{ groupedCommandsHighlightedInfo != null &&
@@ -94,19 +96,16 @@ export function AnnotatedSteps(props: AnnotatedStepsProps): JSX.Element {
94
96
'annotationIndex' in c ? (
95
97
< AnnotatedGroup
96
98
key = { `group-${ i } ` }
97
- stepNumber = { ( i + 1 ) . toString ( ) }
98
99
analysis = { analysis }
99
100
annotationType = {
100
101
annotations [ c . annotationIndex ] ?. machineReadableName
101
102
}
102
- isHighlighted = { c . isHighlighted }
103
103
subCommands = { c . subCommands }
104
104
allRunDefs = { allRunDefs }
105
105
/>
106
106
) : (
107
107
< IndividualCommand
108
108
key = { c . command . id }
109
- stepNumber = { ( i + 1 ) . toString ( ) }
110
109
command = { c . command }
111
110
isHighlighted = { c . isHighlighted }
112
111
analysis = { analysis }
@@ -117,7 +116,6 @@ export function AnnotatedSteps(props: AnnotatedStepsProps): JSX.Element {
117
116
: analysis . commands . map ( ( c , i ) => (
118
117
< IndividualCommand
119
118
key = { i }
120
- stepNumber = { ( i + 1 ) . toString ( ) }
121
119
command = { c }
122
120
isHighlighted = { i === currentCommandIndex }
123
121
analysis = { analysis }
@@ -133,123 +131,71 @@ interface AnnotatedGroupProps {
133
131
annotationType : string
134
132
subCommands : LeafNode [ ]
135
133
analysis : ProtocolAnalysisOutput | CompletedProtocolAnalysis
136
- stepNumber : string
137
- isHighlighted : boolean
138
134
allRunDefs : LabwareDefinition [ ]
139
135
}
140
136
function AnnotatedGroup ( props : AnnotatedGroupProps ) : JSX . Element {
141
- const {
142
- subCommands,
143
- annotationType,
144
- analysis,
145
- stepNumber,
146
- allRunDefs,
147
- isHighlighted,
148
- } = props
137
+ const { subCommands, annotationType, analysis, allRunDefs } = props
149
138
const [ isExpanded , setIsExpanded ] = useState ( false )
150
- const backgroundColor = isHighlighted ? COLORS . blue30 : COLORS . grey20
151
139
return (
152
140
< Flex
153
141
onClick = { ( ) => {
154
142
setIsExpanded ( ! isExpanded )
155
143
} }
156
144
cursor = { CURSOR_POINTER }
145
+ width = "100%"
157
146
>
158
- { isExpanded ? (
159
- < Flex flexDirection = { DIRECTION_COLUMN } >
160
- < Flex
161
- alignItems = { ALIGN_CENTER }
162
- alignSelf = { ALIGN_FLEX_START }
163
- gridGap = { SPACING . spacing8 }
164
- >
165
- < LegacyStyledText
166
- minWidth = { SPACING . spacing16 }
167
- fontSize = { TYPOGRAPHY . fontSizeCaption }
168
- >
169
- { stepNumber }
170
- </ LegacyStyledText >
171
- < Flex
172
- alignItems = { ALIGN_CENTER }
173
- backgroundColor = { backgroundColor }
174
- color = { COLORS . black90 }
175
- borderRadius = { BORDERS . borderRadius4 }
176
- padding = { `${ SPACING . spacing8 } ${ SPACING . spacing8 } ${ SPACING . spacing8 } ${ SPACING . spacing16 } ` }
177
- >
178
- < LegacyStyledText
179
- as = "h3"
180
- fontWeight = { TYPOGRAPHY . fontWeightSemiBold }
181
- >
182
- { annotationType }
183
- </ LegacyStyledText >
184
- < Icon name = "chevron-up" size = "2rem" />
185
- </ Flex >
186
- </ Flex >
187
- < Flex
188
- flexDirection = { DIRECTION_COLUMN }
189
- paddingY = { SPACING . spacing16 }
190
- paddingX = { SPACING . spacing32 }
191
- gridGap = { SPACING . spacing4 }
192
- >
193
- { subCommands . map ( ( c , i ) => (
194
- < IndividualCommand
195
- key = { c . command . id }
196
- command = { c . command }
197
- analysis = { analysis }
198
- isHighlighted = { c . isHighlighted }
199
- stepNumber = { `${ stepNumber } .${ ( i + 1 ) . toString ( ) } ` }
200
- allRunDefs = { allRunDefs }
201
- />
202
- ) ) }
203
- </ Flex >
147
+ < Flex alignItems = { ALIGN_CENTER } width = "100%" flexDirection = "column" >
148
+ < Flex
149
+ alignItems = { ALIGN_CENTER }
150
+ borderRadius = { BORDERS . borderRadius4 }
151
+ paddingX = "16px"
152
+ width = "100%"
153
+ justifyContent = "space-between"
154
+ >
155
+ < StyledText desktopStyle = "bodyDefaultRegular" >
156
+ { annotationType }
157
+ </ StyledText >
158
+ < Icon
159
+ name = { isExpanded ? 'chevron-up' : 'chevron-down' }
160
+ size = "2rem"
161
+ color = { COLORS . black90 }
162
+ />
204
163
</ Flex >
205
- ) : (
206
- < Flex alignItems = { ALIGN_CENTER } gridGap = { SPACING . spacing8 } >
207
- < LegacyStyledText as = "label" > { stepNumber } </ LegacyStyledText >
208
- < Flex
209
- alignItems = { ALIGN_CENTER }
210
- backgroundColor = { backgroundColor }
211
- borderRadius = { BORDERS . borderRadius4 }
212
- padding = { SPACING . spacing8 }
213
- >
214
- < LegacyStyledText
215
- as = "h3"
216
- fontWeight = { TYPOGRAPHY . fontWeightSemiBold }
217
- marginLeft = { SPACING . spacing8 }
218
- >
219
- { annotationType }
220
- </ LegacyStyledText >
221
- < Icon name = "chevron-down" size = "2rem" color = { COLORS . black90 } />
222
- </ Flex >
164
+ < Divider />
165
+ < Flex flexDirection = "column" gridGap = { SPACING . spacing4 } >
166
+ { isExpanded
167
+ ? subCommands . map ( ( c , i ) => (
168
+ < IndividualCommand
169
+ key = { c . command . id }
170
+ command = { c . command }
171
+ analysis = { analysis }
172
+ isHighlighted = { c . isHighlighted }
173
+ allRunDefs = { allRunDefs }
174
+ />
175
+ ) )
176
+ : null }
223
177
</ Flex >
224
- ) }
178
+ </ Flex >
225
179
</ Flex >
226
180
)
227
181
}
228
182
229
183
interface IndividualCommandProps {
230
184
command : RunTimeCommand
231
185
analysis : ProtocolAnalysisOutput | CompletedProtocolAnalysis
232
- stepNumber : string
233
186
isHighlighted : boolean
234
187
allRunDefs : LabwareDefinition [ ]
235
188
}
236
189
function IndividualCommand ( {
237
190
command,
238
191
analysis,
239
- stepNumber,
240
192
isHighlighted,
241
193
allRunDefs,
242
194
} : IndividualCommandProps ) : JSX . Element {
243
195
const backgroundColor = isHighlighted ? COLORS . blue30 : COLORS . grey20
244
196
const iconColor = isHighlighted ? COLORS . blue60 : COLORS . grey50
245
197
return (
246
- < Flex alignItems = { ALIGN_CENTER } gridGap = { SPACING . spacing8 } >
247
- < LegacyStyledText
248
- minWidth = { SPACING . spacing16 }
249
- fontSize = { TYPOGRAPHY . fontSizeCaption }
250
- >
251
- { stepNumber }
252
- </ LegacyStyledText >
198
+ < Flex alignItems = { ALIGN_CENTER } gridGap = { SPACING . spacing8 } paddingX = "16px" >
253
199
< Flex
254
200
flexDirection = { DIRECTION_COLUMN }
255
201
gridGap = { SPACING . spacing4 }
0 commit comments