feat: add book detail page links from browse pages

Add clickable links to book detail page (/media/:uuid) from:

- Dashboard: BookCard components now link to detail page
  - Changed from data-action pattern to direct <a> tags
  - Removes unused viewBook() function and switch case
  - Follows progressive enhancement (works without JS)

- Collections: Book titles link to detail page
  - Books displayed in collection detail view

- Progress: Book titles link to detail page
  - Progress cards now have clickable title links

All links use direct navigation for better UX and progressive enhancement.
Book detail page can display comprehensive metadata, reading progress,
sync status, and external service links.
This commit is contained in:
2026-03-28 23:54:42 -04:00
parent eb349cbc95
commit a157c546fd
7 changed files with 249 additions and 216 deletions
+8 -8
View File
@@ -351,9 +351,9 @@ function renderBookCard(book: BookInfo): string {
`;
}
function viewBook(bookId: string): void {
console.log("View book:", bookId);
}
// function viewBook(bookId: string): void {
// console.log("View book:", bookId);
// }
async function reloadPage(): Promise<void> {
//Get current library from dropdown
@@ -468,11 +468,11 @@ function initDashboard() {
break;
}
case "view-book": {
const bookId = target.dataset.bookId || actionElem?.dataset.bookId;
if (bookId) viewBook(bookId);
break;
}
// case "view-book": {
// const bookId = target.dataset.bookId || actionElem?.dataset.bookId;
// if (bookId) viewBook(bookId);
// break;
// }
case "reload-page":
reloadPage();