Sign in

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

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

Remove repository tab polling and rename Code to Source

cc7faea36a31373079df8fce68c1bc20a44873a0 · Keenan Nemetz · 3d ago · parent 0a12642f

Remove repository tab polling and rename Code to Source

The tab row no longer polls its open counts, so the /{name}/counts endpoint, its htmx trigger, and the badge animation are gone. The unfocused-window note has been removed while the other live regions still pause.

The Code tab is now Source, served at /{name}/source; links, sitemap entries, markdown tree links, and tests follow the new route.

server/web/page.go −22

@@ -6,7 +6,6 @@ package web
6 6 // admitted the request.
7 7
8 8 import (
9 "net/http"
10 9 "net/url"
11 10 "strings"
12 11
@@ -245,24 +244,6 @@ func (w *Web) siteDeployed(m *repo.Meta, acl *access.ACL) bool {
245 244 return ok
246 245 }
247 246
248 // RepoCounts answers the poll behind the repository tabs: the two open counts as
249 // out-of-band updates to the badges the header already shows. It reads the same
250 // counts the page did, so a new issue or change appears while the reader is on
251 // the page, and it sends nothing else, so the current tab, the clone menu and
252 // any form the reader has open stay where they are. A repository the viewer may
253 // not read answers 404 like every other page, so the poll cannot confirm that a
254 // private repository exists.
255 func (w *Web) RepoCounts(rw http.ResponseWriter, r *http.Request) {
256 m, ok := w.open(rw, r)
257 if !ok {
258 return
259 }
260 issues, requests := w.openCounts(memoOf(r), m)
261 w.render(rw, "repo_counts_live", repoNavData{
262 Name: m.Name, OpenIssues: issues, OpenRequests: requests, Live: true,
263 }, 0)
264 }
265
266 247 type repoNavData struct {
267 248 Name string
268 249 Description string
@@ -274,7 +255,4 @@ type repoNavData struct {
274 255 Site string
275 256 OpenIssues int
276 257 OpenRequests int
277 // Live marks a render of the count badges alone, where each one carries the
278 // out-of-band swap the header's poll answers with.
279 Live bool
280 258 }