From e3915b63e67fb6e1c3945dd09ebe1d2ce569f85e Mon Sep 17 00:00:00 2001 From: BoulderBadgeDad Date: Thu, 25 Jun 2026 13:57:34 -0700 Subject: [PATCH] Library cards: in-card badges no longer trigger artist-detail navigation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The card is an link and the shell's capture-phase link handler navigated to artist-detail before the grid's bubble-phase badge handler could preventDefault — so clicking the watchlist eye or a source badge opened the detail page (and the badge's own link too). The shell handler now bails when the click lands on an in-card control (.source-card-icon or [data-no-card-nav]), letting the badge do only its own thing. --- webui/static/shell-bridge.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webui/static/shell-bridge.js b/webui/static/shell-bridge.js index 1f93f2c3..6263b6c8 100644 --- a/webui/static/shell-bridge.js +++ b/webui/static/shell-bridge.js @@ -211,6 +211,11 @@ function _handleShellLinkClick(event) { if (!anchor || (anchor.target && anchor.target !== '_self')) return; if (anchor.hasAttribute('download')) return; + // In-card controls (source/watchlist badges, etc.) handle their OWN click — don't let + // this capture-phase handler hijack it into the surrounding card's navigation. Their + // bubble-phase handlers preventDefault, but that runs after capture, so we opt out here. + if (event.target?.closest?.('.source-card-icon, [data-no-card-nav]')) return; + const href = anchor.getAttribute('href'); if (!href || href === '#' || href.startsWith('javascript:')) return;