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:
@@ -1,6 +1,5 @@
|
||||
import { Component, effect, ElementRef, HostListener, inject, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { forkJoin, from, Subject } from 'rxjs';
|
||||
import { debounceTime, map, switchMap, takeUntil, tap } from 'rxjs/operators';
|
||||
import { PageTitleService } from "../../../shared/service/page-title.service";
|
||||
@@ -45,7 +44,6 @@ import {
|
||||
selector: 'app-cbx-reader',
|
||||
standalone: true,
|
||||
imports: [
|
||||
CommonModule,
|
||||
ProgressSpinner,
|
||||
FormsModule,
|
||||
TranslocoPipe,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import {Component, EventEmitter, inject, Input, Output, OnChanges, SimpleChanges} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
import {TranslocoService, TranslocoPipe} from '@jsverse/transloco';
|
||||
import {ReaderIconComponent} from '../../ebook-reader/shared/icon.component';
|
||||
@@ -19,7 +18,7 @@ export interface CbxNoteDialogResult {
|
||||
@Component({
|
||||
selector: 'app-cbx-note-dialog',
|
||||
standalone: true,
|
||||
imports: [CommonModule, FormsModule, TranslocoPipe, ReaderIconComponent],
|
||||
imports: [FormsModule, TranslocoPipe, ReaderIconComponent],
|
||||
templateUrl: './cbx-note-dialog.component.html',
|
||||
styleUrls: ['./cbx-note-dialog.component.scss']
|
||||
})
|
||||
|
||||
+1
-2
@@ -1,5 +1,4 @@
|
||||
import {Component, EventEmitter, inject, Output} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {TranslocoService, TranslocoPipe} from '@jsverse/transloco';
|
||||
import {ReaderIconComponent} from '../../ebook-reader/shared/icon.component';
|
||||
|
||||
@@ -17,7 +16,7 @@ interface ShortcutGroup {
|
||||
@Component({
|
||||
selector: 'app-cbx-shortcuts-help',
|
||||
standalone: true,
|
||||
imports: [CommonModule, TranslocoPipe, ReaderIconComponent],
|
||||
imports: [TranslocoPipe, ReaderIconComponent],
|
||||
templateUrl: './cbx-shortcuts-help.component.html',
|
||||
styleUrls: ['./cbx-shortcuts-help.component.scss']
|
||||
})
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import {Component, inject} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
import {TranslocoService, TranslocoPipe} from '@jsverse/transloco';
|
||||
import {Book} from '../../../../book/model/book.model';
|
||||
@@ -9,7 +8,7 @@ import {CbxFooterService} from './cbx-footer.service';
|
||||
@Component({
|
||||
selector: 'app-cbx-footer',
|
||||
standalone: true,
|
||||
imports: [CommonModule, FormsModule, TranslocoPipe, ReaderIconComponent],
|
||||
imports: [FormsModule, TranslocoPipe, ReaderIconComponent],
|
||||
templateUrl: './cbx-footer.component.html',
|
||||
styleUrls: ['./cbx-footer.component.scss']
|
||||
})
|
||||
|
||||
@@ -2,12 +2,11 @@ import {Component, inject, Input} from '@angular/core';
|
||||
import {TranslocoPipe} from '@jsverse/transloco';
|
||||
import {CbxHeaderService} from './cbx-header.service';
|
||||
import {ReaderIconComponent} from '../../../ebook-reader';
|
||||
import {CommonModule} from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'app-cbx-header',
|
||||
standalone: true,
|
||||
imports: [CommonModule, TranslocoPipe, ReaderIconComponent],
|
||||
imports: [TranslocoPipe, ReaderIconComponent],
|
||||
templateUrl: './cbx-header.component.html',
|
||||
styleUrls: ['./cbx-header.component.scss']
|
||||
})
|
||||
|
||||
+1
-2
@@ -1,5 +1,4 @@
|
||||
import { Component, inject } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TranslocoService, TranslocoPipe } from '@jsverse/transloco';
|
||||
import {
|
||||
CbxFitMode,
|
||||
@@ -18,7 +17,7 @@ import { CbxQuickSettingsService } from './cbx-quick-settings.service';
|
||||
@Component({
|
||||
selector: 'app-cbx-quick-settings',
|
||||
standalone: true,
|
||||
imports: [CommonModule, TranslocoPipe, ReaderIconComponent],
|
||||
imports: [TranslocoPipe, ReaderIconComponent],
|
||||
templateUrl: './cbx-quick-settings.component.html',
|
||||
styleUrls: ['./cbx-quick-settings.component.scss']
|
||||
})
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import {Component, DestroyRef, effect, inject, signal} from '@angular/core';
|
||||
import {CommonModule, DatePipe} from '@angular/common';
|
||||
import {DatePipe} from '@angular/common';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
import {TranslocoPipe} from '@jsverse/transloco';
|
||||
import {CbxSidebarService, CbxSidebarTab} from './cbx-sidebar.service';
|
||||
@@ -12,7 +12,7 @@ import {CoverPlaceholderComponent} from '../../../../../shared/components/cover-
|
||||
standalone: true,
|
||||
templateUrl: './cbx-sidebar.component.html',
|
||||
styleUrls: ['./cbx-sidebar.component.scss'],
|
||||
imports: [CommonModule, FormsModule, TranslocoPipe, ReaderIconComponent, DatePipe, CoverPlaceholderComponent]
|
||||
imports: [FormsModule, TranslocoPipe, ReaderIconComponent, DatePipe, CoverPlaceholderComponent]
|
||||
})
|
||||
export class CbxSidebarComponent {
|
||||
private readonly sidebarService = inject(CbxSidebarService);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import {Component, Input, OnChanges, OnDestroy, SimpleChanges, ViewChild, ElementRef, AfterViewInit} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {CbxPageSplitOption} from '../../../settings/user-management/user.service';
|
||||
|
||||
export type CanvasSplitState = 'NO_SPLIT' | 'LEFT_PART' | 'RIGHT_PART';
|
||||
@@ -14,7 +13,7 @@ export type CanvasSplitState = 'NO_SPLIT' | 'LEFT_PART' | 'RIGHT_PART';
|
||||
@Component({
|
||||
selector: 'app-canvas-renderer',
|
||||
standalone: true,
|
||||
imports: [CommonModule],
|
||||
imports: [],
|
||||
template: `
|
||||
<canvas
|
||||
#canvas
|
||||
|
||||
Reference in New Issue
Block a user