fix(dashboard): improve performance with OnPush change detection (#440)

* fix(dashboard): improve performance with OnPush change detection

* fix(dashboard): refactor book card component for improved readability and performance

* fix(tests): mock matchMedia for improved test compatibility

* fix(tests): matchMedia mock for better CI compatibility and support

* fix(dashboard): add clearAll method to BookBrowserScrollService and update tests

* fix(dashboard): improve performance with content visibility and refactor styles

* fix(dashboard): improve scroll performance with estimated total height and refactor layout

* fix(tests): add mock for getCurrentUser in userService for improved test coverage

* fix(dashboard): implement infinite scroll for book loading and scroll restoration

* fix(tests): fix lint error

* fix(tests): mock ResizeObserver and IntersectionObserver

* fix(tests): mock ResizeObserver and IntersectionObserver (again)

* fix(dashboard): improve accessibility and performance by updating aria attributes and optimizing animations

* fix(dashboard): improve submenu accessibility and optimize virtual scroller performance

* fix(dashboard): clean up imports and improve component structure

* fix(dashboard): correct mobile check in author browser component

* fix(dashboard): add OnDestroy lifecycle hook to BookBrowserComponent
This commit is contained in:
brios
2026-04-22 17:27:11 -04:00
committed by Zach Yale
parent a779de8f57
commit 85e8d235b6
140 changed files with 1546 additions and 1233 deletions
@@ -7,7 +7,7 @@ import {InputText} from 'primeng/inputtext';
import {FormsModule} from '@angular/forms';
import {ProgressSpinner} from 'primeng/progressspinner';
import {MenuItem} from 'primeng/api';
import {CheckboxModule} from 'primeng/checkbox';
import {Checkbox} from 'primeng/checkbox';
import {InputIcon} from 'primeng/inputicon';
import {Button} from 'primeng/button';
import {IconField} from 'primeng/iconfield';
@@ -23,7 +23,7 @@ import {TranslocoDirective, TranslocoPipe} from '@jsverse/transloco';
InputText,
FormsModule,
ProgressSpinner,
CheckboxModule,
Checkbox,
InputIcon,
Button,
InputIcon,
@@ -9,7 +9,7 @@ import {UrlHelperService} from '../../service/url-helper.service';
import {MessageService} from 'primeng/api';
import {IconCategoriesHelper} from '../../helpers/icon-categories.helper';
import {Button} from 'primeng/button';
import {TabsModule} from 'primeng/tabs';
import {Tab, TabList, TabPanel, TabPanels, Tabs} from 'primeng/tabs';
import {UserService} from '../../../features/settings/user-management/user.service';
import {from, of} from 'rxjs';
import {catchError, mergeMap, toArray} from 'rxjs/operators';
@@ -39,7 +39,7 @@ interface SvgIconBatchResponse {
imports: [
FormsModule,
Button,
TabsModule
Tabs, TabList, Tab, TabPanels, TabPanel
],
templateUrl: './icon-picker-component.html',
styleUrl: './icon-picker-component.scss'
@@ -1,9 +1,8 @@
import {Component, inject, OnDestroy, OnInit} from '@angular/core';
import {Subject} from 'rxjs';
import {takeUntil} from 'rxjs/operators';
import {Component, DestroyRef, inject, OnDestroy, OnInit} from '@angular/core';
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
import {KeyValuePipe} from '@angular/common';
import {ProgressBarModule} from 'primeng/progressbar';
import {ButtonModule} from 'primeng/button';
import {ProgressBar} from 'primeng/progressbar';
import {Button} from 'primeng/button';
import {Divider} from 'primeng/divider';
import {Tooltip} from 'primeng/tooltip';
import {MessageService} from 'primeng/api';
@@ -21,12 +20,12 @@ import {DialogLauncherService} from '../../services/dialog-launcher.service';
templateUrl: './metadata-progress-widget-component.html',
styleUrls: ['./metadata-progress-widget-component.scss'],
standalone: true,
imports: [KeyValuePipe, ProgressBarModule, ButtonModule, Divider, Tooltip, Tag, TranslocoDirective]
imports: [KeyValuePipe, ProgressBar, Button, Divider, Tooltip, Tag, TranslocoDirective]
})
export class MetadataProgressWidgetComponent implements OnInit, OnDestroy {
activeTasks: Record<string, MetadataBatchProgressNotification> = {};
private destroy$ = new Subject<void>();
private readonly destroyRef = inject(DestroyRef);
private dialogLauncherService = inject(DialogLauncherService);
private metadataProgressService = inject(MetadataProgressService);
private metadataTaskService = inject(MetadataTaskService);
@@ -40,7 +39,7 @@ export class MetadataProgressWidgetComponent implements OnInit, OnDestroy {
ngOnInit(): void {
this.metadataProgressService.activeTasks$
.pipe(takeUntil(this.destroy$))
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe(tasks => {
this.activeTasks = tasks;
this.checkForStalledTasks(tasks);
@@ -137,8 +136,6 @@ export class MetadataProgressWidgetComponent implements OnInit, OnDestroy {
}
ngOnDestroy(): void {
this.destroy$.next();
this.destroy$.complete();
for (const timeout of this.timeoutHandles.values()) {
clearTimeout(timeout);
}