nandi/gleanpublic⑂ Fork 0
⑂ 973a7c3
Commits
⬇ Clone ▾
git clone https://git.rickub.com/nandi/glean.git
git clone ssh://git@rickub.com/nandi/glean.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Improve dashboard UI and truncate trending if too longUnverified

Julien Robert committed 2026-04-21T17:47:01+02:00 Browse files
973a7c3 parent: aff0b5f
modified internal/tmpl/dashboard.html +42 -31
@@ -1,53 +1,64 @@
11 {{define "dashboard.html"}}
22 <div class="flex items-center justify-between mb-2">
33 <h1 class="text-2xl font-bold text-spot-text">Dashboard</h1>
4+ {{if gt .SubscriptionCount 0}}
45 <div class="flex gap-4 text-sm">
56 <span class="text-spot-secondary"><strong class="text-spot-text">{{.UnreadCount}}</strong> unread</span>
67 <span class="text-spot-secondary"><strong class="text-spot-text">{{.SubscriptionCount}}</strong> feeds</span>
78 </div>
9+ {{end}}
810 </div>
11+<p class="text-sm text-spot-secondary mb-6">
12+ {{if eq .SubscriptionCount 0}}Get started by subscribing to RSS feeds.{{else}}Your personalized feed, based on your social graph.{{end}}
13+</p>
914
1015 {{if eq .SubscriptionCount 0}}
11-<div class="bg-spot-surface rounded-xl py-12 px-6 text-center mb-6">
12- <div class="w-16 h-16 rounded-full bg-spot-hover flex items-center justify-center mb-4 mx-auto">
13- <svg class="w-8 h-8 text-spot-muted" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12.75 19.5v-15m0 0l-6.75 6.75M12.75 4.5l6.75 6.75"/></svg>
14- </div>
15- <h2 class="text-lg font-semibold text-spot-text mb-2">Add your first feed</h2>
16- <p class="text-sm text-spot-secondary mb-6">Subscribe to RSS feeds to start building your personalized reading experience.</p>
17- <a href="/feeds" class="inline-flex items-center gap-2 px-5 py-2.5 rounded-lg bg-spot-green text-white text-sm font-medium hover:opacity-90 transition">
18- <svg class="w-4 h-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15"/></svg>
19- Add feeds
20- </a>
21-</div>
16+<div id="new-articles-poll" hx-get="/articles/new-count?since={{.Now.Unix}}&return=/dashboard" hx-trigger="every 30s" hx-swap="innerHTML"></div>
2217
23-{{if .GlobalTrending}}
24-<div class="mb-6">
25- <div class="flex items-center justify-between mb-3">
26- <h2 class="text-lg font-semibold text-spot-text">Trending</h2>
27- <a href="/trending" class="text-xs text-spot-secondary hover:text-spot-green uppercase tracking-button transition">See all</a>
28- </div>
29- <div class="space-y-3">
30- {{range .GlobalTrending}}
31- {{template "trending-card.html" .}}
18+<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
19+ <div class="lg:col-span-2 space-y-6">
20+ <div class="bg-spot-surface rounded-xl py-12 px-6 text-center">
21+ <div class="w-16 h-16 rounded-full bg-spot-hover flex items-center justify-center mb-4 mx-auto">
22+ <svg class="w-8 h-8 text-spot-muted" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12.75 19.5v-15m0 0l-6.75 6.75M12.75 4.5l6.75 6.75"/></svg>
23+ </div>
24+ <h2 class="text-lg font-semibold text-spot-text mb-2">Add your first feed</h2>
25+ <p class="text-sm text-spot-secondary mb-6">Subscribe to RSS feeds to start building your personalized reading experience.</p>
26+ <a href="/feeds" class="inline-flex items-center gap-2 px-5 py-2.5 rounded-lg bg-spot-green text-white text-sm font-medium hover:opacity-90 transition">
27+ <svg class="w-4 h-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15"/></svg>
28+ Add feeds
29+ </a>
30+ </div>
31+
32+ {{if .GlobalTrending}}
33+ <div>
34+ <div class="flex items-center justify-between mb-3">
35+ <h2 class="text-lg font-semibold text-spot-text">Trending</h2>
36+ <a href="/trending" class="text-xs text-spot-secondary hover:text-spot-green uppercase tracking-button transition">See all</a>
37+ </div>
38+ <div class="space-y-3">
39+ {{range .GlobalTrending}}
40+ {{template "trending-card.html" .}}
41+ {{end}}
42+ </div>
43+ </div>
3244 {{end}}
3345 </div>
34-</div>
35-{{end}}
3646
37-{{if .FeedRecommendations}}
38-<div>
39- <h2 class="text-lg font-semibold text-spot-text mb-3">Popular feeds to get started</h2>
40- <div class="grid grid-cols-1 md:grid-cols-2 gap-3">
41- {{range .FeedRecommendations}}
42- {{template "recommendation-card.html" (dict "title" .Title "feed_url" .FeedURL "description" .Description "favicon_url" .FaviconURL "subscriber_count" .SubscriberCount "CSRFToken" $.CSRFToken)}}
47+ <div class="space-y-8">
48+ {{if .FeedRecommendations}}
49+ <div>
50+ <h2 class="text-lg font-semibold text-spot-text mb-4">Popular feeds to get started</h2>
51+ <div class="space-y-3">
52+ {{range .FeedRecommendations}}
53+ {{template "recommendation-card.html" (dict "title" .Title "feed_url" .FeedURL "description" .Description "favicon_url" .FaviconURL "subscriber_count" .SubscriberCount "CSRFToken" $.CSRFToken)}}
54+ {{end}}
55+ </div>
56+ </div>
4357 {{end}}
4458 </div>
4559 </div>
46-{{end}}
4760
4861 {{else}}
49-<p class="text-sm text-spot-secondary mb-6">Your personalized feed, based on your social graph.</p>
50-
5162 <div id="new-articles-poll" hx-get="/articles/new-count?since={{.Now.Unix}}&return=/dashboard" hx-trigger="every 30s" hx-swap="innerHTML"></div>
5263
5364 <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
@@ -1,53 +1,64 @@
1 {{define "dashboard.html"}}1 {{define "dashboard.html"}}
2 <div class="flex items-center justify-between mb-2">2 <div class="flex items-center justify-between mb-2">
3 <h1 class="text-2xl font-bold text-spot-text">Dashboard</h1>3 <h1 class="text-2xl font-bold text-spot-text">Dashboard</h1>
4+ {{if gt .SubscriptionCount 0}}
4 <div class="flex gap-4 text-sm">5 <div class="flex gap-4 text-sm">
5 <span class="text-spot-secondary"><strong class="text-spot-text">{{.UnreadCount}}</strong> unread</span>6 <span class="text-spot-secondary"><strong class="text-spot-text">{{.UnreadCount}}</strong> unread</span>
6 <span class="text-spot-secondary"><strong class="text-spot-text">{{.SubscriptionCount}}</strong> feeds</span>7 <span class="text-spot-secondary"><strong class="text-spot-text">{{.SubscriptionCount}}</strong> feeds</span>
7 </div>8 </div>
9+ {{end}}
8 </div>10 </div>
11+<p class="text-sm text-spot-secondary mb-6">
12+ {{if eq .SubscriptionCount 0}}Get started by subscribing to RSS feeds.{{else}}Your personalized feed, based on your social graph.{{end}}
13+</p>
9 14
10 {{if eq .SubscriptionCount 0}}15 {{if eq .SubscriptionCount 0}}
11-<div class="bg-spot-surface rounded-xl py-12 px-6 text-center mb-6">16+<div id="new-articles-poll" hx-get="/articles/new-count?since={{.Now.Unix}}&return=/dashboard" hx-trigger="every 30s" hx-swap="innerHTML"></div>
12- <div class="w-16 h-16 rounded-full bg-spot-hover flex items-center justify-center mb-4 mx-auto">
13- <svg class="w-8 h-8 text-spot-muted" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12.75 19.5v-15m0 0l-6.75 6.75M12.75 4.5l6.75 6.75"/></svg>
14- </div>
15- <h2 class="text-lg font-semibold text-spot-text mb-2">Add your first feed</h2>
16- <p class="text-sm text-spot-secondary mb-6">Subscribe to RSS feeds to start building your personalized reading experience.</p>
17- <a href="/feeds" class="inline-flex items-center gap-2 px-5 py-2.5 rounded-lg bg-spot-green text-white text-sm font-medium hover:opacity-90 transition">
18- <svg class="w-4 h-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15"/></svg>
19- Add feeds
20- </a>
21-</div>
22 17
23-{{if .GlobalTrending}}18+<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
24-<div class="mb-6">19+ <div class="lg:col-span-2 space-y-6">
25- <div class="flex items-center justify-between mb-3">20+ <div class="bg-spot-surface rounded-xl py-12 px-6 text-center">
26- <h2 class="text-lg font-semibold text-spot-text">Trending</h2>21+ <div class="w-16 h-16 rounded-full bg-spot-hover flex items-center justify-center mb-4 mx-auto">
27- <a href="/trending" class="text-xs text-spot-secondary hover:text-spot-green uppercase tracking-button transition">See all</a>22+ <svg class="w-8 h-8 text-spot-muted" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12.75 19.5v-15m0 0l-6.75 6.75M12.75 4.5l6.75 6.75"/></svg>
28- </div>23+ </div>
29- <div class="space-y-3">24+ <h2 class="text-lg font-semibold text-spot-text mb-2">Add your first feed</h2>
30- {{range .GlobalTrending}}25+ <p class="text-sm text-spot-secondary mb-6">Subscribe to RSS feeds to start building your personalized reading experience.</p>
31- {{template "trending-card.html" .}}26+ <a href="/feeds" class="inline-flex items-center gap-2 px-5 py-2.5 rounded-lg bg-spot-green text-white text-sm font-medium hover:opacity-90 transition">
27+ <svg class="w-4 h-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15"/></svg>
28+ Add feeds
29+ </a>
30+ </div>
31+
32+ {{if .GlobalTrending}}
33+ <div>
34+ <div class="flex items-center justify-between mb-3">
35+ <h2 class="text-lg font-semibold text-spot-text">Trending</h2>
36+ <a href="/trending" class="text-xs text-spot-secondary hover:text-spot-green uppercase tracking-button transition">See all</a>
37+ </div>
38+ <div class="space-y-3">
39+ {{range .GlobalTrending}}
40+ {{template "trending-card.html" .}}
41+ {{end}}
42+ </div>
43+ </div>
32 {{end}}44 {{end}}
33 </div>45 </div>
34-</div>
35-{{end}}
36 46
37-{{if .FeedRecommendations}}47+ <div class="space-y-8">
38-<div>48+ {{if .FeedRecommendations}}
39- <h2 class="text-lg font-semibold text-spot-text mb-3">Popular feeds to get started</h2>49+ <div>
40- <div class="grid grid-cols-1 md:grid-cols-2 gap-3">50+ <h2 class="text-lg font-semibold text-spot-text mb-4">Popular feeds to get started</h2>
41- {{range .FeedRecommendations}}51+ <div class="space-y-3">
42- {{template "recommendation-card.html" (dict "title" .Title "feed_url" .FeedURL "description" .Description "favicon_url" .FaviconURL "subscriber_count" .SubscriberCount "CSRFToken" $.CSRFToken)}}52+ {{range .FeedRecommendations}}
53+ {{template "recommendation-card.html" (dict "title" .Title "feed_url" .FeedURL "description" .Description "favicon_url" .FaviconURL "subscriber_count" .SubscriberCount "CSRFToken" $.CSRFToken)}}
54+ {{end}}
55+ </div>
56+ </div>
43 {{end}}57 {{end}}
44 </div>58 </div>
45 </div>59 </div>
46-{{end}}
47 60
48 {{else}}61 {{else}}
49-<p class="text-sm text-spot-secondary mb-6">Your personalized feed, based on your social graph.</p>
50-
51 <div id="new-articles-poll" hx-get="/articles/new-count?since={{.Now.Unix}}&return=/dashboard" hx-trigger="every 30s" hx-swap="innerHTML"></div>62 <div id="new-articles-poll" hx-get="/articles/new-count?since={{.Now.Unix}}&return=/dashboard" hx-trigger="every 30s" hx-swap="innerHTML"></div>
52 63
53 <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">64 <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">