From 28adb75a1a2aaf8713bb453c548ae0e0cfeb9e41 Mon Sep 17 00:00:00 2001 From: ACX <8075870+acx10@users.noreply.github.com> Date: Fri, 23 Jan 2026 12:48:44 -0700 Subject: [PATCH 01/15] Add clear warning when deleting books that files will be permanently removed (#2438) Co-authored-by: acx10 --- .../book-browser/book-browser.component.ts | 8 +++++++- .../book-browser/book-card/book-card.component.ts | 10 ++++++++-- .../series-page/series-page.component.ts | 8 +++++++- .../metadata-viewer/metadata-viewer.component.ts | 5 ++++- booklore-ui/src/assets/layout/styles/global.scss | 15 +++++++++++++++ 5 files changed, 41 insertions(+), 5 deletions(-) diff --git a/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.ts b/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.ts index b20d8837f..4db4f640d 100644 --- a/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.ts +++ b/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.ts @@ -454,9 +454,15 @@ export class BookBrowserComponent implements OnInit, AfterViewInit { confirmDeleteBooks(): void { this.confirmationService.confirm({ - message: `Are you sure you want to delete ${this.selectedBooks.size} book(s)?`, + message: `Are you sure you want to delete ${this.selectedBooks.size} book(s)?\n\nThis will permanently remove the book files from your filesystem.\n\nThis action cannot be undone.`, header: 'Confirm Deletion', icon: 'pi pi-exclamation-triangle', + acceptIcon: 'pi pi-trash', + rejectIcon: 'pi pi-times', + acceptLabel: 'Delete', + rejectLabel: 'Cancel', + acceptButtonStyleClass: 'p-button-danger', + rejectButtonStyleClass: 'p-button-outlined', accept: () => { const count = this.selectedBooks.size; const loader = this.loadingService.show(`Deleting ${count} book(s)...`); diff --git a/booklore-ui/src/app/features/book/components/book-browser/book-card/book-card.component.ts b/booklore-ui/src/app/features/book/components/book-browser/book-card/book-card.component.ts index 1cff90d0a..b459effe9 100644 --- a/booklore-ui/src/app/features/book/components/book-browser/book-card/book-card.component.ts +++ b/booklore-ui/src/app/features/book/components/book-browser/book-card/book-card.component.ts @@ -303,12 +303,15 @@ export class BookCardComponent implements OnInit, OnChanges, OnDestroy { icon: 'pi pi-trash', command: () => { this.confirmationService.confirm({ - message: `Are you sure you want to delete "${this.book.metadata?.title}"?`, + message: `Are you sure you want to delete "${this.book.metadata?.title}"?\n\nThis will permanently remove the book file from your filesystem.\n\nThis action cannot be undone.`, header: 'Confirm Deletion', icon: 'pi pi-exclamation-triangle', acceptIcon: 'pi pi-trash', rejectIcon: 'pi pi-times', + acceptLabel: 'Delete', + rejectLabel: 'Cancel', acceptButtonStyleClass: 'p-button-danger', + rejectButtonStyleClass: 'p-button-outlined', accept: () => { this.bookService.deleteBooks(new Set([this.book.id])).subscribe(); } @@ -622,12 +625,15 @@ export class BookCardComponent implements OnInit, OnChanges, OnDestroy { icon: 'pi pi-book', command: () => { this.confirmationService.confirm({ - message: `Are you sure you want to delete "${this.book.metadata?.title}"?`, + message: `Are you sure you want to delete "${this.book.metadata?.title}"?\n\nThis will permanently remove the book file from your filesystem.\n\nThis action cannot be undone.`, header: 'Confirm Deletion', icon: 'pi pi-exclamation-triangle', acceptIcon: 'pi pi-trash', rejectIcon: 'pi pi-times', + acceptLabel: 'Delete', + rejectLabel: 'Cancel', acceptButtonStyleClass: 'p-button-danger', + rejectButtonStyleClass: 'p-button-outlined', accept: () => { this.bookService.deleteBooks(new Set([this.book.id])).subscribe(); } diff --git a/booklore-ui/src/app/features/book/components/series-page/series-page.component.ts b/booklore-ui/src/app/features/book/components/series-page/series-page.component.ts index 2138460d9..a5625f8da 100644 --- a/booklore-ui/src/app/features/book/components/series-page/series-page.component.ts +++ b/booklore-ui/src/app/features/book/components/series-page/series-page.component.ts @@ -370,9 +370,15 @@ export class SeriesPageComponent implements OnDestroy { confirmDeleteBooks(): void { this.confirmationService.confirm({ - message: `Are you sure you want to delete ${this.selectedBooks.size} book(s)?`, + message: `Are you sure you want to delete ${this.selectedBooks.size} book(s)?\n\nThis will permanently remove the book files from your filesystem.\n\nThis action cannot be undone.`, header: 'Confirm Deletion', icon: 'pi pi-exclamation-triangle', + acceptIcon: 'pi pi-trash', + rejectIcon: 'pi pi-times', + acceptLabel: 'Delete', + rejectLabel: 'Cancel', + acceptButtonStyleClass: 'p-button-danger', + rejectButtonStyleClass: 'p-button-outlined', accept: () => { const count = this.selectedBooks.size; const loader = this.loadingService.show(`Deleting ${count} book(s)...`); diff --git a/booklore-ui/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.ts b/booklore-ui/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.ts index b48c451ef..7a78da7d8 100644 --- a/booklore-ui/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.ts +++ b/booklore-ui/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.ts @@ -235,12 +235,15 @@ export class MetadataViewerComponent implements OnInit, OnChanges { icon: 'pi pi-trash', command: () => { this.confirmationService.confirm({ - message: `Are you sure you want to delete "${book.metadata?.title}"?`, + message: `Are you sure you want to delete "${book.metadata?.title}"?\n\nThis will permanently remove the book file from your filesystem.\n\nThis action cannot be undone.`, header: 'Confirm Deletion', icon: 'pi pi-exclamation-triangle', acceptIcon: 'pi pi-trash', rejectIcon: 'pi pi-times', + acceptLabel: 'Delete', + rejectLabel: 'Cancel', acceptButtonStyleClass: 'p-button-danger', + rejectButtonStyleClass: 'p-button-outlined', accept: () => { this.bookService.deleteBooks(new Set([book.id])).subscribe({ next: () => { diff --git a/booklore-ui/src/assets/layout/styles/global.scss b/booklore-ui/src/assets/layout/styles/global.scss index eddc5ae5e..82a424086 100644 --- a/booklore-ui/src/assets/layout/styles/global.scss +++ b/booklore-ui/src/assets/layout/styles/global.scss @@ -115,3 +115,18 @@ margin: 0.25rem 0; flex-shrink: 0; } + +// ============================================================================= +// Confirmation Dialog Styles +// ============================================================================= + +.p-confirmdialog { + max-width: 500px; + width: 90vw; + + .p-confirmdialog-message { + white-space: pre-line; + word-wrap: break-word; + overflow-wrap: break-word; + } +} From bb0ee8373e2fae8c6e1684e6236d0352ba547c78 Mon Sep 17 00:00:00 2001 From: Sergio Visinoni Date: Sat, 24 Jan 2026 01:06:03 +0100 Subject: [PATCH 02/15] fix(opds): fix regression with browsing shelves (#2423) This fixes issue #2147 by replacing references to the legacy `additionalFiles` attribute with the new `bookFiles` one. --- .../adityachandel/booklore/repository/BookOpdsRepository.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/booklore-api/src/main/java/com/adityachandel/booklore/repository/BookOpdsRepository.java b/booklore-api/src/main/java/com/adityachandel/booklore/repository/BookOpdsRepository.java index da51b00f7..21db49a12 100644 --- a/booklore-api/src/main/java/com/adityachandel/booklore/repository/BookOpdsRepository.java +++ b/booklore-api/src/main/java/com/adityachandel/booklore/repository/BookOpdsRepository.java @@ -122,7 +122,7 @@ public interface BookOpdsRepository extends JpaRepository, Jpa """) Page findBookIdsByMetadataSearchAndShelfIds(@Param("text") String text, @Param("shelfIds") Collection shelfIds, Pageable pageable); - @EntityGraph(attributePaths = {"metadata", "metadata.authors", "metadata.categories", "additionalFiles", "shelves"}) + @EntityGraph(attributePaths = {"metadata", "metadata.authors", "metadata.categories", "bookFiles", "shelves"}) @Query("SELECT DISTINCT b FROM BookEntity b JOIN b.shelves s WHERE b.id IN :ids AND s.id IN :shelfIds AND (b.deleted IS NULL OR b.deleted = false)") List findAllWithFullMetadataByIdsAndShelfIds(@Param("ids") Collection ids, @Param("shelfIds") Collection shelfIds); @@ -133,7 +133,7 @@ public interface BookOpdsRepository extends JpaRepository, Jpa @Query("SELECT DISTINCT b.id FROM BookEntity b JOIN b.shelves s WHERE s.id IN :shelfIds AND (b.deleted IS NULL OR b.deleted = false) ORDER BY b.addedOn DESC") Page findBookIdsByShelfIds(@Param("shelfIds") Collection shelfIds, Pageable pageable); - @EntityGraph(attributePaths = {"metadata", "additionalFiles", "shelves"}) + @EntityGraph(attributePaths = {"metadata", "bookFiles", "shelves"}) @Query("SELECT DISTINCT b FROM BookEntity b JOIN b.shelves s WHERE b.id IN :ids AND s.id IN :shelfIds AND (b.deleted IS NULL OR b.deleted = false)") List findAllWithMetadataByIdsAndShelfIds(@Param("ids") Collection ids, @Param("shelfIds") Collection shelfIds); From 18419c970f5470388ef39e0540e9734e2e5b2f97 Mon Sep 17 00:00:00 2001 From: ACX <8075870+acx10@users.noreply.github.com> Date: Fri, 23 Jan 2026 17:34:33 -0700 Subject: [PATCH 03/15] refactor: reduce re-renders and improve filter sidebar performance (#2440) Co-authored-by: acx10 --- .../book-filter/book-filter.component.html | 50 +++++++++-------- .../book-filter/book-filter.component.scss | 5 +- .../book-filter/book-filter.component.ts | 55 ++++++++----------- 3 files changed, 52 insertions(+), 58 deletions(-) diff --git a/booklore-ui/src/app/features/book/components/book-browser/book-filter/book-filter.component.html b/booklore-ui/src/app/features/book/components/book-browser/book-filter/book-filter.component.html index 7d128880b..8a3411164 100644 --- a/booklore-ui/src/app/features/book/components/book-browser/book-filter/book-filter.component.html +++ b/booklore-ui/src/app/features/book/components/book-browser/book-filter/book-filter.component.html @@ -13,12 +13,12 @@
- + @for (filterType of filterTypes; track trackByFilterType(i, filterType); let i = $index) { @if (filterStreams[filterType] | async; as filters) { @if (filters.length > 0) { - - + + {{ filterLabels[filterType] || (filterType | titlecase) }} @if (activeFilters[filterType]?.length) { @@ -27,29 +27,33 @@ } - + - -
- @for (filter of filters; track trackByFilter(j, filter); let j = $index) { -
+
- {{ getFilterValueDisplay(filter) }} - -
- } - @if (truncatedFilters[filterType]) { -
- Showing first 500 items -
- } -
- - + (click)="handleFilterClick(filterType, getFilterValueId(filter))"> + {{ getFilterValueDisplay(filter) }} + +
+ + @if (truncatedFilters[filterType]) { +
+ Showing first 500 items +
+ } + } +
+
} } } diff --git a/booklore-ui/src/app/features/book/components/book-browser/book-filter/book-filter.component.scss b/booklore-ui/src/app/features/book/components/book-browser/book-filter/book-filter.component.scss index cb174cf12..cb0ec710e 100644 --- a/booklore-ui/src/app/features/book/components/book-browser/book-filter/book-filter.component.scss +++ b/booklore-ui/src/app/features/book/components/book-browser/book-filter/book-filter.component.scss @@ -51,16 +51,13 @@ } .filter-list { - max-height: 27.5rem; - overflow-y: auto; - overscroll-behavior: contain; padding-right: 0.25rem; } .filter-row { cursor: pointer; transition: colors 200ms ease-in-out; - padding-bottom: 0.25rem; + height: 26px; display: flex; flex-direction: row; align-items: center; diff --git a/booklore-ui/src/app/features/book/components/book-browser/book-filter/book-filter.component.ts b/booklore-ui/src/app/features/book/components/book-browser/book-filter/book-filter.component.ts index 957e4418c..aef33bfaf 100644 --- a/booklore-ui/src/app/features/book/components/book-browser/book-filter/book-filter.component.ts +++ b/booklore-ui/src/app/features/book/components/book-browser/book-filter/book-filter.component.ts @@ -7,6 +7,7 @@ import {Shelf} from '../../../model/shelf.model'; import {EntityType} from '../book-browser.component'; import {Book, ReadStatus} from '../../../model/book.model'; import {Accordion, AccordionContent, AccordionHeader, AccordionPanel} from 'primeng/accordion'; +import {CdkFixedSizeVirtualScroll, CdkVirtualForOf, CdkVirtualScrollViewport} from '@angular/cdk/scrolling'; import {AsyncPipe, NgClass, TitleCasePipe} from '@angular/common'; import {Badge} from 'primeng/badge'; import {FormsModule} from '@angular/forms'; @@ -28,8 +29,6 @@ export interface Filter { } export type FilterType = - | 'library' - | 'shelf' | 'author' | 'category' | 'series' @@ -42,13 +41,10 @@ export type FilterType = | 'tag' | 'language' | 'bookType' - | 'shelfStatus' | 'fileSize' | 'pageCount' | 'amazonRating' - | 'goodreadsRating' - | 'ranobedbRating' - | 'hardcoverRating'; + | 'goodreadsRating'; export const ratingRanges = [ {id: '0to1', label: '0 to 1', min: 0, max: 1, sortIndex: 0}, @@ -176,6 +172,9 @@ function getReadStatusName(status?: ReadStatus | null): string { AccordionPanel, AccordionHeader, AccordionContent, + CdkVirtualScrollViewport, + CdkFixedSizeVirtualScroll, + CdkVirtualForOf, NgClass, Badge, AsyncPipe, @@ -207,8 +206,6 @@ export class BookFilterComponent implements OnInit, OnDestroy { private _selectedFilterMode: BookFilterMode = 'and'; expandedPanels: number[] = [0]; readonly filterLabels: Record = { - library: 'Library', - shelf: 'Shelf', author: 'Author', category: 'Genre', series: 'Series', @@ -221,13 +218,10 @@ export class BookFilterComponent implements OnInit, OnDestroy { tag: 'Tag', language: 'Language', bookType: 'Book Type', - shelfStatus: 'Shelf Status', fileSize: 'File Size', pageCount: 'Page Count', amazonRating: 'Amazon Rating', - goodreadsRating: 'Goodreads Rating', - hardcoverRating: 'Hardcover Rating', - ranobedbRating: 'Ranobedb Rating', + goodreadsRating: 'Goodreads Rating' }; private destroy$ = new Subject(); @@ -253,14 +247,6 @@ export class BookFilterComponent implements OnInit, OnDestroy { .pipe(takeUntil(this.destroy$)) .subscribe(() => { this.filterStreams = { - library: this.getFilterStream( - (book) => (book.libraryId ? [{id: book.libraryId, name: book.libraryName}] : []), - 'id', 'name' - ), - shelf: this.getFilterStream( - (book) => (book.shelves ? book.shelves.map(s => ({id: s.id, name: s.name})) : []), - 'id', 'name' - ), author: this.getFilterStream( (book: Book) => Array.isArray(book.metadata?.authors) ? book.metadata.authors.map(name => ({id: name, name})) : [], 'id', 'name' @@ -297,13 +283,10 @@ export class BookFilterComponent implements OnInit, OnDestroy { ), language: this.getFilterStream(getLanguageFilter, 'id', 'name'), bookType: this.getFilterStream(getBookTypeFilter, 'id', 'name'), - shelfStatus: this.getFilterStream(getShelfStatusFilter, 'id', 'name'), fileSize: this.getFilterStream((book: Book) => getFileSizeRangeFilters(book.fileSizeKb), 'id', 'name', 'sortIndex'), pageCount: this.getFilterStream((book: Book) => getPageCountRangeFilters(book.metadata?.pageCount ?? undefined), 'id', 'name', 'sortIndex'), amazonRating: this.getFilterStream((book: Book) => getRatingRangeFilters(book.metadata?.amazonRating ?? undefined), 'id', 'name', 'sortIndex'), - goodreadsRating: this.getFilterStream((book: Book) => getRatingRangeFilters(book.metadata?.goodreadsRating ?? undefined), 'id', 'name', 'sortIndex'), - hardcoverRating: this.getFilterStream((book: Book) => getRatingRangeFilters(book.metadata?.hardcoverRating ?? undefined), 'id', 'name', 'sortIndex'), - ranobedbRating: this.getFilterStream((book: Book) => getRatingRangeFilters(book.metadata?.ranobedbRating ?? undefined), 'id', 'name', 'sortIndex'), + goodreadsRating: this.getFilterStream((book: Book) => getRatingRangeFilters(book.metadata?.goodreadsRating ?? undefined), 'id', 'name', 'sortIndex') }; this.filterTypes = Object.keys(this.filterStreams) as FilterType[]; @@ -460,18 +443,28 @@ export class BookFilterComponent implements OnInit, OnDestroy { clearActiveFilter() { this.activeFilters = {}; - this.setExpandedPanels(); + this.expandedPanels = [0]; this.filterChangeSubject.next(null); } + onExpandedPanelsChange(value: string | number | string[] | number[] | null | undefined): void { + if (Array.isArray(value)) { + this.expandedPanels = value.map(v => Number(v)); + } + } + + getVirtualScrollHeight(itemCount: number): number { + return Math.min(itemCount * 28, 440); + } + setExpandedPanels(): void { - const indexes = []; + const current = new Set(this.expandedPanels); for (let i = 0; i < this.filterTypes.length; i++) { if (this.activeFilters[this.filterTypes[i]]?.length) { - indexes.push(i); + current.add(i); } } - this.expandedPanels = indexes.length > 0 ? indexes : [0]; + this.expandedPanels = current.size > 0 ? [...current] : [0]; } onFiltersChanged(): void { @@ -484,18 +477,18 @@ export class BookFilterComponent implements OnInit, OnDestroy { trackByFilter(_: number, filter: Filter): unknown { const value = filter.value as { id?: unknown } | unknown; - return (typeof value === 'object' && value !== null && 'id' in value) ? (value as {id: unknown}).id : filter.value; + return (typeof value === 'object' && value !== null && 'id' in value) ? (value as { id: unknown }).id : filter.value; } getFilterValueId(filter: Filter): unknown { const value = filter.value as { id?: unknown } | unknown; - return (typeof value === 'object' && value !== null && 'id' in value) ? (value as {id: unknown}).id : filter.value; + return (typeof value === 'object' && value !== null && 'id' in value) ? (value as { id: unknown }).id : filter.value; } getFilterValueDisplay(filter: Filter): string { const value = filter.value as { name?: string } | string | unknown; if (typeof value === 'object' && value !== null && 'name' in value) { - return String((value as {name: string}).name ?? ''); + return String((value as { name: string }).name ?? ''); } return String(value ?? ''); } From 308d5bf87d7d5f1a9efe6dbfd8d6fb9c9ef00bb6 Mon Sep 17 00:00:00 2001 From: ACX <8075870+acx10@users.noreply.github.com> Date: Fri, 23 Jan 2026 17:48:56 -0700 Subject: [PATCH 04/15] fix(cbx-reader): prevent touch drag on mobile and fix header title overflow (#2441) --- .../readers/cbx-reader/cbx-reader.component.scss | 6 ++++++ .../cbx-reader/layout/header/cbx-header.component.scss | 9 +++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/booklore-ui/src/app/features/readers/cbx-reader/cbx-reader.component.scss b/booklore-ui/src/app/features/readers/cbx-reader/cbx-reader.component.scss index b9c59b28a..8905fae3d 100644 --- a/booklore-ui/src/app/features/readers/cbx-reader/cbx-reader.component.scss +++ b/booklore-ui/src/app/features/readers/cbx-reader/cbx-reader.component.scss @@ -8,6 +8,10 @@ background: #1a1a1a; color: #ffffff; position: relative; + touch-action: none; + overscroll-behavior: none; + -webkit-user-select: none; + user-select: none; &:focus { outline: none; @@ -267,6 +271,8 @@ overflow-y: auto; overflow-x: hidden; align-items: flex-start; + touch-action: pan-y; + overscroll-behavior: contain; .infinite-scroll-wrapper { display: flex; diff --git a/booklore-ui/src/app/features/readers/cbx-reader/layout/header/cbx-header.component.scss b/booklore-ui/src/app/features/readers/cbx-reader/layout/header/cbx-header.component.scss index ac75a8110..c9a75d993 100644 --- a/booklore-ui/src/app/features/readers/cbx-reader/layout/header/cbx-header.component.scss +++ b/booklore-ui/src/app/features/readers/cbx-reader/layout/header/cbx-header.component.scss @@ -92,10 +92,9 @@ } .book-title { - position: absolute; - left: 50%; - transform: translateX(-50%); - max-width: calc(100% - 240px); + flex: 1; + min-width: 0; + padding: 0 12px; text-align: center; font-size: 14px; font-weight: 500; @@ -105,7 +104,6 @@ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; - min-height: 1.2em; } } @@ -124,7 +122,6 @@ .book-title { font-size: 12px; - max-width: calc(100% - 160px); } } } From 1aea55faea562dd33365779be2e1fd32c64eb088 Mon Sep 17 00:00:00 2001 From: ACX <8075870+acx10@users.noreply.github.com> Date: Fri, 23 Jan 2026 19:17:53 -0700 Subject: [PATCH 05/15] perf: lazy-load accordion content in library metadata settings (#2442) --- .../library-metadata-settings.component.html | 14 ++++++++------ .../library-metadata-settings.component.ts | 5 +++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/booklore-ui/src/app/features/settings/library-metadata-settings/library-metadata-settings.component.html b/booklore-ui/src/app/features/settings/library-metadata-settings/library-metadata-settings.component.html index 022e67db3..dbe9e5393 100644 --- a/booklore-ui/src/app/features/settings/library-metadata-settings/library-metadata-settings.component.html +++ b/booklore-ui/src/app/features/settings/library-metadata-settings/library-metadata-settings.component.html @@ -50,7 +50,7 @@
@if (libraries$ | async; as libraries) { - + @for (library of libraries; track trackByLibrary($index, library); let i = $index) { @@ -75,11 +75,13 @@
- - + @if (activePanel === i) { + + + }
diff --git a/booklore-ui/src/app/features/settings/library-metadata-settings/library-metadata-settings.component.ts b/booklore-ui/src/app/features/settings/library-metadata-settings/library-metadata-settings.component.ts index a26f38b80..792ae7074 100644 --- a/booklore-ui/src/app/features/settings/library-metadata-settings/library-metadata-settings.component.ts +++ b/booklore-ui/src/app/features/settings/library-metadata-settings/library-metadata-settings.component.ts @@ -32,6 +32,7 @@ export class LibraryMetadataSettingsComponent implements OnInit { defaultMetadataOptions: MetadataRefreshOptions = this.getDefaultMetadataOptions(); libraryMetadataOptions: Record = {}; + activePanel: number | null = null; ngOnInit() { this.appSettingsService.appSettings$.subscribe(appSettings => { @@ -54,6 +55,10 @@ export class LibraryMetadataSettingsComponent implements OnInit { }); } + onPanelChange(event: unknown) { + this.activePanel = typeof event === 'number' ? event : null; + } + onDefaultMetadataOptionsSubmitted(options: MetadataRefreshOptions) { this.defaultMetadataOptions = options; this.saveDefaultMetadataOptions(options); From b616ef872389f3f1444799450d6f36949ec28d2c Mon Sep 17 00:00:00 2001 From: acx10 Date: Fri, 23 Jan 2026 19:19:47 -0700 Subject: [PATCH 06/15] fix: top bar layout issues --- .../layout/component/layout-topbar/app.topbar.component.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/booklore-ui/src/app/shared/layout/component/layout-topbar/app.topbar.component.scss b/booklore-ui/src/app/shared/layout/component/layout-topbar/app.topbar.component.scss index 69eb74fd3..911974a4e 100644 --- a/booklore-ui/src/app/shared/layout/component/layout-topbar/app.topbar.component.scss +++ b/booklore-ui/src/app/shared/layout/component/layout-topbar/app.topbar.component.scss @@ -1,7 +1,6 @@ .topbar-logo { padding-left: 1.25rem; padding-right: 6rem; - display: flex; gap: 0.5rem; } From 8278f47c6afd2630059aaf47b67205948ae2f1e9 Mon Sep 17 00:00:00 2001 From: ACX <8075870+acx10@users.noreply.github.com> Date: Fri, 23 Jan 2026 19:33:52 -0700 Subject: [PATCH 07/15] fix(stats): show tooltip for single bubble and allow overflow in author universe chart (#2443) --- .../author-universe-chart.component.ts | 107 +++++++++++------- 1 file changed, 67 insertions(+), 40 deletions(-) diff --git a/booklore-ui/src/app/features/stats/component/library-stats/charts/author-universe-chart/author-universe-chart.component.ts b/booklore-ui/src/app/features/stats/component/library-stats/charts/author-universe-chart/author-universe-chart.component.ts index 49f2b58ea..2fde44d93 100644 --- a/booklore-ui/src/app/features/stats/component/library-stats/charts/author-universe-chart/author-universe-chart.component.ts +++ b/booklore-ui/src/app/features/stats/component/library-stats/charts/author-universe-chart/author-universe-chart.component.ts @@ -3,7 +3,7 @@ import {CommonModule} from '@angular/common'; import {BaseChartDirective} from 'ng2-charts'; import {BehaviorSubject, EMPTY, Observable, Subject} from 'rxjs'; import {catchError, filter, first, switchMap, takeUntil} from 'rxjs/operators'; -import {ChartConfiguration, ChartData, TooltipItem} from 'chart.js'; +import {Chart, ChartConfiguration, ChartData} from 'chart.js'; import {LibraryFilterService} from '../../service/library-filter.service'; import {BookService} from '../../../../../book/service/book.service'; import {BookState} from '../../../../../book/model/state/book-state.model'; @@ -90,6 +90,7 @@ export class AuthorUniverseChartComponent implements OnInit, OnDestroy { ngOnDestroy(): void { this.destroy$.next(); this.destroy$.complete(); + document.getElementById('author-chart-tooltip')?.remove(); } private initChartOptions(): void { @@ -170,45 +171,8 @@ export class AuthorUniverseChartComponent implements OnInit, OnDestroy { } }, tooltip: { - enabled: true, - backgroundColor: 'rgba(0, 0, 0, 0.95)', - titleColor: '#ffffff', - bodyColor: '#ffffff', - borderColor: '#8b5cf6', - borderWidth: 2, - cornerRadius: 8, - padding: 16, - titleFont: {size: 14, weight: 'bold'}, - bodyFont: {size: 12}, - callbacks: { - title: (context: TooltipItem<'bubble'>[]) => { - const raw = context[0].raw as BubbleDataPoint; - return raw.authorStats.name; - }, - label: (context: TooltipItem<'bubble'>) => { - const raw = context.raw as BubbleDataPoint; - const stats = raw.authorStats; - const lines: string[] = []; - - lines.push(`Books: ${stats.bookCount}`); - lines.push(`Total Pages: ${stats.totalPages.toLocaleString()}`); - - if (stats.avgRating > 0) { - lines.push(`Avg Rating: ${stats.avgRating.toFixed(2)} ★`); - } else { - lines.push(`Avg Rating: No ratings`); - } - - lines.push(`Read: ${stats.readCount}/${stats.bookCount} (${Math.round(stats.completionRate)}%)`); - - if (stats.categories.length > 0) { - const topCategories = stats.categories.slice(0, 3).join(', '); - lines.push(`Genres: ${topCategories}`); - } - - return lines; - } - } + enabled: false, + external: (context) => this.handleExternalTooltip(context) }, datalabels: { display: false @@ -552,6 +516,69 @@ export class AuthorUniverseChartComponent implements OnInit, OnDestroy { return insights; } + private handleExternalTooltip(context: { chart: Chart; tooltip: any }): void { + const {chart, tooltip} = context; + let tooltipEl = document.getElementById('author-chart-tooltip'); + + if (!tooltipEl) { + tooltipEl = document.createElement('div'); + tooltipEl.id = 'author-chart-tooltip'; + Object.assign(tooltipEl.style, { + position: 'fixed', + zIndex: '9999', + background: 'rgba(0, 0, 0, 0.95)', + border: '2px solid #8b5cf6', + borderRadius: '8px', + padding: '12px 16px', + pointerEvents: 'none', + opacity: '0', + transition: 'opacity 0.15s ease', + transform: 'translate(-50%, calc(-100% - 12px))', + maxWidth: '280px', + whiteSpace: 'nowrap', + fontFamily: "'Inter', sans-serif" + }); + document.body.appendChild(tooltipEl); + } + + if (tooltip.opacity === 0) { + tooltipEl.style.opacity = '0'; + return; + } + + // Only use the first (nearest) data point + const dataPoint = tooltip.dataPoints?.[0]; + if (!dataPoint) { + tooltipEl.style.opacity = '0'; + return; + } + + const raw = dataPoint.raw as BubbleDataPoint; + const stats = raw.authorStats; + + const ratingText = stats.avgRating > 0 + ? `${stats.avgRating.toFixed(2)} ★` + : 'No ratings'; + + const categoriesHtml = stats.categories.length > 0 + ? `
Genres: ${stats.categories.slice(0, 3).join(', ')}
` + : ''; + + tooltipEl.innerHTML = ` +
${stats.name}
+
Books: ${stats.bookCount}
+
Total Pages: ${stats.totalPages.toLocaleString()}
+
Avg Rating: ${ratingText}
+
Read: ${stats.readCount}/${stats.bookCount} (${Math.round(stats.completionRate)}%)
+ ${categoriesHtml} + `; + + const canvasRect = chart.canvas.getBoundingClientRect(); + tooltipEl.style.opacity = '1'; + tooltipEl.style.left = (canvasRect.left + tooltip.caretX) + 'px'; + tooltipEl.style.top = (canvasRect.top + tooltip.caretY) + 'px'; + } + private hexToRgba(hex: string, alpha: number): string { const r = parseInt(hex.slice(1, 3), 16); const g = parseInt(hex.slice(3, 5), 16); From 27c764f0f1bd842f42ed855b5b15585c9baf2537 Mon Sep 17 00:00:00 2001 From: ACX <8075870+acx10@users.noreply.github.com> Date: Fri, 23 Jan 2026 20:51:22 -0700 Subject: [PATCH 08/15] feat(pwa): add offline handling and fallback support (#2444) Co-authored-by: acx10 --- booklore-ui/ngsw-config.json | 1 + booklore-ui/src/app/app.component.html | 29 ++++++++++++++++--- booklore-ui/src/app/app.component.scss | 16 ++++++++++ booklore-ui/src/app/app.component.ts | 18 ++++++++++++ .../src/app/core/security/auth-initializer.ts | 16 ++++++++++ 5 files changed, 76 insertions(+), 4 deletions(-) diff --git a/booklore-ui/ngsw-config.json b/booklore-ui/ngsw-config.json index 69edd2878..a5814f5f2 100644 --- a/booklore-ui/ngsw-config.json +++ b/booklore-ui/ngsw-config.json @@ -8,6 +8,7 @@ "resources": { "files": [ "/favicon.ico", + "/assets/favicon.svg", "/index.csr.html", "/index.html", "/manifest.webmanifest", diff --git a/booklore-ui/src/app/app.component.html b/booklore-ui/src/app/app.component.html index 6f0f0d716..98abd356e 100644 --- a/booklore-ui/src/app/app.component.html +++ b/booklore-ui/src/app/app.component.html @@ -1,10 +1,31 @@ @if (loading) {
- -

Loading Booklore…

-

Please wait while we get things ready.

-
+ + @if (offline) { +

You're Offline

+

BookLore needs a connection to the server to load.

+

Check your network and try again.

+ } @else { +

Loading Booklore…

+

Please wait while we get things ready.

+
+ } +
+
+} @else if (offline) { +
+
+ +

You're Offline

+

Your connection was lost. Some features may not work.

+
} @else { diff --git a/booklore-ui/src/app/app.component.scss b/booklore-ui/src/app/app.component.scss index 397661ebe..e2966d16e 100644 --- a/booklore-ui/src/app/app.component.scss +++ b/booklore-ui/src/app/app.component.scss @@ -47,3 +47,19 @@ p { transform: rotate(360deg); } } + +.retry-btn { + margin-top: 1rem; + padding: 0.6rem 1.5rem; + background-color: #818cf8; + color: #fff; + border: none; + border-radius: 6px; + font-size: 0.95rem; + cursor: pointer; + transition: background-color 0.2s; + + &:hover { + background-color: #6366f1; + } +} diff --git a/booklore-ui/src/app/app.component.ts b/booklore-ui/src/app/app.component.ts index 32871b47e..54d3320d1 100644 --- a/booklore-ui/src/app/app.component.ts +++ b/booklore-ui/src/app/app.component.ts @@ -28,6 +28,7 @@ import {scan, withLatestFrom} from 'rxjs/operators'; export class AppComponent implements OnInit, OnDestroy { loading = true; + offline = !navigator.onLine; private subscriptions: Subscription[] = []; private subscriptionsInitialized = false; @@ -43,6 +44,9 @@ export class AppComponent implements OnInit, OnDestroy { private libraryLoadingService = inject(LibraryLoadingService); ngOnInit(): void { + window.addEventListener('online', this.onOnline); + window.addEventListener('offline', this.onOffline); + this.authInit.initialized$.subscribe(ready => { this.loading = !ready; if (ready && !this.subscriptionsInitialized) { @@ -52,6 +56,18 @@ export class AppComponent implements OnInit, OnDestroy { }); } + private onOnline = () => { + this.offline = false; + }; + + private onOffline = () => { + this.offline = true; + }; + + reload(): void { + window.location.reload(); + } + private setupWebSocketSubscriptions(): void { this.subscriptions.push( this.rxStompService.watch('/user/queue/book-add').pipe( @@ -125,6 +141,8 @@ export class AppComponent implements OnInit, OnDestroy { } ngOnDestroy(): void { + window.removeEventListener('online', this.onOnline); + window.removeEventListener('offline', this.onOffline); this.subscriptions.forEach(sub => sub.unsubscribe()); this.libraryLoadingService.hide(); } diff --git a/booklore-ui/src/app/core/security/auth-initializer.ts b/booklore-ui/src/app/core/security/auth-initializer.ts index 99f7da75d..4948a3278 100644 --- a/booklore-ui/src/app/core/security/auth-initializer.ts +++ b/booklore-ui/src/app/core/security/auth-initializer.ts @@ -8,6 +8,7 @@ const OIDC_BYPASS_KEY = 'booklore-oidc-bypass'; const OIDC_ERROR_COUNT_KEY = 'booklore-oidc-error-count'; const MAX_OIDC_RETRIES = 3; const OIDC_TIMEOUT_MS = 5000; +const SETTINGS_TIMEOUT_MS = 10000; function withTimeout(promise: Promise, timeoutMs: number): Promise { return Promise.race([ @@ -26,8 +27,23 @@ export function initializeAuthFactory() { const authInitService = inject(AuthInitializationService); return new Promise((resolve) => { + if (!navigator.onLine) { + console.warn('[Auth] App is offline, skipping auth initialization'); + authInitService.markAsInitialized(); + resolve(); + return; + } + + const settingsTimeout = setTimeout(() => { + console.warn('[Auth] Public settings fetch timed out, falling back to local auth'); + sub.unsubscribe(); + authInitService.markAsInitialized(); + resolve(); + }, SETTINGS_TIMEOUT_MS); + const sub = appSettingsService.publicAppSettings$.subscribe(publicSettings => { if (publicSettings) { + clearTimeout(settingsTimeout); const forceLocalOnly = new URLSearchParams(window.location.search).get('localOnly') === 'true'; const oidcBypassed = localStorage.getItem(OIDC_BYPASS_KEY) === 'true'; const errorCount = parseInt(localStorage.getItem(OIDC_ERROR_COUNT_KEY) || '0', 10); From ffae8dfce35dc4e75dd133d63c9c6202591dc0e1 Mon Sep 17 00:00:00 2001 From: James Ward Date: Fri, 23 Jan 2026 22:56:05 -0500 Subject: [PATCH 09/15] fix(ui): use local asset for page background (#2445) this avoids a remote call to github's raw download so the application is less reliant on public internet access. further this prevents unknown failures when the bg.png is removed or changed in the external repo --- booklore-ui/src/assets/images/bg.png | Bin 0 -> 14499 bytes .../src/assets/layout/styles/layout/_main.scss | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 booklore-ui/src/assets/images/bg.png diff --git a/booklore-ui/src/assets/images/bg.png b/booklore-ui/src/assets/images/bg.png new file mode 100644 index 0000000000000000000000000000000000000000..6fb203c3bbfa41488b708e2ed28547f8943e2778 GIT binary patch literal 14499 zcmdUWiCa=z`}Wo{D=V`}Pp7n_$4qm`)Kna3aHv$wa4M(FCM7k+2^FzCrD;kXX9X!I z#0e|s37fPWOH|6a6cG>y6cG^k=>2~0b^X3S;ak_mX0zC=z4qSgdG6+KgX5-e`TkC1Vi3HX>RMu3Hxfbx{+nh})L%YZ02A z&=+?^lXFQZ>QT`Fg0=chCwdlDZ1Jg26Gamz$DYA^WPtIUyL_YI z2`%m`Qc9TUB8xYEbWlKBHs=xsJ`G$S6fV)f3`F<&pBW&7Gs8E;#bb;xHw#fgTqc-H z7~!EJHw4*i75-56f$6(ElA@z{YVEpcB%<3-T(bFab*+6~+_az|1UK}EwF|^3m%N5q zvurML4JMNFz#l*waS15=I-8~+rY#<5om)`}vFCZ$x+p{8R8l>J9UZ_BJHc>X-^6e; zp_m@NFnP1QVH_`VOqz&1P#0l0amipS_bj2Yo)IITbN67)$Un81O9$btzDP8FC>mCS$=PA&j zj%1L|gUuzpDd&pFQSZi!OWZ5X1W;zt)?M$IC?9grz~2h0P>FDO1;$g<=291(`IH_SPz@F zF3uXw)To16a#LkXo3ZTg!F|lIt8VS@IF13_7|vmZaDLa?^cD19!S=3x<-6>C0;(NQ zdV{%-=B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styles/layout/_main.scss b/booklore-ui/src/assets/layout/styles/layout/_main.scss index a99227c45..0e097e500 100644 --- a/booklore-ui/src/assets/layout/styles/layout/_main.scss +++ b/booklore-ui/src/assets/layout/styles/layout/_main.scss @@ -18,7 +18,7 @@ body { min-height: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; - --glow-image: url(https://github.com/booklore-app/booklore-docs/blob/master/static/img/cdn/bg.png?raw=true), radial-gradient(50% 50% at center -25px, var(--p-primary-color) 0%, #000000 100%); + --glow-image: url(assets/images/bg.png), radial-gradient(50% 50% at center -25px, var(--p-primary-color) 0%, #000000 100%); --glow-blend: hard-light, color-dodge; } From 330c31a70a60cd9c203df5e241aa991f6738aca2 Mon Sep 17 00:00:00 2001 From: ACX <8075870+acx10@users.noreply.github.com> Date: Fri, 23 Jan 2026 21:23:15 -0700 Subject: [PATCH 10/15] feat(book-browser): add responsive grid columns for mobile view (#2446) --- .../book-browser/book-browser.component.html | 49 +++++++++++++----- .../book-browser/book-browser.component.scss | 51 +++++++++++++++++++ .../book-browser/book-browser.component.ts | 50 +++++++++++++++++- .../book-card/book-card.component.scss | 46 +++++++++++++++++ 4 files changed, 182 insertions(+), 14 deletions(-) diff --git a/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.html b/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.html index 749ecc922..e7fd54092 100644 --- a/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.html +++ b/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.html @@ -111,20 +111,43 @@
-
- - - -
- {{ coverScalePreferenceService.scaleFactor.toFixed(2) }}x + @if (isMobile) { +
+ +
+ + + +
-
+ } @else { +
+ + + +
+ {{ coverScalePreferenceService.scaleFactor.toFixed(2) }}x +
+
+ }
| undefined; @@ -136,6 +138,14 @@ export class BookBrowserComponent implements OnInit, AfterViewInit { currentViewMode: string | undefined; lastAppliedSort: SortOption | null = null; showFilter = false; + screenWidth = typeof window !== 'undefined' ? window.innerWidth : 1024; + mobileColumnCount = 3; + + private readonly MOBILE_BREAKPOINT = 768; + private readonly CARD_ASPECT_RATIO = 7 / 5; // height / width (from aspect-ratio: 5/7) + private readonly MOBILE_GAP = 16; // 1rem in px + private readonly MOBILE_PADDING = 16; // 0.5rem * 2 sides + private readonly MOBILE_COLUMNS_STORAGE_KEY = 'mobileColumnsPreference'; private settingFiltersFromUrl = false; protected metadataMenuItems: MenuItem[] | undefined; @@ -152,15 +162,40 @@ export class BookBrowserComponent implements OnInit, AfterViewInit { @ViewChild(BookFilterComponent, {static: false}) bookFilterComponent!: BookFilterComponent; + @HostListener('window:resize') + onResize(): void { + this.screenWidth = window.innerWidth; + } + + get isMobile(): boolean { + return this.screenWidth < this.MOBILE_BREAKPOINT; + } + + get mobileCardSize(): { width: number; height: number } { + const columns = this.mobileColumnCount; + const totalGaps = (columns - 1) * this.MOBILE_GAP; + const totalPadding = this.MOBILE_PADDING * 2; + const availableWidth = this.screenWidth - totalGaps - totalPadding; + const cardWidth = Math.floor(availableWidth / columns); + const cardHeight = Math.floor(cardWidth * this.CARD_ASPECT_RATIO); + return { width: cardWidth, height: cardHeight }; + } + get selectedBooks(): Set { return this.bookSelectionService.selectedBooks; } get currentCardSize() { + if (this.isMobile) { + return this.mobileCardSize; + } return this.coverScalePreferenceService.currentCardSize; } get gridColumnMinWidth(): string { + if (this.isMobile) { + return `${this.mobileCardSize.width}px`; + } return this.coverScalePreferenceService.gridColumnMinWidth; } @@ -217,6 +252,7 @@ export class BookBrowserComponent implements OnInit, AfterViewInit { ngOnInit(): void { this.pageTitle.setPageTitle(''); this.coverScalePreferenceService.scaleChange$.pipe(debounceTime(1000)).subscribe(); + this.loadMobileColumnsPreference(); this.initializeEntityRouting(); this.setupRouteChangeHandlers(); @@ -704,4 +740,16 @@ export class BookBrowserComponent implements OnInit, AfterViewInit { this.bookSorter.selectedSort! ); } + + setMobileColumns(columns: number): void { + this.mobileColumnCount = columns; + this.localStorageService.set(this.MOBILE_COLUMNS_STORAGE_KEY, columns); + } + + private loadMobileColumnsPreference(): void { + const saved = this.localStorageService.get(this.MOBILE_COLUMNS_STORAGE_KEY); + if (saved !== null && [2, 3, 4].includes(saved)) { + this.mobileColumnCount = saved; + } + } } diff --git a/booklore-ui/src/app/features/book/components/book-browser/book-card/book-card.component.scss b/booklore-ui/src/app/features/book/components/book-browser/book-card/book-card.component.scss index 595e06039..7a4c01036 100644 --- a/booklore-ui/src/app/features/book/components/book-browser/book-card/book-card.component.scss +++ b/booklore-ui/src/app/features/book/components/book-browser/book-card/book-card.component.scss @@ -67,6 +67,11 @@ text-align: center; margin: 0; padding-left: 0.5rem; + + @media (max-width: 767px) { + font-size: 0.75rem; + padding-left: 0.25rem; + } } .info-btn, @@ -79,6 +84,31 @@ transition: opacity 0.15s ease, visibility 0.15s ease; z-index: 2; will-change: opacity, visibility; + + ::ng-deep .p-button { + box-shadow: + 0 2px 8px rgba(0, 0, 0, 0.4), + inset 0 1px 0 rgba(255, 255, 255, 0.15); + border: 1px solid rgba(255, 255, 255, 0.1); + transition: transform 0.15s ease, box-shadow 0.15s ease; + + &:hover { + transform: scale(1.08); + box-shadow: + 0 4px 12px rgba(0, 0, 0, 0.5), + inset 0 1px 0 rgba(255, 255, 255, 0.2); + } + + @media (max-width: 767px) { + width: clamp(1.5rem, 8vw, 2.5rem); + height: clamp(1.5rem, 8vw, 2.5rem); + padding: 0; + + .pi { + font-size: clamp(0.65rem, 3.5vw, 1rem); + } + } + } } .info-btn { @@ -109,6 +139,11 @@ transition: opacity 0.15s ease, visibility 0.15s ease; z-index: 2; will-change: opacity, visibility; + + @media (max-width: 767px) { + top: 4px; + right: 4px; + } } .select-checkbox .p-checkbox { @@ -203,6 +238,12 @@ align-items: flex-start; gap: 4px; z-index: 4; + + @media (max-width: 767px) { + top: 4px; + left: 4px; + gap: 2px; + } } .book-type-pill-overlay, @@ -210,6 +251,11 @@ .series-items-count-overlay { position: static; margin: 0; + + @media (max-width: 767px) { + font-size: 0.6rem; + padding: 1px 4px; + } } .book-type-epub { From d6fa1bd9b83983e5d09ed46bd585e0612c6571c6 Mon Sep 17 00:00:00 2001 From: ACX <8075870+acx10@users.noreply.github.com> Date: Fri, 23 Jan 2026 21:27:31 -0700 Subject: [PATCH 11/15] fix(ui): rename bg.png to topbar.png and fix asset path --- .../src/assets/images/{bg.png => topbar.png} | Bin .../src/assets/layout/styles/layout/_main.scss | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename booklore-ui/src/assets/images/{bg.png => topbar.png} (100%) diff --git a/booklore-ui/src/assets/images/bg.png b/booklore-ui/src/assets/images/topbar.png similarity index 100% rename from booklore-ui/src/assets/images/bg.png rename to booklore-ui/src/assets/images/topbar.png diff --git a/booklore-ui/src/assets/layout/styles/layout/_main.scss b/booklore-ui/src/assets/layout/styles/layout/_main.scss index 0e097e500..53ecb3d6a 100644 --- a/booklore-ui/src/assets/layout/styles/layout/_main.scss +++ b/booklore-ui/src/assets/layout/styles/layout/_main.scss @@ -18,7 +18,7 @@ body { min-height: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; - --glow-image: url(assets/images/bg.png), radial-gradient(50% 50% at center -25px, var(--p-primary-color) 0%, #000000 100%); + --glow-image: url(../../../images/topbar.png), radial-gradient(50% 50% at center -25px, var(--p-primary-color) 0%, #000000 100%); --glow-blend: hard-light, color-dodge; } From 596bfc5798d5af0c6d48738c9d8d75e5933e6fb5 Mon Sep 17 00:00:00 2001 From: ACX <8075870+acx10@users.noreply.github.com> Date: Fri, 23 Jan 2026 21:59:21 -0700 Subject: [PATCH 12/15] fix(book-browser): correct mobile grid card size calculation and reduce gap --- .../book-browser/book-browser.component.scss | 2 +- .../book-browser/book-browser.component.ts | 30 +++++++++---------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.scss b/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.scss index 30f15bcb5..a0e30e8c3 100644 --- a/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.scss +++ b/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.scss @@ -333,7 +333,7 @@ // Mobile: fixed 2 or 3 columns based on phone width @media (max-width: 767px) { - gap: 1rem; + gap: 0.5rem; padding: 0 0.5rem; } } diff --git a/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.ts b/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.ts index 3a84fa53f..7b99c2630 100644 --- a/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.ts +++ b/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.ts @@ -86,7 +86,7 @@ export enum EntityType { ] }) export class BookBrowserComponent implements OnInit, AfterViewInit { - // Public injected services (used in template) + protected userService = inject(UserService); protected coverScalePreferenceService = inject(CoverScalePreferenceService); protected columnPreferenceService = inject(TableColumnPreferenceService); @@ -97,7 +97,6 @@ export class BookBrowserComponent implements OnInit, AfterViewInit { protected bookCardOverlayPreferenceService = inject(BookCardOverlayPreferenceService); protected bookSelectionService = inject(BookSelectionService); - // Private injected services private activatedRoute = inject(ActivatedRoute); private messageService = inject(MessageService); private bookService = inject(BookService); @@ -112,7 +111,6 @@ export class BookBrowserComponent implements OnInit, AfterViewInit { private filterOrchestrationService = inject(BookFilterOrchestrationService); private localStorageService = inject(LocalStorageService); - // Observables bookState$: Observable | undefined; entity$: Observable | undefined; entityType$: Observable | undefined; @@ -121,7 +119,6 @@ export class BookBrowserComponent implements OnInit, AfterViewInit { selectedFilterMode = new BehaviorSubject('and'); protected resetFilterSubject = new Subject(); - // State parsedFilters: Record = {}; entity: Library | Shelf | MagicShelf | null = null; entityType: EntityType | undefined; @@ -142,9 +139,10 @@ export class BookBrowserComponent implements OnInit, AfterViewInit { mobileColumnCount = 3; private readonly MOBILE_BREAKPOINT = 768; - private readonly CARD_ASPECT_RATIO = 7 / 5; // height / width (from aspect-ratio: 5/7) - private readonly MOBILE_GAP = 16; // 1rem in px - private readonly MOBILE_PADDING = 16; // 0.5rem * 2 sides + private readonly CARD_ASPECT_RATIO = 7 / 5; + private readonly MOBILE_GAP = 8; + private readonly MOBILE_PADDING = 48; + private readonly MOBILE_TITLE_BAR_HEIGHT = 32; private readonly MOBILE_COLUMNS_STORAGE_KEY = 'mobileColumnsPreference'; private settingFiltersFromUrl = false; @@ -174,11 +172,11 @@ export class BookBrowserComponent implements OnInit, AfterViewInit { get mobileCardSize(): { width: number; height: number } { const columns = this.mobileColumnCount; const totalGaps = (columns - 1) * this.MOBILE_GAP; - const totalPadding = this.MOBILE_PADDING * 2; - const availableWidth = this.screenWidth - totalGaps - totalPadding; + const availableWidth = this.screenWidth - totalGaps - this.MOBILE_PADDING; const cardWidth = Math.floor(availableWidth / columns); - const cardHeight = Math.floor(cardWidth * this.CARD_ASPECT_RATIO); - return { width: cardWidth, height: cardHeight }; + const coverHeight = Math.floor(cardWidth * this.CARD_ASPECT_RATIO); + const cardHeight = coverHeight + this.MOBILE_TITLE_BAR_HEIGHT; + return {width: cardWidth, height: cardHeight}; } get selectedBooks(): Set { @@ -348,7 +346,7 @@ export class BookBrowserComponent implements OnInit, AfterViewInit { user.user?.userSettings?.filterMode ?? 'and' ); - // Apply filter mode + if (parseResult.filterMode !== this.selectedFilterMode.getValue()) { this.selectedFilterMode.next(parseResult.filterMode); if (this.bookFilterComponent) { @@ -360,7 +358,7 @@ export class BookBrowserComponent implements OnInit, AfterViewInit { this.showFilter = value; }); - // Apply filters + this.currentFilterLabel = 'All Books'; const filterParams = queryParamMap.get('filter'); @@ -386,13 +384,13 @@ export class BookBrowserComponent implements OnInit, AfterViewInit { this.parsedFilters = parseResult.filters; - // Apply preferences + this.entityViewPreferences = user.user?.userSettings?.entityViewPreferences; this.coverScalePreferenceService.initScaleValue(this.coverScalePreferenceService.scaleFactor); this.columnPreferenceService.initPreferences(user.user?.userSettings?.tableColumnPreference); this.visibleColumns = this.columnPreferenceService.visibleColumns; - // Apply sort + this.bookSorter.selectedSort = parseResult.sortOption; this.currentViewMode = parseResult.viewMode; this.bookSorter.updateSortOptions(); @@ -403,7 +401,7 @@ export class BookBrowserComponent implements OnInit, AfterViewInit { this.applySortOption(this.bookSorter.selectedSort); } - // Sync query params + this.queryParamsService.syncQueryParams( this.currentViewMode!, this.bookSorter.selectedSort, From a45a50b383bc0664291e133b0cadffee7e55268a Mon Sep 17 00:00:00 2001 From: ACX <8075870+acx10@users.noreply.github.com> Date: Fri, 23 Jan 2026 23:18:07 -0700 Subject: [PATCH 13/15] feat(book-browser): preserve scroll position when navigating back from book details (#2449) --- .../src/app/core/custom-reuse-strategy.ts | 71 ++++++++++++++----- .../book-browser-scroll.service.ts | 25 +++++++ .../book-browser/book-browser.component.ts | 44 ++++++++++-- 3 files changed, 119 insertions(+), 21 deletions(-) create mode 100644 booklore-ui/src/app/features/book/components/book-browser/book-browser-scroll.service.ts diff --git a/booklore-ui/src/app/core/custom-reuse-strategy.ts b/booklore-ui/src/app/core/custom-reuse-strategy.ts index 7032a6281..f738f54c4 100644 --- a/booklore-ui/src/app/core/custom-reuse-strategy.ts +++ b/booklore-ui/src/app/core/custom-reuse-strategy.ts @@ -1,39 +1,78 @@ -import { Injectable } from '@angular/core'; -import { ActivatedRouteSnapshot, DetachedRouteHandle, RouteReuseStrategy } from '@angular/router'; +import {inject, Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, DetachedRouteHandle, RouteReuseStrategy} from '@angular/router'; +import {BookBrowserScrollService} from '../features/book/components/book-browser/book-browser-scroll.service'; @Injectable({ providedIn: 'root', }) export class CustomReuseStrategy implements RouteReuseStrategy { private storedRoutes = new Map(); + private scrollService = inject(BookBrowserScrollService); - // Only detach the route if it's for the book details page + private readonly BOOK_BROWSER_PATHS = [ + 'all-books', + 'unshelved-books', + 'library/:libraryId/books', + 'shelf/:shelfId/books', + 'magic-shelf/:magicShelfId/books' + ]; + + private readonly BOOK_DETAILS_PATH = 'book/:bookId'; + + private getRouteKey(route: ActivatedRouteSnapshot): string { + const path = route.routeConfig?.path || ''; + return this.scrollService.createKey(path, route.params); + } + + private isBookBrowserRoute(route: ActivatedRouteSnapshot): boolean { + const path = route.routeConfig?.path; + return this.BOOK_BROWSER_PATHS.includes(path || ''); + } + + private isBookDetailsRoute(route: ActivatedRouteSnapshot): boolean { + return route.routeConfig?.path === this.BOOK_DETAILS_PATH; + } + shouldDetach(route: ActivatedRouteSnapshot): boolean { - return route.routeConfig?.path === 'book/:id'; // Match the path of the route you want to reuse + return this.isBookBrowserRoute(route); } - // Store the route component instance when detaching store(route: ActivatedRouteSnapshot, handle: DetachedRouteHandle | null): void { - if (handle) { - // Save the handle if we are detaching this route - this.storedRoutes.set(route.routeConfig?.path || '', handle); + if (handle && this.isBookBrowserRoute(route)) { + const key = this.getRouteKey(route); + this.storedRoutes.set(key, handle); } } - // Check if we should attach the route (reuse it) when navigating back to it shouldAttach(route: ActivatedRouteSnapshot): boolean { - // Attach the route only if there's a stored instance for this route - return !!this.storedRoutes.get(route.routeConfig?.path || ''); + if (!this.isBookBrowserRoute(route)) { + return false; + } + const key = this.getRouteKey(route); + return this.storedRoutes.has(key); } - // Retrieve the stored route component instance retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle | null { - return this.storedRoutes.get(route.routeConfig?.path || '') || null; + const key = this.getRouteKey(route); + const handle = this.storedRoutes.get(key) || null; + + if (handle) { + const savedPosition = this.scrollService.getPosition(key); + if (savedPosition !== undefined) { + setTimeout(() => { + const scrollElement = document.querySelector('.virtual-scroller'); + if (scrollElement) { + (scrollElement as HTMLElement).scrollTop = savedPosition; + } + }, 0); + } + } + + return handle; } - // Determine if the route should be reused based on its configuration shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean { - // Reuse the route if the path and parameters match - return future.routeConfig === curr.routeConfig && future.params['id'] === curr.params['id']; + return future.routeConfig === curr.routeConfig && + JSON.stringify(future.params) === JSON.stringify(curr.params); } } diff --git a/booklore-ui/src/app/features/book/components/book-browser/book-browser-scroll.service.ts b/booklore-ui/src/app/features/book/components/book-browser/book-browser-scroll.service.ts new file mode 100644 index 000000000..244769107 --- /dev/null +++ b/booklore-ui/src/app/features/book/components/book-browser/book-browser-scroll.service.ts @@ -0,0 +1,25 @@ +import {Injectable} from '@angular/core'; + +@Injectable({ + providedIn: 'root' +}) +export class BookBrowserScrollService { + private scrollPositions = new Map(); + + savePosition(key: string, position: number): void { + this.scrollPositions.set(key, position); + } + + getPosition(key: string): number | undefined { + return this.scrollPositions.get(key); + } + + clearPosition(key: string): void { + this.scrollPositions.delete(key); + } + + createKey(path: string, params: Record): string { + const paramValues = Object.values(params).join('-'); + return paramValues ? `${path}:${paramValues}` : path; + } +} diff --git a/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.ts b/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.ts index 7b99c2630..524f9b364 100644 --- a/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.ts +++ b/booklore-ui/src/app/features/book/components/book-browser/book-browser.component.ts @@ -1,9 +1,9 @@ -import {AfterViewInit, Component, HostListener, inject, OnInit, ViewChild} from '@angular/core'; -import {ActivatedRoute} from '@angular/router'; +import {AfterViewInit, Component, HostListener, inject, OnDestroy, OnInit, ViewChild} from '@angular/core'; +import {ActivatedRoute, NavigationStart, Router} from '@angular/router'; import {ConfirmationService, MenuItem, MessageService, PrimeTemplate} from 'primeng/api'; import {PageTitleService} from '../../../../shared/service/page-title.service'; import {BookService} from '../../service/book.service'; -import {debounceTime, filter, map, switchMap} from 'rxjs/operators'; +import {debounceTime, filter, map, switchMap, takeUntil} from 'rxjs/operators'; import {BehaviorSubject, combineLatest, finalize, Observable, of, Subject} from 'rxjs'; import {DynamicDialogRef} from 'primeng/dynamicdialog'; import {Library} from '../../model/library.model'; @@ -16,7 +16,7 @@ import {BookTableComponent} from './book-table/book-table.component'; import {animate, style, transition, trigger} from '@angular/animations'; import {Button} from 'primeng/button'; import {AsyncPipe, NgClass, NgStyle} from '@angular/common'; -import {VirtualScrollerModule} from '@iharbeck/ngx-virtual-scroller'; +import {VirtualScrollerComponent, VirtualScrollerModule} from '@iharbeck/ngx-virtual-scroller'; import {BookCardComponent} from './book-card/book-card.component'; import {ProgressSpinner} from 'primeng/progressspinner'; import {Menu} from 'primeng/menu'; @@ -52,6 +52,7 @@ import {BookSelectionService, CheckboxClickEvent} from './book-selection.service import {BookBrowserQueryParamsService, VIEW_MODES} from './book-browser-query-params.service'; import {BookBrowserEntityService} from './book-browser-entity.service'; import {BookFilterOrchestrationService} from './book-filter-orchestration.service'; +import {BookBrowserScrollService} from './book-browser-scroll.service'; export enum EntityType { LIBRARY = 'Library', @@ -85,7 +86,7 @@ export enum EntityType { ]) ] }) -export class BookBrowserComponent implements OnInit, AfterViewInit { +export class BookBrowserComponent implements OnInit, AfterViewInit, OnDestroy { protected userService = inject(UserService); protected coverScalePreferenceService = inject(CoverScalePreferenceService); @@ -98,6 +99,7 @@ export class BookBrowserComponent implements OnInit, AfterViewInit { protected bookSelectionService = inject(BookSelectionService); private activatedRoute = inject(ActivatedRoute); + private router = inject(Router); private messageService = inject(MessageService); private bookService = inject(BookService); private dialogHelperService = inject(BookDialogHelperService); @@ -110,6 +112,7 @@ export class BookBrowserComponent implements OnInit, AfterViewInit { private entityService = inject(BookBrowserEntityService); private filterOrchestrationService = inject(BookFilterOrchestrationService); private localStorageService = inject(LocalStorageService); + private scrollService = inject(BookBrowserScrollService); bookState$: Observable | undefined; entity$: Observable | undefined; @@ -146,6 +149,7 @@ export class BookBrowserComponent implements OnInit, AfterViewInit { private readonly MOBILE_COLUMNS_STORAGE_KEY = 'mobileColumnsPreference'; private settingFiltersFromUrl = false; + private destroy$ = new Subject(); protected metadataMenuItems: MenuItem[] | undefined; protected bulkReadActionsMenuItems: MenuItem[] | undefined; @@ -159,6 +163,8 @@ export class BookBrowserComponent implements OnInit, AfterViewInit { bookTableComponent!: BookTableComponent; @ViewChild(BookFilterComponent, {static: false}) bookFilterComponent!: BookFilterComponent; + @ViewChild('scroll') + virtualScroller: VirtualScrollerComponent | undefined; @HostListener('window:resize') onResize(): void { @@ -257,6 +263,7 @@ export class BookBrowserComponent implements OnInit, AfterViewInit { this.setupUserStateSubscription(); this.setupQueryParamSubscription(); this.setupSearchTermSubscription(); + this.setupScrollPositionTracking(); } ngAfterViewInit(): void { @@ -267,6 +274,33 @@ export class BookBrowserComponent implements OnInit, AfterViewInit { } } + ngOnDestroy(): void { + this.destroy$.next(); + this.destroy$.complete(); + } + + private getScrollPositionKey(): string { + const path = this.activatedRoute.snapshot.routeConfig?.path ?? ''; + return this.scrollService.createKey(path, this.activatedRoute.snapshot.params); + } + + private setupScrollPositionTracking(): void { + this.router.events.pipe( + filter(event => event instanceof NavigationStart), + takeUntil(this.destroy$) + ).subscribe(() => { + this.saveScrollPosition(); + }); + } + + private saveScrollPosition(): void { + if (this.virtualScroller?.viewPortInfo) { + const key = this.getScrollPositionKey(); + const position = this.virtualScroller.viewPortInfo.scrollStartPosition ?? 0; + this.scrollService.savePosition(key, position); + } + } + private initializeEntityRouting(): void { const currentPath = this.activatedRoute.snapshot.routeConfig?.path; From a1ff5ee5195206f3e17d35933e80b74dbe2880c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Sz=C3=BCcs?= <127139797+balazs-szucs@users.noreply.github.com> Date: Sat, 24 Jan 2026 17:35:32 +0100 Subject: [PATCH 14/15] feat(themes): add AMOLED theme with distinct light and dark color schemes (#2457) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Balázs Szücs --- .../features/readers/ebook-reader/state/themes.constant.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/booklore-ui/src/app/features/readers/ebook-reader/state/themes.constant.ts b/booklore-ui/src/app/features/readers/ebook-reader/state/themes.constant.ts index 37bef3133..1df0e9812 100644 --- a/booklore-ui/src/app/features/readers/ebook-reader/state/themes.constant.ts +++ b/booklore-ui/src/app/features/readers/ebook-reader/state/themes.constant.ts @@ -75,4 +75,9 @@ export const themes: Theme[] = [ light: {fg: '#4a148c', bg: '#f3e5f5', link: '#7b1fa2'}, dark: {fg: '#c7b6dd', bg: '#3a3150', link: '#b39ddb'}, }, + { + name: 'amoled', label: 'AMOLED', + light: {fg: '#000000', bg: '#ffffff', link: '#0066cc'}, + dark: {fg: '#ffffff', bg: '#000000', link: '#77bbee'}, + }, ]; From c23e38b5a588a283884baf126ea7a56d33bb7be3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Sz=C3=BCcs?= <127139797+balazs-szucs@users.noreply.github.com> Date: Sat, 24 Jan 2026 17:36:07 +0100 Subject: [PATCH 15/15] feat(dashboard-settings): update sort field options for Surname, and Personal Rating (#2456) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Balázs Szücs --- .../dashboard-settings/dashboard-settings.component.ts | 6 +++--- .../view-preferences/view-preferences.component.ts | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/booklore-ui/src/app/features/dashboard/components/dashboard-settings/dashboard-settings.component.ts b/booklore-ui/src/app/features/dashboard/components/dashboard-settings/dashboard-settings.component.ts index 1484254f5..d5adb1702 100644 --- a/booklore-ui/src/app/features/dashboard/components/dashboard-settings/dashboard-settings.component.ts +++ b/booklore-ui/src/app/features/dashboard/components/dashboard-settings/dashboard-settings.component.ts @@ -7,7 +7,6 @@ import {CheckboxModule} from 'primeng/checkbox'; import {InputTextModule} from 'primeng/inputtext'; import {SelectModule} from 'primeng/select'; import {InputNumberModule} from 'primeng/inputnumber'; -import {SortDirection} from "../../../book/model/sort.model"; import {DashboardConfig, ScrollerConfig, ScrollerType} from '../../models/dashboard-config.model'; import {DashboardConfigService} from '../../services/dashboard-config.service'; import {MagicShelfService} from '../../../magic-shelf/service/magic-shelf.service'; @@ -57,10 +56,11 @@ export class DashboardSettingsComponent implements OnInit { sortFieldOptions = [ {label: 'Title', value: 'title'}, {label: 'Title + Series', value: 'titleSeries'}, - {label: 'File Name', field: 'fileName'}, + {label: 'File Name', value: 'fileName'}, {label: 'Date Added', value: 'addedOn'}, {label: 'Author', value: 'author'}, - {label: 'Author + Series', field: 'authorSeries'}, + {label: 'Author (Surname)', value: 'authorSurnameVorname'}, + {label: 'Author + Series', value: 'authorSeries'}, {label: 'Personal Rating', value: 'personalRating'}, {label: 'Publisher', value: 'publisher'}, {label: 'Published Date', value: 'publishedDate'}, diff --git a/booklore-ui/src/app/features/settings/view-preferences-parent/view-preferences/view-preferences.component.ts b/booklore-ui/src/app/features/settings/view-preferences-parent/view-preferences/view-preferences.component.ts index 2fcc08211..7dee71bf4 100644 --- a/booklore-ui/src/app/features/settings/view-preferences-parent/view-preferences/view-preferences.component.ts +++ b/booklore-ui/src/app/features/settings/view-preferences-parent/view-preferences/view-preferences.component.ts @@ -36,8 +36,10 @@ export class ViewPreferencesComponent implements OnInit, OnDestroy { {label: 'Title + Series', field: 'titleSeries'}, {label: 'File Name', field: 'fileName'}, {label: 'Author', field: 'author'}, + {label: 'Author (Surname)', field: 'authorSurnameVorname'}, {label: 'Author + Series', field: 'authorSeries'}, {label: 'Last Read', field: 'lastReadTime'}, + {label: 'Personal Rating', field: 'personalRating'}, {label: 'Added On', field: 'addedOn'}, {label: 'File Size', field: 'fileSizeKb'}, {label: 'Locked', field: 'locked'},