Skip to content

Commit 2557bcb

Browse files
committed
Use indeterminate progress animation when fix-all progress is undefined in ResponsePreview
- the progress bar should have moving animation (refer to `packages/ui/src/components/editor/prompt/modals/ProgressModal/ProgressModal.tsx`) └── packages └── ui └── src └── components └── editor └── prompt ├── ResponsePreview │ ├── ResponsePreview.module.scss │ └── ResponsePreview.tsx └── modals └── ProgressModal ├── ProgressModal.module.scss └── ProgressModal.tsx
1 parent 7930fa6 commit 2557bcb

2 files changed

Lines changed: 34 additions & 4 deletions

File tree

‎packages/ui/src/components/editor/prompt/ResponsePreview/ResponsePreview.module.scss‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,38 @@
159159
width: 100%;
160160
border-radius: 2px;
161161
overflow: hidden;
162+
position: relative;
162163

163164
&__fill {
164165
height: 100%;
165166
background-color: var(--vscode-focusBorder);
167+
transition: width var(--transition-duration-150)
168+
var(--transition-timing-function);
169+
170+
&--indeterminate {
171+
height: 100%;
172+
background-color: var(--vscode-focusBorder);
173+
position: absolute;
174+
animation: fix-all-indeterminate-progress 1.5s infinite linear;
175+
}
166176
}
167177
}
168178
}
169179

180+
@keyframes fix-all-indeterminate-progress {
181+
from {
182+
left: -50px;
183+
width: 10px;
184+
}
185+
50% {
186+
width: 50px;
187+
}
188+
to {
189+
left: 100%;
190+
width: 10px;
191+
}
192+
}
193+
170194
.list {
171195
display: flex;
172196
flex-direction: column;

‎packages/ui/src/components/editor/prompt/ResponsePreview/ResponsePreview.tsx‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,16 @@ export const ResponsePreview: FC<Props> = (props) => {
258258
</span>
259259
</div>
260260
<div className={styles['fix-all-progress__bar']}>
261-
<div
262-
className={styles['fix-all-progress__bar__fill']}
263-
style={{ width: `${file.apply_progress || 0}%` }}
264-
/>
261+
{file.apply_progress !== undefined ? (
262+
<div
263+
className={styles['fix-all-progress__bar__fill']}
264+
style={{ width: `${file.apply_progress}%` }}
265+
/>
266+
) : (
267+
<div
268+
className={styles['fix-all-progress__bar__fill--indeterminate']}
269+
/>
270+
)}
265271
</div>
266272
</div>
267273
))}

0 commit comments

Comments
 (0)