xonecas.io
8356
Wx

www-xonecas-io / commit 2d2d73d

front page lists the topics and shows them on Recent cards (1033)

Co-Authored-By: Claude Opus 5.5

Sean Caetano Martin2026-11-08 2d2d73da56d8ef45700604e110852bd2557cf5d9 parent 9ce7eb9

4 files changed

internal/site/home.go+15−0
@@ -1,6 +1,7 @@
11 package site
22
33 import (
4+ "cmp"
45 "fmt"
56 "slices"
67 "strconv"
@@ -36,6 +37,7 @@ type HomeData struct {
3637 Wall []WallYear
3738 Recent []Recent
3839 Tags []string
40+ Topics []TagCount // used by two projects or more, commonest first
3941 }
4042
4143 // level is the heat of a commit count, 0 to 6.
@@ -93,6 +95,19 @@ func homeData(shown []project.Project, rows []ProjectRow) HomeData {
9395 }
9496 slices.SortStableFunc(d.Recent, func(a, b Recent) int { return strings.Compare(b.P.Last, a.P.Last) })
9597 d.Recent = d.Recent[:min(12, len(d.Recent))]
98+
99+ counts := map[string]int{}
100+ for _, p := range shown {
101+ for _, t := range p.Topics {
102+ counts[t]++
103+ }
104+ }
105+ for t, n := range counts {
106+ if n >= 2 {
107+ d.Topics = append(d.Topics, TagCount{t, n})
108+ }
109+ }
110+ slices.SortFunc(d.Topics, func(a, b TagCount) int { return cmp.Or(b.Count-a.Count, strings.Compare(a.Name, b.Name)) })
96111 return d
97112 }
98113
internal/site/templates/index.html+2−1
@@ -10,6 +10,7 @@
1010 <div class="flex justify-between py-1.5 border-b border-line"><dt>{{index . 0}}</dt><dd class="font-bold">{{index . 1}}</dd></div>{{end}}
1111 </dl>
1212 <div class="flex flex-wrap gap-1 mt-4">{{range .Tags}}<a href="/projects/?tag={{.}}" class="flex no-underline">{{template "tag" .}}</a>{{end}}</div>
13+ <div class="flex flex-wrap gap-1 mt-2">{{range .Topics}}<a href="/projects/?q={{.Name}}" title="{{.Count}} projects" class="flex no-underline">{{template "topic" .Name}}</a>{{end}}</div>
1314 </aside>
1415 <div class="min-w-0">
1516 <div class="flex items-baseline justify-between mb-2"><h2 class="font-bold text-lg">Every month since {{(index .Wall 0).Year}}</h2><span class="text-xs text-soft">one cell = one month of commits</span></div>
@@ -24,7 +25,7 @@
2425 <div class="flex items-center gap-3">{{template "element" (dict "El" .Row.El "Size" "sm")}}<b class="text-lg truncate">{{.P.Name}}</b><span class="ml-auto text-xs text-soft">{{.Row.Lang}}</span></div>
2526 <p class="mt-2 text-sm text-soft line-clamp-2 min-h-10">{{or .P.Description "No description"}}</p>
2627 <div class="grid grid-cols-12 gap-[2px] mt-2">{{range .Strip}}<span class="h-2.5 rounded-[1px] bg-h{{.Heat}}" title="{{.Month}}: {{.Count}}"></span>{{end}}</div>
27- <p class="mt-2 text-xs text-soft">{{.P.Commits}} commits · {{range $i, $t := .P.Tags}}{{if $i}} {{end}}{{$t}}{{end}}</p>
28+ <p class="mt-2 text-xs text-soft">{{.P.Commits}} commits · {{range $i, $t := .P.Tags}}{{if $i}} {{end}}{{$t}}{{end}}{{range .P.Topics}} {{.}}{{end}}</p>
2829 </a>{{end}}
2930 </div>
3031 <p class="mt-4 font-semibold"><a href="/projects/">All {{.Projects}} projects →</a></p>
tickets/1033-new-tags-are-missing-from-the-frontpage.md+30−0
@@ -0,0 +1,30 @@
1+---
2+id: 1033
3+title: new tags are missing from the frontpage
4+type: bug
5+status: review
6+priority: p2
7+created: 2026-11-08T05:06:40Z
8+updated: 2026-11-08T05:12:48Z
9+source: devnote
10+area: site
11+moves: 2026-11-08T05:07:38Z inbox doing drag; 2026-11-08T05:12:48Z doing review agent
12+---
13+
14+## Context
15+
16+Filed from `http://192.168.122.10:8080/`, on `span.inline-flex.items-center.gap-1.5`.
17+
18+> post-AI
19+
20+## Notes
21+
22+- 2026-11-08 05:06Z (agent): Triage: type bug, priority p2, area site. No typos. The front page shows tags in two places, and neither has the topics from 1031: 1) the tag list under the intro (index.html:12) is the 6 structural tags, hard-coded in home.go:62 (HomeData.Tags), each linking to /projects/?tag=; 2) each Recent card's line '{{.P.Commits}} commits · tags' (index.html:27) prints only .P.Tags, not .P.Topics. Open for the user: which topics belong in the list (all 40, or only the commone …
23+
24+- 2026-11-08 05:12Z (agent): Done: the front page now shows the new tags (topics) in two places.
25+
26+ 1. The sidebar: under the 6 tags there is now a block of topic chips, the ones used by 2 or more projects. That's 32 of the 40, most common first (node 23, ai-agent 15, react 14 ... vite 2), ties by name. Each links to /projects/?q=<topic>, like the chips on project pages, and its title shows the count ('23 projects'). I left out topics used by only one project, since a link to a single project isn't much of a browse.
27+ 2. Recent cards: the line under the strip now lists the topics after the tags, e.g. '58 commits · post-AI big frontend backend webrtc websocket react tailwind vite gin sqlite docker'.
28+
29+ Files: home.go (HomeData.Topics as []TagCount, counted from shown projects), templates/index.html.
30+ Checked: go vet and go test pass. In agent-browser at 1440, the 32 links and counts match the 1031 tally, there's no horizontal scroll, and I took a screenshot. Not checked: the phone layout. The sidebar stacks above the wall there, so the topic block makes the page longer before the wall.
tickets/attachments/1033/front page with topics.png+0−0
Binary file, not shown.