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 @@ -1433,6 +1433,14 @@ document.addEventListener("DOMContentLoaded", function () {
14331433 window . closeProjectSafe = closeProjectSafe ;
14341434 window . setMainInert = setMainInert ;
14351435
1436+ function updateFavoritesCountBadge ( ) {
1437+ const badge = document . getElementById ( "favoritesCountBadge" ) ;
1438+ if ( ! badge ) return ;
1439+
1440+ const favorites = JSON . parse ( localStorage . getItem ( "favorites" ) || "[]" ) ;
1441+ badge . textContent = `(${ favorites . length } )` ;
1442+ }
1443+
14361444 /* ═══════════════════════════════════════════════════════════════
14371445 WIRE PROJECT CARDS
14381446 ═══════════════════════════════════════════════════════════════ */
@@ -1474,6 +1482,7 @@ document.addEventListener("DOMContentLoaded", function () {
14741482 }
14751483 }
14761484 localStorage . setItem ( "favorites" , JSON . stringify ( favs ) ) ;
1485+ updateFavoritesCountBadge ( ) ;
14771486 } ) ;
14781487
14791488 var cardActions = card . querySelector ( ".card-actions" ) ;
@@ -1542,6 +1551,8 @@ document.addEventListener("DOMContentLoaded", function () {
15421551
15431552 projectCards . forEach ( wireProjectCard ) ;
15441553
1554+ updateFavoritesCountBadge ( ) ;
1555+
15451556 window . updateRecentlyViewed = function ( ) {
15461557 var grid = document . getElementById ( "recentlyViewedGrid" ) ;
15471558 var section = document . getElementById ( "recentlyViewedSection" ) ;
You can’t perform that action at this time.
0 commit comments