Skip to content

Commit bfadb7d

Browse files
authored
fix(app): fix deck view container styling in visualization page (#20179)
* fix(app): fix deck view container styling in visualization page
1 parent 2bc10ef commit bfadb7d

File tree

6 files changed

+93
-25
lines changed

6 files changed

+93
-25
lines changed

app/src/assets/localization/en/protocol_visualization.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"active": "Active",
3-
"deck_view": "Deck view",
3+
"deck_view": "Deck View",
44
"destination_labware": "Destination labware",
55
"destination_tips": "Destination tips",
66
"destination_well_view": "Destination well view",
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.container {
22
display: flex;
33
width: 100%;
4-
min-width: 200px;
5-
max-width: 400px;
4+
min-width: 10.75rem;
5+
max-width: 37.5rem;
66
flex-direction: column;
77
gap: var(--spacing-8);
88
}

app/src/pages/Desktop/Protocols/ProtocolVisualization/DeckView.tsx

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import {
55
COLORS,
66
DeckFromLayers,
77
FixedTrashText,
8-
Flex,
98
FlexTrash,
9+
NO_WRAP,
1010
RobotCoordinateSpaceWithRef,
1111
SingleSlotFixture,
1212
SlotLabels,
@@ -24,13 +24,13 @@ import {
2424
} from '@opentrons/shared-data'
2525
import { getSlotInLocationStack } from '@opentrons/step-generation'
2626

27+
import styles from './deckview.module.css'
2728
import { DeckViewDetails } from './DeckViewDetails'
2829
import {
2930
getActiveLayer,
3031
getIsCutoutA1Active,
3132
getIsPipetteOverTrash,
3233
} from './utils'
33-
import styles from './visualization.module.css'
3434

3535
import type { Dispatch, SetStateAction } from 'react'
3636
import type { StagingAreaLocation, TrashCutoutId } from '@opentrons/components'
@@ -132,16 +132,20 @@ export function DeckView(props: DeckViewProps): JSX.Element {
132132
: 0
133133

134134
return (
135-
<div className={styles.deck_view_padding}>
136-
<div className={styles.deck_view_container}>
137-
<Flex justifyContent="space-between" with="100%">
138-
<StyledText desktopStyle="bodyLargeSemiBold">
139-
{t('deck_view')}
140-
</StyledText>
141-
<StyledText color={COLORS.grey60} desktopStyle="bodyDefaultRegular">
142-
{t('step', { number: selectedCommandIndex })}
143-
</StyledText>
144-
</Flex>
135+
<div className={styles.deck_view_container}>
136+
<div className={styles.header_container}>
137+
<StyledText desktopStyle="bodyLargeSemiBold">
138+
{t('deck_view')}
139+
</StyledText>
140+
<StyledText
141+
color={COLORS.grey60}
142+
desktopStyle="bodyDefaultRegular"
143+
whiteSpace={NO_WRAP}
144+
>
145+
{t('step', { number: selectedCommandIndex })}
146+
</StyledText>
147+
</div>
148+
<div className={styles.body_container}>
145149
<RobotCoordinateSpaceWithRef
146150
height="100%"
147151
width="100%"

app/src/pages/Desktop/Protocols/ProtocolVisualization/VisualizerContainer.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ export function VisualizerContainer(
270270
milliSecondsPerFrame={milliSecondsPerFrame}
271271
setMilliSecondsPerFrame={setMilliSecondsPerFrame}
272272
/>
273-
274273
<DeckView
275274
commands={analysis.commands}
276275
liquids={liquids}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
.deck_view_container {
2+
display: flex;
3+
width: 100%;
4+
height: 100%;
5+
flex-direction: column;
6+
border-radius: var(--border-radius-8);
7+
background-color: var(--white);
8+
container-name: deckview-container;
9+
container-type: inline-size;
10+
gap: var(--spacing-16);
11+
overflow-y: hidden;
12+
}
13+
14+
.header_container {
15+
position: sticky;
16+
top: 0;
17+
left: 0;
18+
display: flex;
19+
width: 100%;
20+
flex-shrink: 0;
21+
align-items: center;
22+
justify-content: space-between;
23+
padding: var(--spacing-12);
24+
gap: var(--spacing-16);
25+
overflow-x: hidden;
26+
}
27+
28+
@container deckview-container (min-width:284px) {
29+
.header_container {
30+
flex-direction: column;
31+
align-items: flex-start;
32+
gap: var(--spacing-4);
33+
justify-self: unset;
34+
}
35+
}
36+
37+
@container deckview-container (min-width:680px) {
38+
.header_container {
39+
flex-direction: row;
40+
align-items: center;
41+
justify-content: space-between;
42+
gap: var(--spacing-16);
43+
}
44+
}
45+
46+
.body_container {
47+
position: relative;
48+
display: flex;
49+
width: 100%;
50+
min-width: 23.75rem; /* 380px */
51+
min-height: 13rem; /* 208px */
52+
max-height: 31.875rem; /* 510px */
53+
flex-direction: column;
54+
flex-grow: 1;
55+
flex-shrink: 0;
56+
align-items: center;
57+
justify-content: center;
58+
padding: var(--spacing-16);
59+
overflow-x: auto;
60+
overflow-y: auto;
61+
}
62+
63+
@container deckview-container (min-width: 680px) {
64+
.body_container {
65+
width: 100%;
66+
max-width: 100%;
67+
height: 100%;
68+
max-height: 100%;
69+
flex-shrink: 1;
70+
align-items: center;
71+
justify-content: center;
72+
padding: var(--spacing-24);
73+
}
74+
}

app/src/pages/Desktop/Protocols/ProtocolVisualization/visualization.module.css

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,6 @@
122122
pointer-events: auto;
123123
}
124124

125-
.deck_view_container {
126-
width: 100%;
127-
height: 100%;
128-
padding: 28px 32px;
129-
border-radius: var(--border-radius-8);
130-
background-color: var(--white);
131-
gap: var(--spacing-20);
132-
}
133-
134125
.detail_container {
135126
display: flex;
136127
height: 100%;

0 commit comments

Comments
 (0)