Skip to content

Commit 4cc0302

Browse files
authored
fix(requests): match loading placeholder to compact table view (#5428)
1 parent 6b34eb7 commit 4cc0302

6 files changed

Lines changed: 69 additions & 5 deletions

File tree

src/Ombi/ClientApp/src/app/requests-list/components/albums-grid/albums-grid.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
</div>
7979

8080
<!-- Loading State -->
81-
<grid-spinner [loading]="isLoadingResults"></grid-spinner>
81+
<grid-spinner [loading]="isLoadingResults" [viewMode]="viewMode" [columns]="7"></grid-spinner>
8282

8383
<!-- Card Grid -->
8484
<div class="card-grid" *ngIf="viewMode === 'cards' && dataSource.length > 0">
Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="loading-container" *ngIf="loading" aria-hidden="true">
2-
<div class="skeleton-grid">
3-
<div class="skeleton-card" *ngFor="let i of [1,2,3,4,5,6]">
2+
<div class="skeleton-grid" *ngIf="viewMode === 'cards'">
3+
<div class="skeleton-card" *ngFor="let i of cardItems">
44
<div class="skeleton-poster shimmer"></div>
55
<div class="skeleton-body">
66
<div class="skeleton-line wide shimmer"></div>
@@ -9,5 +9,23 @@
99
</div>
1010
</div>
1111
</div>
12+
<div class="skeleton-table-wrapper" *ngIf="viewMode === 'compact'">
13+
<table class="skeleton-table">
14+
<thead>
15+
<tr>
16+
<th *ngFor="let c of columnItems">
17+
<div class="skeleton-line head shimmer"></div>
18+
</th>
19+
</tr>
20+
</thead>
21+
<tbody>
22+
<tr *ngFor="let r of rowItems">
23+
<td *ngFor="let c of columnItems; let first = first">
24+
<div class="skeleton-line shimmer" [ngClass]="first ? 'title' : 'cell'"></div>
25+
</td>
26+
</tr>
27+
</tbody>
28+
</table>
29+
</div>
1230
</div>
1331
<div *ngIf="loading" role="status" aria-live="polite" class="sr-only">{{ 'Requests.Loading' | translate }}</div>

src/Ombi/ClientApp/src/app/requests-list/components/grid-spinner/grid-spinner.component.scss

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,43 @@
5050
&.narrow { width: 40%; }
5151
}
5252

53+
// Compact (table) skeleton - mirrors .compact-table styling
54+
.skeleton-table-wrapper {
55+
background: #111;
56+
border: 1px solid #1a1a1a;
57+
border-radius: 12px;
58+
overflow: hidden;
59+
}
60+
61+
.skeleton-table {
62+
width: 100%;
63+
border-collapse: collapse;
64+
65+
th,
66+
td {
67+
padding: 10px 14px;
68+
text-align: left;
69+
}
70+
71+
thead th {
72+
border-bottom: 1px solid #222;
73+
}
74+
75+
tbody tr {
76+
border-bottom: 1px solid #1a1a1a;
77+
78+
&:last-child { border-bottom: none; }
79+
}
80+
81+
.skeleton-line {
82+
height: 10px;
83+
84+
&.head { width: 55%; }
85+
&.title { width: 80%; height: 12px; }
86+
&.cell { width: 65%; }
87+
}
88+
}
89+
5390
.shimmer {
5491
position: relative;
5592
overflow: hidden;

src/Ombi/ClientApp/src/app/requests-list/components/grid-spinner/grid-spinner.component.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,13 @@ import { TranslateModule } from "@ngx-translate/core";
1515
})
1616
export class GridSpinnerComponent{
1717
@Input() public loading = false;
18+
@Input() public viewMode: "cards" | "compact" = "cards";
19+
@Input() public columns = 6;
20+
21+
public readonly cardItems = [1, 2, 3, 4, 5, 6];
22+
public readonly rowItems = [1, 2, 3, 4, 5, 6, 7, 8];
23+
24+
public get columnItems(): number[] {
25+
return Array.from({ length: Math.max(1, this.columns) }, (_, i) => i);
26+
}
1827
}

src/Ombi/ClientApp/src/app/requests-list/components/movies-grid/movies-grid.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
</div>
8888

8989
<!-- Loading State -->
90-
<grid-spinner [loading]="isLoadingResults"></grid-spinner>
90+
<grid-spinner [loading]="isLoadingResults" [viewMode]="viewMode" [columns]="isAdmin ? 7 : 6"></grid-spinner>
9191

9292
<!-- Card Grid -->
9393
<div class="card-grid" *ngIf="viewMode === 'cards' && dataSource && dataSource.data.length > 0">

src/Ombi/ClientApp/src/app/requests-list/components/tv-grid/tv-grid.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
</div>
7979

8080
<!-- Loading State -->
81-
<grid-spinner [loading]="isLoadingResults"></grid-spinner>
81+
<grid-spinner [loading]="isLoadingResults" [viewMode]="viewMode" [columns]="5"></grid-spinner>
8282

8383
<!-- Card Grid -->
8484
<div class="card-grid" *ngIf="viewMode === 'cards' && dataSource.length > 0">

0 commit comments

Comments
 (0)