Skip to content

Commit c005578

Browse files
committed
feat,ux,draft: papers + loading indicators per product type
1 parent af1de79 commit c005578

10 files changed

Lines changed: 1002 additions & 38 deletions

angular/src/app/home/home.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,9 @@ export class HomeComponent implements OnInit, OnDestroy, AfterViewInit {
757757
const filter = current.filter ?? feed.filter ?? "@type=Dataset";
758758

759759
const sub = this.searchService
760-
.searchPhrase(query, "", undefined, 1, pageSize, sortOrder, filter)
760+
.searchPhrase(query, "", undefined, 1, pageSize, sortOrder, filter, {
761+
forceData: true,
762+
})
761763
.subscribe({
762764
next: (response) => {
763765
const items = response?.ResultData || [];

angular/src/app/search-panel/search-panel.component.html

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,22 @@ <h3 *ngIf="title" class="heading title has-text-black">{{ title }}</h3>
157157
>
158158
<i class="pi pi-info-circle"></i>
159159
</span>
160+
161+
<div
162+
class="search-progress"
163+
[class.search-progress--visible]="globalProgressVisible"
164+
[class.search-progress--error]="hasProgressFailures()"
165+
role="progressbar"
166+
aria-label="Search progress"
167+
aria-valuemin="0"
168+
aria-valuemax="100"
169+
[attr.aria-valuenow]="globalProgress"
170+
>
171+
<div
172+
class="search-progress__fill"
173+
[style.width.%]="globalProgress"
174+
></div>
175+
</div>
160176
</div>
161177

162178
<div
@@ -177,11 +193,33 @@ <h3 *ngIf="title" class="heading title has-text-black">{{ title }}</h3>
177193
class="product-type-chip"
178194
*ngFor="let product of visibleProductTypes"
179195
[class.product-type-chip--active]="isProductTypeActive(product.key)"
196+
[class.product-type-chip--error]="
197+
shouldShowProductProgress(product.key) &&
198+
getProductProgressStatus(product.key) === 'error'
199+
"
180200
(click)="onProductTypeToggle(product)"
181201
[attr.aria-pressed]="isProductTypeActive(product.key)"
182202
>
183-
<i [ngClass]="product.icon" aria-hidden="true"></i>
184-
<span class="product-type-chip__label">{{ product.label }}</span>
203+
<span class="product-type-chip__main">
204+
<i [ngClass]="product.icon" aria-hidden="true"></i>
205+
<span class="product-type-chip__label">{{ product.label }}</span>
206+
</span>
207+
<span
208+
class="product-type-chip__progress"
209+
[class.product-type-chip__progress--visible]="
210+
shouldShowProductProgress(product.key)
211+
"
212+
>
213+
<span class="product-type-chip__progress-track">
214+
<span
215+
class="product-type-chip__progress-fill"
216+
[class.product-type-chip__progress-fill--error]="
217+
getProductProgressStatus(product.key) === 'error'
218+
"
219+
[style.width.%]="getProductProgress(product.key)"
220+
></span>
221+
</span>
222+
</span>
185223
</button>
186224
</div>
187225
</div>
@@ -277,7 +315,7 @@ <h3 *ngIf="title" class="heading title has-text-black">{{ title }}</h3>
277315
>
278316
<div class="external-info">
279317
<p class="external-info__lead">
280-
Include open-source projects and patents alongside NIST resources. Filters and counts will blend them into your results.
318+
Include open-source projects, patents, and scholarly papers alongside NIST resources. Filters and counts will blend them into your results.
281319
</p>
282320
<div class="external-info__pills">
283321
<span class="external-pill">
@@ -290,7 +328,7 @@ <h3 *ngIf="title" class="heading title has-text-black">{{ title }}</h3>
290328
</span>
291329
<span class="external-pill">
292330
<i class="pi pi-file"></i>
293-
Scholarly papers (soon)
331+
Scholarly papers
294332
</span>
295333
<span class="external-pill">
296334
<i class="pi pi-filter"></i>

angular/src/app/search-panel/search-panel.component.scss

Lines changed: 96 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ body .p-highlight {
246246
.search-input-group {
247247
width: min(1320px, 96vw);
248248
margin: 2rem auto 0;
249-
padding: 0.25rem 0.4rem;
249+
padding: 0.35rem 0.4rem;
250250
border-radius: 16px;
251251
border: 1px solid rgba(255, 255, 255, 0.22);
252252
background: rgba(0, 0, 0, 0.25);
@@ -257,6 +257,11 @@ body .p-highlight {
257257
z-index: 2;
258258
}
259259

260+
.search-input-group > :not(.search-progress) {
261+
position: relative;
262+
z-index: 1;
263+
}
264+
260265
.search-input-group--external-on {
261266
border-color: rgba(74, 163, 255, 0.85);
262267
box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28),
@@ -295,12 +300,23 @@ body .p-highlight {
295300
background: rgba(255, 255, 255, 0.06);
296301
color: #ffffff;
297302
border-radius: 999px;
298-
padding: 0.35rem 0.9rem;
303+
padding: 0.4rem 0.95rem;
299304
font-weight: 700;
300305
font-size: 0.9rem;
301306
letter-spacing: 0.01em;
302307
backdrop-filter: blur(4px);
303308
transition: all 0.18s ease;
309+
position: relative;
310+
overflow: hidden;
311+
}
312+
313+
.product-type-chip__main {
314+
display: inline-flex;
315+
align-items: center;
316+
justify-content: center;
317+
gap: 0.45rem;
318+
position: relative;
319+
z-index: 1;
304320
}
305321

306322
.product-type-chip i {
@@ -335,10 +351,88 @@ body .p-highlight {
335351
opacity: 1;
336352
}
337353

354+
.product-type-chip--error {
355+
border-color: rgba(248, 113, 113, 0.95);
356+
box-shadow: 0 12px 28px rgba(248, 113, 113, 0.28);
357+
}
358+
338359
.product-type-chip__label {
339360
white-space: nowrap;
340361
}
341362

363+
.product-type-chip__progress {
364+
position: absolute;
365+
inset: 2px;
366+
border-radius: 999px;
367+
overflow: hidden;
368+
opacity: 0;
369+
transition: opacity 420ms ease;
370+
pointer-events: none;
371+
z-index: 0;
372+
}
373+
374+
.product-type-chip__progress--visible {
375+
opacity: 0.22;
376+
}
377+
378+
.product-type-chip__progress-track {
379+
width: 100%;
380+
height: 100%;
381+
border-radius: 999px;
382+
background: rgba(255, 255, 255, 0.08);
383+
overflow: hidden;
384+
display: block;
385+
}
386+
387+
.product-type-chip--active .product-type-chip__progress-track {
388+
background: rgba(15, 23, 42, 0.08);
389+
}
390+
391+
.product-type-chip__progress-fill {
392+
display: block;
393+
height: 100%;
394+
width: 0;
395+
border-radius: 999px;
396+
background: linear-gradient(90deg, #38bdf8, #60a5fa);
397+
box-shadow: 0 0 12px rgba(96, 165, 250, 0.45);
398+
transition: width 320ms ease;
399+
}
400+
401+
.product-type-chip__progress-fill--error {
402+
background: linear-gradient(90deg, #f97316, #ef4444);
403+
box-shadow: 0 0 10px rgba(239, 68, 68, 0.55);
404+
}
405+
406+
.search-progress {
407+
position: absolute;
408+
inset: 4px;
409+
border-radius: 14px;
410+
background: rgba(255, 255, 255, 0.06);
411+
overflow: hidden;
412+
pointer-events: none;
413+
opacity: 0;
414+
transition: opacity 480ms ease;
415+
z-index: 0;
416+
}
417+
418+
.search-progress--visible {
419+
opacity: 0.22;
420+
}
421+
422+
.search-progress__fill {
423+
height: 100%;
424+
width: 0;
425+
border-radius: 999px;
426+
background: linear-gradient(90deg, #22d3ee, #3b82f6);
427+
box-shadow: 0 0 18px rgba(59, 130, 246, 0.4);
428+
transition: width 360ms ease;
429+
}
430+
431+
.search-progress--error .search-progress__fill {
432+
background: linear-gradient(90deg, #fb7185, #ef4444);
433+
box-shadow: 0 0 16px rgba(239, 68, 68, 0.45);
434+
}
435+
342436
/* Toast styling */
343437
:host ::ng-deep .product-toast.p-toast {
344438
width: auto;

0 commit comments

Comments
 (0)