From 15e6b94cbfb97456964f8704324a527a29f258a8 Mon Sep 17 00:00:00 2001 From: Mattias Thall Date: Wed, 27 May 2026 00:15:57 +0200 Subject: [PATCH] Expand taste profile: show up to 60 tags with score bars Top 10 shown as variable-size tag cloud, all tags below as a two-column bar chart. Backend limit raised from 20 to 60. Co-Authored-By: Claude Sonnet 4.6 --- backend/routers/stats.py | 2 +- frontend/src/pages/Stats.jsx | 96 +++++++++++++++++++++++++----------- 2 files changed, 67 insertions(+), 31 deletions(-) diff --git a/backend/routers/stats.py b/backend/routers/stats.py index a6c24ab..06b70b3 100644 --- a/backend/routers/stats.py +++ b/backend/routers/stats.py @@ -114,7 +114,7 @@ def get_stats( SELECT tag, score FROM user_tag_affinity WHERE user_id = :uid AND score > 0 ORDER BY score DESC - LIMIT 20 + LIMIT 60 """), {"uid": uid}, ).mappings().all() diff --git a/frontend/src/pages/Stats.jsx b/frontend/src/pages/Stats.jsx index 51cc9b1..306bd95 100644 --- a/frontend/src/pages/Stats.jsx +++ b/frontend/src/pages/Stats.jsx @@ -62,8 +62,8 @@ export default function Stats() { const maxDayCount = Math.max(...days.map(d => dailyMap[d]?.count || 0), 1); const maxCatCount = Math.max(...(data.top_categories || []).map(c => c.watch_count || 0), 1); - const topTags = (data.taste_profile || []).slice(0, 12); - const maxTagScore = Math.max(...topTags.map(t => t.score || 0), 1); + const allTags = data.taste_profile || []; + const maxTagScore = Math.max(...allTags.map(t => t.score || 0), 1); return (
@@ -235,39 +235,75 @@ export default function Stats() { })()} {/* Taste profile */} - {topTags.length > 0 && ( -
+ {allTags.length > 0 && ( +

Taste profile

-

built from your watches, likes and bookmarks

+

{allTags.length} interests · built from watches, likes & bookmarks

-
- {topTags.map(t => { - const intensity = t.score / maxTagScore; - return ( - - {t.tag} - - - ); - })} + {t.tag} + + + ); + })} +
+ + {/* All tags as score bars */} + {allTags.length > 10 && ( +
+

All interests

+
+ {allTags.map(t => { + const pct = (t.score / maxTagScore) * 100; + const intensity = t.score / maxTagScore; + return ( +
+ {t.tag} +
+
+
+ +
+ ); + })} +
+
+ )}
)}