From cb05c363045bf0e7af5858f6d7bc26f026fa9d70 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 24 Jul 2026 11:39:36 -0300 Subject: --- vrsite/templates/frag-activity.tmpl | 34 ++++++++++++++++++ vrsite/templates/frag-jj.tmpl | 33 +++++++++++++++++ vrsite/templates/frag-note.tmpl | 52 +++++++++++++++++++++++++++ vrsite/templates/layout.tmpl | 71 +++++++++++++++++++++++++++++++++++++ vrsite/templates/page-change.tmpl | 37 +++++++++++++++++++ vrsite/templates/page-file.tmpl | 20 +++++++++++ vrsite/templates/page-files.tmpl | 13 +++++++ vrsite/templates/page-index.tmpl | 52 +++++++++++++++++++++++++++ vrsite/templates/page-jj.tmpl | 25 +++++++++++++ vrsite/templates/page-notes.tmpl | 43 ++++++++++++++++++++++ 10 files changed, 380 insertions(+) create mode 100644 vrsite/templates/frag-activity.tmpl create mode 100644 vrsite/templates/frag-jj.tmpl create mode 100644 vrsite/templates/frag-note.tmpl create mode 100644 vrsite/templates/layout.tmpl create mode 100644 vrsite/templates/page-change.tmpl create mode 100644 vrsite/templates/page-file.tmpl create mode 100644 vrsite/templates/page-files.tmpl create mode 100644 vrsite/templates/page-index.tmpl create mode 100644 vrsite/templates/page-jj.tmpl create mode 100644 vrsite/templates/page-notes.tmpl (limited to 'vrsite/templates') diff --git a/vrsite/templates/frag-activity.tmpl b/vrsite/templates/frag-activity.tmpl new file mode 100644 index 0000000..8c15de7 --- /dev/null +++ b/vrsite/templates/frag-activity.tmpl @@ -0,0 +1,34 @@ +{{/* Who is reading the codebase right now, straight off the log tail. */}} +{{define "activity"}} +{{if .Compact}} +
+ {{range .Sessions}} +
+ {{.Short}} + {{.LastOp}} + {{.Ago}} +
+ {{end}} + {{if not .Sessions}}

nothing logged yet

{{end}} +
+{{else}} + + + + {{range .Sessions}} + + + + + + + + + + {{end}} + +
agentmodelsessionlast opwhenr/g/ndir
{{.Short}}{{if .Live}}●{{end}}{{.Model}}{{if .Reason}}/{{.Reason}}{{end}}{{short .ID}}{{.LastOp}}{{.Ago}}{{.Reads}}/{{.Greps}}/{{.Notes}}{{base .Dir}}
+ {{if not .Sessions}}

nothing logged yet

{{end}} +

live = active in the last {{.Window}}

+{{end}} +{{end}} diff --git a/vrsite/templates/frag-jj.tmpl b/vrsite/templates/frag-jj.tmpl new file mode 100644 index 0000000..b31af53 --- /dev/null +++ b/vrsite/templates/frag-jj.tmpl @@ -0,0 +1,33 @@ +{{/* jj query results. Live-only, so routes are absolute. */}} +{{define "jjrows"}} +{{if .Err}}

{{.Err}}

{{end}} +{{if .Rows}} +
+ {{range .Rows}} + {{if .Blank}}
{{.Graph}}
+ {{else if .Op}} +
+ {{.Graph}} + {{.Short}} + {{.When}} + {{.Author}} + {{.Desc}} + {{.End}} +
+ {{else}} +
+ {{.Graph}} + {{.Short}} + {{.CommitShort}} + {{.When}} + {{.Author}} + {{if .Refs}}{{.Refs}}{{end}} + {{if .Flags}}{{.Flags}}{{end}} + {{if .Desc}}{{.Desc}}{{else}}(no description){{end}} +
+ {{end}} + {{end}} +
+{{else if not .Err}}

no revisions matched

{{end}} +{{if .AtOp}}

as of operation {{short .AtOp}} · back to the op log

{{end}} +{{end}} diff --git a/vrsite/templates/frag-note.tmpl b/vrsite/templates/frag-note.tmpl new file mode 100644 index 0000000..56f7a8f --- /dev/null +++ b/vrsite/templates/frag-note.tmpl @@ -0,0 +1,52 @@ +{{define "note"}}{{$n := .N}}{{$p := .P}} +
+
+ {{if $n.File}}{{base $n.File}}{{lines $n}}{{end}} + {{if $n.Kind}}{{$n.Kind}}{{end}} + {{$n.Agent.Short}} +
+

{{$n.Text}}

+
+ {{if not $n.At.IsZero}}{{end}} + {{if $n.Model}}{{$n.Model}}{{if $n.Reason}}/{{$n.Reason}}{{end}}{{end}} + {{if $n.Session}}{{short $n.Session}}{{end}} + {{if $n.Change}}{{if $p.Live}}{{short $n.Change}}{{else}}{{short $n.Change}}{{end}}{{end}} +
+
+{{end}} + +{{define "notelist"}}{{range .Notes}}{{template "note" (dict "N" . "P" $)}}{{end}}{{if not .Notes}}

no notes match these filters

{{end}}{{end}} + +{{/* htmx responses: the list plus an out-of-band count update */}} +{{define "notelist-oob"}}{{len .Notes}}{{template "notelist" .}}{{end}} + +{{define "note-added"}}{{if .File}}{{len .File.Notes}}{{end}}{{range .Notes}}{{template "note" (dict "N" . "P" $)}}{{end}}{{end}} + +{{/* the add-a-comment form; live pages only, since it writes to the log */}} +{{define "noteform"}} +
+ + +
+ {{if .File}} + + on {{base .File.Path}} + {{else}} + + {{end}} + + + +
+ +
+ as {{.User}} → the log + +
+
+{{range .Facets.Kinds}} +{{end}} diff --git a/vrsite/templates/layout.tmpl b/vrsite/templates/layout.tmpl new file mode 100644 index 0000000..c3fe250 --- /dev/null +++ b/vrsite/templates/layout.tmpl @@ -0,0 +1,71 @@ + + + + + +{{.Title}} + + +{{if .Live}}{{end}} + + + + + + +
+{{if .Err}}

{{.Err}}

{{end}} +{{if eq .Kind "file"}}{{template "page-file" .}} +{{else if eq .Kind "notes"}}{{template "page-notes" .}} +{{else if eq .Kind "files"}}{{template "page-files" .}} +{{else if eq .Kind "jj"}}{{template "page-jj" .}} +{{else if eq .Kind "change"}}{{template "page-change" .}} +{{else}}{{template "page-index" .}}{{end}} +
+ +{{if eq .Kind "file"}} + +{{end}} + + + diff --git a/vrsite/templates/page-change.tmpl b/vrsite/templates/page-change.tmpl new file mode 100644 index 0000000..08310e5 --- /dev/null +++ b/vrsite/templates/page-change.tmpl @@ -0,0 +1,37 @@ +{{define "page-change"}} +{{$c := .Change}} +
+

{{$c.Row.Short}} {{$c.Row.Flags}}

+

+ commit {{$c.Row.CommitShort}} · {{$c.Row.Author}} · {{$c.Row.When}} + {{if $c.Row.Refs}} · {{$c.Row.Refs}}{{end}} · + browse the tree here +

+
+ +
+ {{if $c.Desc}}
{{$c.Desc}}
{{else}}

(no description set)

{{end}} + + {{if $c.Parents}} +

parents: + {{range $c.Parents}}{{.Short}} {{.Desc}} {{end}} +

+ {{end}} + +

Changed files {{$c.Stat}}

+ {{if $c.Files}} + + + {{range $c.Files}} + + + {{end}} + +
{{.Status}}{{.Path}}
+ {{else}}

no file changes

{{end}} + +

Notes recorded at this change {{len .Notes}}

+
{{range .Notes}}{{template "note" (dict "N" . "P" $)}}{{end}}
+ {{if not .Notes}}

nothing in the log was written while this change was checked out

{{end}} +
+{{end}} diff --git a/vrsite/templates/page-file.tmpl b/vrsite/templates/page-file.tmpl new file mode 100644 index 0000000..39a8c44 --- /dev/null +++ b/vrsite/templates/page-file.tmpl @@ -0,0 +1,20 @@ +{{define "page-file"}} +
+

{{.File.Path}}

+

+ {{if .File.Traced}} + {{range .Site.Agents}}{{if band $.File.Mask .Bit}}{{.Short}} {{end}}{{end}} + {{.File.Pct}}% read · + {{.File.Reads}} reads · {{.File.Greps}} greps · + {{len .File.Notes}} note{{if ne (len .File.Notes) 1}}s{{end}} · + {{else}}not traced · {{end}}change + {{if .Live}}{{short .File.Change}}{{else}}{{short .File.Change}}{{end}} +

+ {{if .File.Patterns}}

grepped: {{range .File.Patterns}}{{.}} {{end}}

{{end}} +
+{{if .File.Stub}} +

{{.File.Stub}}

+{{else}} +
{{.File.Body}}
+{{end}} +{{end}} diff --git a/vrsite/templates/page-files.tmpl b/vrsite/templates/page-files.tmpl new file mode 100644 index 0000000..53757ea --- /dev/null +++ b/vrsite/templates/page-files.tmpl @@ -0,0 +1,13 @@ +{{define "page-files"}} +
+

Files

+

+ everything at change {{short .ChangeID}} · + traced files carry a coverage bar + ◆ marks files with notes +

+
+
+{{.Tree}} +
+{{end}} diff --git a/vrsite/templates/page-index.tmpl b/vrsite/templates/page-index.tmpl new file mode 100644 index 0000000..2c115cc --- /dev/null +++ b/vrsite/templates/page-index.tmpl @@ -0,0 +1,52 @@ +{{define "page-index"}} +
+

{{.Site.Title}}

+

+ {{len .Site.All}} files, {{len .Site.Order}} traced · {{len .Site.Notes}} notes · + change {{short .Site.Change}} · theme {{.Site.Theme.Name}} +

+
+ +{{if .Live}} +
+

Live — agents reading this codebase

+
+

…

+
+
+{{end}} + +
+

Agents

+ + + + {{range .Site.Agents}} + + + + {{end}} + +
agentmodeleffortsessionreadsgrepsnotes
{{.Short}}{{.Model}}{{.Reason}}{{short .Session}}{{.Reads}}{{.Greps}}{{.Notes}}
+
+ +
+

Coverage

+ + + + {{range .Site.Order}}{{with index $.Site.Files .}} + + + + {{end}}{{end}} + +
filereadlinesnotes
{{.Path}}{{.Pct}}%{{.Covered}}/{{.Total}}{{len .Notes}}
+
+ +
+

Latest notes — all {{len .Site.Notes}}, with filters

+
{{range .Notes}}{{template "note" (dict "N" . "P" $)}}{{end}}
+ {{if not .Notes}}

no notes in the log yet

{{end}} +
+{{end}} diff --git a/vrsite/templates/page-jj.tmpl b/vrsite/templates/page-jj.tmpl new file mode 100644 index 0000000..5c1381c --- /dev/null +++ b/vrsite/templates/page-jj.tmpl @@ -0,0 +1,25 @@ +{{define "page-jj"}} +
+

jj

+

+ read-only queries against the repo — --ignore-working-copy, inline templates, nothing written to disk +

+
+ +
+
+ + + + + + · +
+

+ change ids open the change · descriptions browse the tree at that change · + op ids re-run the query --at-operation, which is how you see the repo as it was +

+
{{template "jjrows" .JJ}}
+
+{{end}} diff --git a/vrsite/templates/page-notes.tmpl b/vrsite/templates/page-notes.tmpl new file mode 100644 index 0000000..974dc64 --- /dev/null +++ b/vrsite/templates/page-notes.tmpl @@ -0,0 +1,43 @@ +{{define "facet"}}{{end}} + +{{define "page-notes"}} +
+

Notes

+

+ {{len .Site.Notes}} in the log{{if .Live}} · anything you add here is appended to the log — the repo is never touched{{end}} +

+
+ +
+ {{if .Live}} +
+ add a note + {{template "noteform" .}} +
+ {{end}} + +
+ + + {{template "facet" (dict "Name" "agent" "Label" "any agent" "Values" .Facets.Agents "Sel" .Filter.Agent)}} + {{template "facet" (dict "Name" "model" "Label" "any model" "Values" .Facets.Models "Sel" .Filter.Model)}} + {{template "facet" (dict "Name" "session" "Label" "any session" "Values" .Facets.Sessions "Sel" .Filter.Session "Short" true)}} + {{template "facet" (dict "Name" "kind" "Label" "any kind" "Values" .Facets.Kinds "Sel" .Filter.Kind)}} + + + + + + +
+ {{range .Facets.Files}} + +

·{{len .Notes}} notes shown

+
{{template "notelist" .}}
+
+{{end}} -- cgit v1.3