4520d5cf
feat(web): pluggable alternative-view registry for repositories
A repository can now expose specialized, read-only "views" chosen by the
shape of its tables, while the generic table browser stays available as a
fallback. A View fingerprints the tables (Applies), builds a model from
the browse layer (Build), and renders its own template; views register at
init time via RegisterView and are dispatched by slug at
/~user/db/view/{slug}. The overview shows a tab per applicable view.
The template loader parses each registered view's template with the
shared chrome, so a new view plugs in by adding two files (its .go with
init()+RegisterView and its .html) plus nothing else — no edits to the
registry, router, loader, or handlers. Build receives the request query
values so a view can offer sub-modes (e.g. a detail pane). No SQL engine
is involved; views read through the existing BrowseSession surface.
Eugene Blikh <bigbes@gmail.com> — 2026-07-18 20:26:47 UTC
Commit 4520d5cf9385a3a7c18037e0c3dba95ad1874b35 —
view raw patch
Parent(s):
ba344433
| File | Status | + | − |
|---|---|---|---|
web/handlers_repo.go
|
M | +10 | -1 |
web/handlers_view.go
|
A | +95 | |
web/router.go
|
M | +27 | -6 |
web/templates.go
|
M | +44 | |
web/templates/overview.html
|
M | +4 | |
web/templates/partials.html
|
M | +24 | |
web/views.go
|
A | +63 | |
web/views_test.go
|
A | +179 | |
web/web_test.go
|
M | +20 | -7 |