~bigbes/sr-ht-dolt: bf7897cd

web: draw the chrome from sr-ht-ecore

The brand, the service switcher, the login block, the environment banner
and the database listing were a local port of core.sr.ht's nav — one of
five such ports on this instance, and they had already drifted. They are
now sourcecraft.dev/bigbes/sr-ht-ecore/chrome, the one copy every custom
service draws from.

Deleted: web/chrome.go entire (navEntry, networkOrder, networkExcluded,
buildNetwork, basePage, loginURL, logoutURL), templates/nav.html,
templates/icons/circle.svg (ecore inlines the identical SVG), the
repoList partial, and the local dict/shortHash duplicates.

Added: one chrome.Service built in newApp from our config section with
the hashed stylesheet href set on it, a chrome.Page per request through
app.page, chrome.Attach on every template set, and chrome.Funcs as the
base of the funcmap. Handlers embed chrome.Page in their view structs
instead of copying its fields; the row browser sets ContainerClass to
container-fluid, since its column count is the table's and not ours.

Three behaviour changes come with ecore's policy, all deliberate: the
profile link now prefers hub's ~username page when hub.sr.ht is
configured (it was always meta's /profile), the brand carries a fixed
15rem min-width so the switcher starts at the same x on every service,
and a binary built without a stylesheet renders bare rather than linking
an empty href. The nav test went with the code it tested — ordering,
exclusions and login URLs are ecore's to cover — and what replaced it
asserts only what is ours: that pages are drawn through the chrome at
all, and that the row browser is full-bleed.

The auth path is untouched: a foreign bearer token is still accepted as
a meta.sr.ht PAT.

Eugene Blikh <bigbes@gmail.com> — 2026-08-08 18:58:19 UTC

Commit bf7897cd3026881c99dfef141933e333a38d4ed6view raw patch

Parent(s): 25541bcd

21 changed file(s)

FileStatus+
docs/DESIGN.md M +16 -11
go.mod M +1
go.sum M +3 -1
web/csrf.go M +1 -2
web/deps.go M +13 -2
web/handlers_browse.go M +24 -16
web/handlers_internal.go M +5 -4
web/handlers_keys.go M +7 -5
web/handlers_repo.go M +42 -19
web/handlers_settings.go M +8 -6
web/handlers_view.go M +6 -4
web/router.go M +47 -10
web/templates.go M +46 -58
web/templates/index.html M +5 -5
web/templates/layout.html M +18 -8
web/templates/log.html M +1 -1
web/templates/overview.html M +2 -2
web/templates/partials.html M +5 -21
web/templates/table.html M +3 -3
web/templates/user.html M +1 -1
web/web_test.go M +26 -13