Skip to content

Commit a2dd126

Browse files
committed
Only scroll the chart
1 parent 714e37b commit a2dd126

File tree

1 file changed

+33
-27
lines changed

1 file changed

+33
-27
lines changed

site/src/modules/workspaces/WorkspaceTiming/WorkspaceTimings.tsx

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -106,33 +106,35 @@ export const WorkspaceTimings: FC<WorkspaceTimingsProps> = ({
106106
</div>
107107
)}
108108

109-
{data.flatMap((section) => section.timings).length > 0 ? (
110-
<Chart
111-
data={data}
112-
onBarClick={(stage, section) => {
113-
setView({
114-
name: "advanced",
115-
selectedStage: stage,
116-
parentSection: section,
117-
filter: "",
118-
});
119-
}}
120-
/>
121-
) : (
122-
<div
123-
css={{
124-
width: "100%",
125-
height: "100%",
126-
display: "flex",
127-
justifyContent: "center",
128-
alignItems: "center",
129-
}}
130-
>
131-
{view.name === "basic"
132-
? "No data found"
133-
: `No resource found for "${view.filter}"`}
134-
</div>
135-
)}
109+
<div css={styles.chartWrapper}>
110+
{data.flatMap((section) => section.timings).length > 0 ? (
111+
<Chart
112+
data={data}
113+
onBarClick={(stage, section) => {
114+
setView({
115+
name: "advanced",
116+
selectedStage: stage,
117+
parentSection: section,
118+
filter: "",
119+
});
120+
}}
121+
/>
122+
) : (
123+
<div
124+
css={{
125+
width: "100%",
126+
height: "100%",
127+
display: "flex",
128+
justifyContent: "center",
129+
alignItems: "center",
130+
}}
131+
>
132+
{view.name === "basic"
133+
? "No data found"
134+
: `No resource found for "${view.filter}"`}
135+
</div>
136+
)}
137+
</div>
136138
</div>
137139
);
138140
};
@@ -212,6 +214,10 @@ const styles = {
212214
flexDirection: "column",
213215
height: "100%",
214216
},
217+
chartWrapper: {
218+
flex: 1,
219+
overflow: "auto",
220+
},
215221
toolbar: (theme) => ({
216222
borderBottom: `1px solid ${theme.palette.divider}`,
217223
fontSize: 12,

0 commit comments

Comments
 (0)