~bigbes/sr-ht-compare: 3e79c6de

web: draw the chrome from sr-ht-ecore

The nav/service-switcher, the brand, the login block and the environment
banner were a copy of code every custom service on this instance carries.
The copies drifted, so they now come from one place:
sourcecraft.dev/bigbes/sr-ht-ecore/chrome.

web/chrome.go is gone. New builds one chrome.Service from the shared
config.ini and hands it the discovered stylesheet; view() asks it for a
chrome.Page per request, which viewData embeds rather than copies, so a
field ecore adds later arrives here without an edit. The layout invokes
"srht-env-banner" and "srht-nav" instead of the markup it used to spell
out, the landing's repository listing goes through "srht-repo-list", and
the FuncMap starts from chrome.Funcs() with the local shortsha deleted.

Two ecore policies differ from what this service did and are adopted as
the instance's: the brand label is the config section's short name rather
than a literal "compare", and the origins are trimmed of a trailing
slash. What stays local is what is compare's alone: the bundle href, the
diff-status colours, and the container-fluid the two diff views ask for.

Tests move to testify; the nav ordering/exclusion test goes with the code
it tested, and a test that the layout invokes the chrome at all replaces
it.

bigbes <bigbes@gmail.com> — 2026-08-08 18:49:45 UTC

Commit 3e79c6dea6e380e00d7a7ad17ea8674dd62c8ca2view raw patch

Parent(s): 04b591cd

11 changed file(s)

FileStatus+
.gitignore M +4
README.md M +6 -3
go.mod M +5
go.sum M +2
web/chrome.go D -129
web/handlers.go M +32 -10
web/server.go M +81 -31
web/templates.go M +27 -19
web/templates/index.html M +2 -20
web/templates/layout.html M +19 -38
web/web_test.go M +127 -178