From 910d26c5303a2d373783e3affb3d7fc5859edbf1 Mon Sep 17 00:00:00 2001 From: ACX <8075870+acx10@users.noreply.github.com> Date: Thu, 12 Feb 2026 08:28:57 -0700 Subject: [PATCH] feat(ui): add file name column to table view and include filename in search (#2712) --- .../book-browser/book-table/book-table.component.ts | 4 ++++ .../book/components/book-browser/filters/HeaderFilter.ts | 4 +++- .../book-browser/table-column-preference.service.ts | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/booklore-ui/src/app/features/book/components/book-browser/book-table/book-table.component.ts b/booklore-ui/src/app/features/book/components/book-browser/book-table/book-table.component.ts index ed0472db4..de54c07af 100644 --- a/booklore-ui/src/app/features/book/components/book-browser/book-table/book-table.component.ts +++ b/booklore-ui/src/app/features/book/components/book-browser/book-table/book-table.component.ts @@ -63,6 +63,7 @@ export class BookTableComponent implements OnInit, OnDestroy, OnChanges { {field: 'publishedDate', header: 'Published'}, {field: 'lastReadTime', header: 'Last Read'}, {field: 'addedOn', header: 'Added'}, + {field: 'fileName', header: 'File Name'}, {field: 'fileSizeKb', header: 'File Size'}, {field: 'language', header: 'Language'}, {field: 'isbn', header: 'ISBN'}, @@ -284,6 +285,9 @@ export class BookTableComponent implements OnInit, OnDestroy, OnChanges { case 'addedOn': return book.addedOn ? this.datePipe.transform(book.addedOn, 'dd-MMM-yyyy') ?? '' : ''; + case 'fileName': + return book.primaryFile?.fileName ?? ''; + case 'fileSizeKb': return this.formatFileSize(book.fileSizeKb); diff --git a/booklore-ui/src/app/features/book/components/book-browser/filters/HeaderFilter.ts b/booklore-ui/src/app/features/book/components/book-browser/filters/HeaderFilter.ts index bfbb526b4..9c6de5c46 100644 --- a/booklore-ui/src/app/features/book/components/book-browser/filters/HeaderFilter.ts +++ b/booklore-ui/src/app/features/book/components/book-browser/filters/HeaderFilter.ts @@ -40,14 +40,16 @@ export class HeaderFilter implements BookFilter { const categories = book.metadata?.categories || []; const isbn = book.metadata?.isbn10 || ''; const isbn13 = book.metadata?.isbn13 || ''; + const fileName = book.primaryFile?.fileName || ''; const matchesTitle = normalize(title).includes(nTerm); const matchesSeries = normalize(series).includes(nTerm); const matchesAuthor = authors.some(author => normalize(author).includes(nTerm)); const matchesCategory = categories.some(category => normalize(category).includes(nTerm)); const matchesIsbn = normalize(isbn).includes(nTerm) || normalize(isbn13).includes(nTerm); + const matchesFileName = normalize(fileName).includes(nTerm); - return matchesTitle || matchesSeries || matchesAuthor || matchesCategory || matchesIsbn; + return matchesTitle || matchesSeries || matchesAuthor || matchesCategory || matchesIsbn || matchesFileName; }) || null; return {...bookState, books: filteredBooks}; diff --git a/booklore-ui/src/app/features/book/components/book-browser/table-column-preference.service.ts b/booklore-ui/src/app/features/book/components/book-browser/table-column-preference.service.ts index 5716d4218..708fd75fe 100644 --- a/booklore-ui/src/app/features/book/components/book-browser/table-column-preference.service.ts +++ b/booklore-ui/src/app/features/book/components/book-browser/table-column-preference.service.ts @@ -24,6 +24,7 @@ export class TableColumnPreferenceService { {field: 'publishedDate', header: 'Published'}, {field: 'lastReadTime', header: 'Last Read'}, {field: 'addedOn', header: 'Added'}, + {field: 'fileName', header: 'File Name'}, {field: 'fileSizeKb', header: 'File Size'}, {field: 'language', header: 'Language'}, {field: 'isbn', header: 'ISBN'},