refactor(ui): move large library processing screen to notifications (#1428)

Co-authored-by: Alex <25013571+alexhb1@users.noreply.github.com>
This commit is contained in:
brios
2026-05-22 15:57:07 +01:00
committed by GitHub
co-authored by Alex
parent 0e76b381aa
commit dbbc7c3878
20 changed files with 334 additions and 427 deletions
@@ -37,6 +37,7 @@ import { VersionService } from '../../service/version.service';
import { MetadataProgressService } from '../../service/metadata-progress.service';
import { BookdropFileService } from '../../../features/bookdrop/service/bookdrop-file.service';
import { MetadataBatchProgressNotification, MetadataBatchStatus } from '../../model/metadata-batch-progress.model';
import { LibraryImportProgressService } from '../../service/library-import-progress.service';
const DOCUMENTATION_URL = 'https://grimmory.org/docs/getting-started';
const ABOVE_ALIGN_LEFT: ConnectedPosition[] = [
@@ -139,6 +140,7 @@ export class AppSidebarComponent {
private readonly destroyRef = inject(DestroyRef);
private readonly metadataProgressService = inject(MetadataProgressService);
private readonly bookdropFileService = inject(BookdropFileService);
private readonly libraryImportProgressService = inject(LibraryImportProgressService);
readonly currentUser = this.userService.currentUser;
private readonly allAuthors = this.authorService.allAuthors;
@@ -231,6 +233,7 @@ export class AppSidebarComponent {
protected progressHighlight = false;
protected completedTaskCount = 0;
protected hasPendingBookdropFiles = false;
protected hasActiveLibraryImport = false;
private readonly latestTasks: Record<string, MetadataBatchProgressNotification> = {};
@@ -250,6 +253,13 @@ export class AppSidebarComponent {
this.hasPendingBookdropFiles = hasPending;
this.updateCompletedTaskCount();
});
this.libraryImportProgressService.hasActiveImport$
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe((hasActive) => {
this.hasActiveLibraryImport = hasActive;
this.updateCompletedTaskCount();
});
}
openSearch(): void {
@@ -383,6 +393,7 @@ export class AppSidebarComponent {
private updateCompletedTaskCount(): void {
const metadataTaskCount = Object.keys(this.latestTasks).length;
const bookdropFileTaskCount = this.hasPendingBookdropFiles ? 1 : 0;
this.completedTaskCount = metadataTaskCount + bookdropFileTaskCount;
const libraryImportTaskCount = this.hasActiveLibraryImport ? 1 : 0;
this.completedTaskCount = metadataTaskCount + bookdropFileTaskCount + libraryImportTaskCount;
}
}