From f67232a20b18736c04305af2b563f41782b86303 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Thu, 6 Aug 2026 08:40:06 -0400 Subject: [PATCH] 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. --- internal/handlers/dashboard.go | 1 + web/src/dashboard.ts | 66 ++++++++++++++++++++++------------ web/src/types/api.d.ts | 5 +-- 3 files changed, 47 insertions(+), 25 deletions(-) diff --git a/internal/handlers/dashboard.go b/internal/handlers/dashboard.go index ce221f0..c163d33 100644 --- a/internal/handlers/dashboard.go +++ b/internal/handlers/dashboard.go @@ -65,6 +65,7 @@ func (h *DashboardHandler) GetSections(c *echo.Context) error { } sectionData := BuildSections(sections, libraryID) + sectionData = MarkActiveConflictsSections(c.Request().Context(), h.db, user.ID, sectionData) return c.JSON(http.StatusOK, map[string]interface{}{"sections": sectionData}) } diff --git a/web/src/dashboard.ts b/web/src/dashboard.ts index 8744cf4..170ec3a 100644 --- a/web/src/dashboard.ts +++ b/web/src/dashboard.ts @@ -205,7 +205,8 @@ function renderSectionHTML(section: SectionData): string {