Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/git/vole.git

Write over SSH with a registered key:

git clone ssh://git@0.0.0.0:2222/vole.git

A free and open-source forge that lives in your Git repo.

Add the instance-wide activity feed to the home page

b355db72f14756ee4d7e2f503eb254ea552aa72e · Keenan Nemetz · 15d ago · parent 67a308ba

Add the instance-wide activity feed to the home page

The home page now merges every visible repository's derived feed, caps the merged result at 50 events, and names the repository on each row. The repository list moves to a compact sidebar with its own search, and the existing search-results view is unchanged. Events still come from git, the metadata branch, tags, and the queue; private repositories are excluded by the same read filter as the list.

server/web/web.go +31−3

@@ -245,11 +245,39 @@ func (w *Web) IndexPage(rw http.ResponseWriter, r *http.Request) {
245 245 }
246 246 page := w.page(r, "Repositories")
247 247 page.Query = query
248 var events []activityEvent
249 if query == "" {
250 events = w.instanceActivity(visible)
251 }
248 252 w.render(rw, "index", struct {
249 253 Page
250 Repos []index.Entry
251 Query string
252 }{page, visible, query}, 0)
254 Repos []index.Entry
255 Query string
256 Events []activityEvent
257 }{page, visible, query, events}, 0)
258 }
259
260 // instanceActivity merges the visible repositories' feeds. It is intentionally
261 // bounded after the merge: a single-tenant instance has few repositories, and a
262 // per-repository cap would hide a quiet repository's only event.
263 func (w *Web) instanceActivity(entries []index.Entry) []activityEvent {
264 const limit = 50
265 var events []activityEvent
266 for _, e := range entries {
267 m, err := w.Repos.Open(e.Name)
268 if err != nil {
269 continue
270 }
271 for _, ev := range w.repoActivity(m, "", "", "").Events {
272 ev.Repo = m.Name
273 events = append(events, ev)
274 }
275 }
276 sort.SliceStable(events, func(i, j int) bool { return events[i].Time.After(events[j].Time) })
277 if len(events) > limit {
278 events = events[:limit]
279 }
280 return events
253 281 }
254 282
255 283 // open resolves a repository for the viewer, answering 404 when it is missing