perf(frontend): optimize initial bundle size with lazy-loaded dialogs and localized chart providers (#1110)

This commit is contained in:
brios
2026-05-18 23:05:10 +02:00
committed by GitHub
parent 4afc738dd4
commit c6cbdcfa11
32 changed files with 532 additions and 405 deletions
@@ -895,8 +895,8 @@ export class BookBrowserComponent implements AfterViewInit {
});
}
openShelfAssigner(): void {
this.dynamicDialogRef = this.dialogHelperService.openShelfAssignerDialog(null, this.selectedBooks());
async openShelfAssigner() {
this.dynamicDialogRef = await this.dialogHelperService.openShelfAssignerDialog(null, this.selectedBooks());
if (this.dynamicDialogRef) {
this.dynamicDialogRef.onClose.pipe(take(1)).subscribe(result => {
if (result?.assigned) {
@@ -906,8 +906,8 @@ export class BookBrowserComponent implements AfterViewInit {
}
}
lockUnlockMetadata(): void {
this.dynamicDialogRef = this.dialogHelperService.openLockUnlockMetadataDialog(this.selectedBooks());
async lockUnlockMetadata() {
this.dynamicDialogRef = await this.dialogHelperService.openLockUnlockMetadataDialog(this.selectedBooks());
if (this.dynamicDialogRef) {
this.dynamicDialogRef.onClose.pipe(take(1)).subscribe(() => {
this.bookSelectionService.deselectAll();
@@ -924,12 +924,12 @@ export class BookBrowserComponent implements AfterViewInit {
}).subscribe();
}
fetchMetadata(): void {
this.dialogHelperService.openMetadataRefreshDialog(this.selectedBooks());
async fetchMetadata() {
await this.dialogHelperService.openMetadataRefreshDialog(this.selectedBooks());
}
bulkEditMetadata(): void {
this.dynamicDialogRef = this.dialogHelperService.openBulkMetadataEditDialog(this.selectedBooks());
async bulkEditMetadata() {
this.dynamicDialogRef = await this.dialogHelperService.openBulkMetadataEditDialog(this.selectedBooks());
if (this.dynamicDialogRef) {
this.dynamicDialogRef.onClose.pipe(take(1)).subscribe(() => {
this.bookSelectionService.deselectAll();
@@ -937,8 +937,8 @@ export class BookBrowserComponent implements AfterViewInit {
}
}
multiBookEditMetadata(): void {
this.dynamicDialogRef = this.dialogHelperService.openMultibookMetadataEditorDialog(this.selectedBooks());
async multiBookEditMetadata() {
this.dynamicDialogRef = await this.dialogHelperService.openMultibookMetadataEditorDialog(this.selectedBooks());
if (this.dynamicDialogRef) {
this.dynamicDialogRef.onClose.pipe(take(1)).subscribe(() => {
this.bookSelectionService.deselectAll();
@@ -1028,11 +1028,11 @@ export class BookBrowserComponent implements AfterViewInit {
});
}
moveFiles(): void {
this.dialogHelperService.openFileMoverDialog(this.selectedBooks());
async moveFiles() {
await this.dialogHelperService.openFileMoverDialog(this.selectedBooks());
}
attachFilesToBook(): void {
async attachFilesToBook() {
const selectedBookIds = Array.from(this.selectedBooks());
const sourceBooks = this.books().filter(book =>
selectedBookIds.includes(book.id)
@@ -1058,7 +1058,7 @@ export class BookBrowserComponent implements AfterViewInit {
return;
}
this.dynamicDialogRef = this.dialogHelperService.openBulkBookFileAttacherDialog(sourceBooks);
this.dynamicDialogRef = await this.dialogHelperService.openBulkBookFileAttacherDialog(sourceBooks);
if (this.dynamicDialogRef) {
this.dynamicDialogRef.onClose.pipe(take(1)).subscribe(result => {
if (result?.success) {