fix(ui): show read action on JS-rendered dashboard cards

The dashboard re-renders its sections client-side (library switch,
refresh, saving settings) via renderBookCard in dashboard.ts, which was
still the old markup with no .book-card-action overlay. So the read
button appeared on the server-rendered cards but vanished as soon as the
dashboard re-rendered, while the bookshelf (always templ-rendered) kept
working.

- Rewrite renderBookCard to match the templ BookCard: detail link plus
  the play/read action overlay, routing to the reader or the detail page
  when the book has an active conflict.
- Add has_conflict to the BookInfo TS type and stamp it in the dashboard
  sections API (GetSections) so client-rendered cards can route correctly.
- Add pointer-events-none / group-hover:pointer-events-auto to the
  client-rendered carousel nav buttons so they no longer swallow hover
  over edge cards, matching the templ fix.
This commit is contained in:
2026-08-06 08:40:06 -04:00
parent 7b465ac97e
commit f67232a20b
3 changed files with 47 additions and 25 deletions
+3 -2
View File
@@ -94,13 +94,14 @@ interface CollectionData {
}
// Matches handlers.BookInfo JSON response (internal/handlers/collections.go:66-71)
// JSON tags: media_item_id, title, author, cover_image_path
// Used in: collections.templ (server-rendered), collections.ts
// JSON tags: media_item_id, title, author, cover_image_path, has_conflict
// Used in: collections.templ (server-rendered), collections.ts, dashboard.ts
interface BookInfo {
media_item_id: string;
title: string;
author: string;
cover_image_path: string;
has_conflict: boolean;
}
// Dashboard type definitions