@@ -62,14 +62,13 @@ const estimateFinish = (
62
62
interface WorkspaceBuildProgressProps {
63
63
workspace : Workspace ;
64
64
transitionStats : TransitionStats ;
65
- // stack indicates to stack the text vertically, otherwise put it on one line.
66
- stack ?: boolean ;
65
+ style ?: "workspace" | "task" ;
67
66
}
68
67
69
68
export const WorkspaceBuildProgress : FC < WorkspaceBuildProgressProps > = ( {
70
69
workspace,
71
70
transitionStats,
72
- stack ,
71
+ style ,
73
72
} ) => {
74
73
const job = workspace . latest_build . job ;
75
74
const [ progressValue , setProgressValue ] = useState < number | undefined > ( 0 ) ;
@@ -117,6 +116,13 @@ export const WorkspaceBuildProgress: FC<WorkspaceBuildProgressProps> = ({
117
116
}
118
117
return (
119
118
< div css = { styles . stack } >
119
+ { style === "task" && (
120
+ < div className = { "mb-1 text-center" } >
121
+ < div css = { styles . label } data-chromatic = "ignore" >
122
+ { progressText }
123
+ </ div >
124
+ </ div >
125
+ ) }
120
126
< LinearProgress
121
127
data-chromatic = "ignore"
122
128
value = { progressValue !== undefined ? progressValue : 0 }
@@ -132,23 +138,31 @@ export const WorkspaceBuildProgress: FC<WorkspaceBuildProgressProps> = ({
132
138
// If a transition is set, there is a moment on new load where the
133
139
// bar accelerates to progressValue and then rapidly decelerates, which
134
140
// is not indicative of true progress.
135
- classes = { { bar : classNames . bar } }
141
+ classes = { {
142
+ bar : classNames . bar ,
143
+ root : style === "task" ? classNames . root : undefined ,
144
+ } }
136
145
/>
137
- < div className = { stack ? "leading-tight mt-1" : "flex mt-1 justify-between" } >
138
- < div css = { styles . label } >
139
- { capitalize ( workspace . latest_build . status ) } workspace...
140
- </ div >
141
- < div css = { styles . label } data-chromatic = "ignore" >
142
- { progressText }
146
+ { style !== "task" && (
147
+ < div className = { "flex mt-1 justify-between" } >
148
+ < div css = { styles . label } >
149
+ { capitalize ( workspace . latest_build . status ) } workspace...
150
+ </ div >
151
+ < div css = { styles . label } data-chromatic = "ignore" >
152
+ { progressText }
153
+ </ div >
143
154
</ div >
144
- </ div >
155
+ ) }
145
156
</ div >
146
157
) ;
147
158
} ;
148
159
149
160
const classNames = {
150
161
bar : css `
151
162
transition : none;
163
+ ` ,
164
+ root : css `
165
+ border-radius : 0 ;
152
166
` ,
153
167
} ;
154
168
0 commit comments