Skip to content

Commit 1057278

Browse files
committed
Fixes spinners & centers loading message
1 parent c007b15 commit 1057278

File tree

3 files changed

+57
-22
lines changed

3 files changed

+57
-22
lines changed

src/webviews/apps/plus/graph/GraphWrapper.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,11 +322,11 @@ export function GraphWrapper({
322322
</div>
323323
</div>
324324
{graphList.length > 0 && (
325-
<span>
326-
{graphList.length} commit{graphList.length ? 's' : ''}
325+
<span className="actionbar__details">
326+
{graphList.length} item{graphList.length ? 's' : ''}
327327
</span>
328328
)}
329-
{isLoading && <span className="icon--loading" />}
329+
{isLoading && <span className="actionbar__loading icon--loading icon-modifier--spin" />}
330330
</div>
331331
<div className="actionbar__group">
332332
<a

src/webviews/apps/plus/graph/graph.scss

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@ a {
4747
}
4848
}
4949

50+
&__details {}
51+
52+
&__loading {
53+
position: relative;
54+
top: 1px;
55+
left: 0.5rem;
56+
font-size: 1.2rem;
57+
}
58+
5059
a {
5160
color: inherit;
5261
}
@@ -232,22 +241,6 @@ a {
232241
}
233242
}
234243

235-
.icon--loading {
236-
&::before {
237-
// codicon-loading
238-
font-family: codicon;
239-
content: '\eb19';
240-
}
241-
transform-origin: 50% 42%;
242-
animation: spin .7s steps(30) infinite;
243-
244-
@keyframes spin {
245-
100% {
246-
transform: rotate(360deg);
247-
}
248-
}
249-
}
250-
251244
.icon--warning {
252245
:before {
253246
// codicon-vm
@@ -382,8 +375,15 @@ a {
382375
& .resizable-handle.horizontal {
383376
display: none;
384377
}
385-
}
386378

387-
.graph-container .node.stash-node .graph-icon {
388-
transform: translateY(-2px);
379+
& .node.stash-node .graph-icon {
380+
transform: translateY(-2px);
381+
}
382+
383+
& .graph-adjust-commit-count {
384+
display: flex;
385+
width: 100vw;
386+
align-items: center;
387+
justify-content: center;
388+
}
389389
}

src/webviews/apps/shared/codicons.scss

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,38 @@
1+
@keyframes codicon-spin {
2+
100% {
3+
transform: rotate(360deg);
4+
}
5+
}
6+
7+
.icon--sync.icon-modifier--spin,
8+
.icon--loading.icon-modifier--spin,
9+
.icon--gear.icon-modifier--spin {
10+
/* Use steps to throttle FPS to reduce CPU usage */
11+
animation: codicon-spin 1.5s steps(30) infinite;
12+
}
13+
14+
.icon-modifier--disabled {
15+
opacity: 0.5;
16+
}
17+
18+
.icon-modifier--hidden {
19+
opacity: 0;
20+
}
21+
22+
.icon--loading {
23+
/* Use steps to throttle FPS to reduce CPU usage */
24+
animation: codicon-spin 1.5s steps(30) infinite;
25+
26+
/* custom speed & easing for loading icon */
27+
animation-duration: 1s !important;
28+
animation-timing-function: cubic-bezier(0.53, 0.21, 0.29, 0.67) !important;
29+
30+
&::before {
31+
content: '\eb19';
32+
font-family: codicon;
33+
}
34+
}
35+
136
.icon--branch {
237
&::before {
338
content: '\ea68';

0 commit comments

Comments
 (0)