Skip to content

Commit adcd6f5

Browse files
refactor: Make the workspace panels more light (#2984)
1 parent c8d04af commit adcd6f5

File tree

4 files changed

+17
-25
lines changed

4 files changed

+17
-25
lines changed

site/src/components/Resources/Resources.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { TableHeaderRow } from "../TableHeaders/TableHeaders"
1515
import { TerminalLink } from "../TerminalLink/TerminalLink"
1616
import { AgentHelpTooltip } from "../Tooltips/AgentHelpTooltip"
1717
import { ResourcesHelpTooltip } from "../Tooltips/ResourcesHelpTooltip"
18-
import { WorkspaceSection } from "../WorkspaceSection/WorkspaceSection"
1918

2019
const Language = {
2120
resources: "Resources",
@@ -41,10 +40,7 @@ export const Resources: FC<ResourcesProps> = ({
4140
const theme: Theme = useTheme()
4241

4342
return (
44-
<WorkspaceSection
45-
title={Language.resources}
46-
contentsProps={{ className: styles.sectionContents }}
47-
>
43+
<div aria-label={Language.resources} className={styles.wrapper}>
4844
{getResourcesError ? (
4945
{ getResourcesError }
5046
) : (
@@ -137,13 +133,14 @@ export const Resources: FC<ResourcesProps> = ({
137133
</TableBody>
138134
</Table>
139135
)}
140-
</WorkspaceSection>
136+
</div>
141137
)
142138
}
143139

144140
const useStyles = makeStyles((theme) => ({
145-
sectionContents: {
146-
margin: 0,
141+
wrapper: {
142+
borderRadius: theme.shape.borderRadius,
143+
border: `1px solid ${theme.palette.divider}`,
147144
},
148145

149146
table: {

site/src/components/Workspace/Workspace.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export const Workspace: FC<WorkspaceProps> = ({
105105
/>
106106
)}
107107

108-
<WorkspaceSection title="Timeline" contentsProps={{ className: styles.timelineContents }}>
108+
<WorkspaceSection title="Logs" contentsProps={{ className: styles.timelineContents }}>
109109
<BuildsTable builds={builds} className={styles.timelineTable} />
110110
</WorkspaceSection>
111111
</Stack>

site/src/components/WorkspaceSection/WorkspaceSection.tsx

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@ export const WorkspaceSection: React.FC<WorkspaceSectionProps> = ({
2525
return (
2626
<Paper className={styles.root} elevation={0}>
2727
{title && (
28-
<div className={styles.headerContainer}>
29-
<div className={styles.header}>
30-
<Typography variant="h6">{title}</Typography>
31-
{action && <div>{action}</div>}
32-
</div>
28+
<div className={styles.header}>
29+
<Typography variant="h6">{title}</Typography>
30+
{action && <div>{action}</div>}
3331
</div>
3432
)}
3533

@@ -48,19 +46,16 @@ const useStyles = makeStyles((theme) => ({
4846
border: `1px solid ${theme.palette.divider}`,
4947
borderRadius: CardRadius,
5048
},
51-
headerContainer: {
52-
borderBottom: `1px solid ${theme.palette.divider}`,
53-
},
5449
contents: {
5550
margin: theme.spacing(2),
5651
},
5752
header: {
5853
alignItems: "center",
5954
display: "flex",
6055
justifyContent: "space-between",
61-
marginBottom: theme.spacing(1),
62-
marginTop: theme.spacing(1),
63-
paddingLeft: CardPadding + theme.spacing(1),
56+
paddingBottom: theme.spacing(1.5),
57+
paddingTop: theme.spacing(2),
58+
paddingLeft: CardPadding + theme.spacing(1.5),
6459
paddingRight: CardPadding / 2,
6560
},
6661
}))

site/src/components/WorkspaceStats/WorkspaceStats.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ import dayjs from "dayjs"
44
import { FC } from "react"
55
import { Link as RouterLink } from "react-router-dom"
66
import { Workspace } from "../../api/typesGenerated"
7-
import { CardRadius, MONOSPACE_FONT_FAMILY } from "../../theme/constants"
7+
import { MONOSPACE_FONT_FAMILY } from "../../theme/constants"
88
import { combineClasses } from "../../util/combineClasses"
99
import { getDisplayStatus, getDisplayWorkspaceBuildInitiatedBy } from "../../util/workspace"
10-
import { WorkspaceSection } from "../WorkspaceSection/WorkspaceSection"
1110

1211
const Language = {
1312
workspaceDetails: "Workspace Details",
@@ -31,7 +30,7 @@ export const WorkspaceStats: FC<WorkspaceStatsProps> = ({ workspace }) => {
3130
const initiatedBy = getDisplayWorkspaceBuildInitiatedBy(workspace.latest_build)
3231

3332
return (
34-
<WorkspaceSection title={Language.workspaceDetails} contentsProps={{ className: styles.stats }}>
33+
<div className={styles.stats} aria-label={Language.workspaceDetails}>
3534
<div className={styles.statItem}>
3635
<span className={styles.statsLabel}>{Language.templateLabel}</span>
3736
<Link
@@ -74,7 +73,7 @@ export const WorkspaceStats: FC<WorkspaceStatsProps> = ({ workspace }) => {
7473
</span>
7574
</span>
7675
</div>
77-
</WorkspaceSection>
76+
</div>
7877
)
7978
}
8079

@@ -83,7 +82,8 @@ const useStyles = makeStyles((theme) => ({
8382
paddingLeft: theme.spacing(2),
8483
paddingRight: theme.spacing(2),
8584
backgroundColor: theme.palette.background.paper,
86-
borderRadius: CardRadius,
85+
borderRadius: theme.shape.borderRadius,
86+
border: `1px solid ${theme.palette.divider}`,
8787
display: "flex",
8888
alignItems: "center",
8989
color: theme.palette.text.secondary,

0 commit comments

Comments
 (0)