File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 150150 </ button >
151151 < button aria-selected ="false " class ="sidebar-tab " data-category ="favorites " role ="tab " tabindex ="-1 ">
152152 < span class ="sidebar-icon "> < svg data-lucide ="star "> </ svg > </ span >
153- < span class ="sidebar-label "> My Favorites</ span >
153+ < span class ="sidebar-label ">
154+ My Favorites
155+ < span id ="favoritesCountBadge "> 0</ span >
156+ </ span >
154157 </ button >
155158 < button aria-selected ="false " class ="sidebar-tab " data-category ="playground " role ="tab " tabindex ="-1 ">
156159 < span class ="sidebar-icon "> < svg data-lucide ="terminal "> </ svg > </ span >
Original file line number Diff line number Diff line change @@ -1425,6 +1425,14 @@ document.addEventListener("DOMContentLoaded", function () {
14251425 window . closeProjectSafe = closeProjectSafe ;
14261426 window . setMainInert = setMainInert ;
14271427
1428+ function updateFavoritesCountBadge ( ) {
1429+ const badge = document . getElementById ( "favoritesCountBadge" ) ;
1430+ if ( ! badge ) return ;
1431+
1432+ const favorites = JSON . parse ( localStorage . getItem ( "favorites" ) || "[]" ) ;
1433+ badge . textContent = `(${ favorites . length } )` ;
1434+ }
1435+
14281436 /* ═══════════════════════════════════════════════════════════════
14291437 WIRE PROJECT CARDS
14301438 ═══════════════════════════════════════════════════════════════ */
@@ -1466,6 +1474,7 @@ document.addEventListener("DOMContentLoaded", function () {
14661474 }
14671475 }
14681476 localStorage . setItem ( "favorites" , JSON . stringify ( favs ) ) ;
1477+ updateFavoritesCountBadge ( ) ;
14691478 } ) ;
14701479
14711480 var cardActions = card . querySelector ( ".card-actions" ) ;
@@ -1534,6 +1543,8 @@ document.addEventListener("DOMContentLoaded", function () {
15341543
15351544 projectCards . forEach ( wireProjectCard ) ;
15361545
1546+ updateFavoritesCountBadge ( ) ;
1547+
15371548 window . updateRecentlyViewed = function ( ) {
15381549 var grid = document . getElementById ( "recentlyViewedGrid" ) ;
15391550 var section = document . getElementById ( "recentlyViewedSection" ) ;
You can’t perform that action at this time.
0 commit comments