From 8ec4e135e318c7799b2576a8729493c063da4a97 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 30 Jul 2026 17:05:12 -0300 Subject: --- vrsite/templates/frag-activity.tmpl | 6 ++-- vrsite/templates/frag-change.tmpl | 41 ++++++++++++++++++++++ vrsite/templates/frag-note.tmpl | 18 +++++++--- vrsite/templates/layout.tmpl | 5 ++- vrsite/templates/page-files.tmpl | 4 +-- vrsite/templates/page-index.tmpl | 10 ++++-- vrsite/templates/page-notes.tmpl | 11 +++++- vrsite/templates/page-session.tmpl | 70 +++++++++++++++++++++++++++++++++++++ 8 files changed, 149 insertions(+), 16 deletions(-) create mode 100644 vrsite/templates/frag-change.tmpl create mode 100644 vrsite/templates/page-session.tmpl (limited to 'vrsite/templates') diff --git a/vrsite/templates/frag-activity.tmpl b/vrsite/templates/frag-activity.tmpl index 8c15de7..071c556 100644 --- a/vrsite/templates/frag-activity.tmpl +++ b/vrsite/templates/frag-activity.tmpl @@ -4,7 +4,8 @@
{{range .Sessions}}
- {{.Short}} + {{if and $.Live .ID}}{{.Short}} + {{else}}{{.Short}}{{end}} {{.LastOp}} {{.Ago}}
@@ -19,7 +20,8 @@ {{.Short}}{{if .Live}}●{{end}} {{.Model}}{{if .Reason}}/{{.Reason}}{{end}} - {{short .ID}} + {{if and $.Live .ID}}{{short .ID}} + {{else}}{{short .ID}}{{end}} {{.LastOp}} {{.Ago}} {{.Reads}}/{{.Greps}}/{{.Notes}} diff --git a/vrsite/templates/frag-change.tmpl b/vrsite/templates/frag-change.tmpl new file mode 100644 index 0000000..b33d746 --- /dev/null +++ b/vrsite/templates/frag-change.tmpl @@ -0,0 +1,41 @@ +{{/* The change everything on screen is read at, and how wide the view is. + Every page carries it, because every read, note and file listing below + is relative to it. */}} +{{define "changebar"}} +
+
+ change + {{if .Live}}{{short .ChangeID}} + {{else}}{{short .ChangeID}}{{end}} + {{with .ChangeInfo}}{{if .Flags}}{{.Flags}}{{end}}{{end}} +
+ {{with .ChangeInfo}} +

{{if .Desc}}{{.Desc}}{{else}}(no description){{end}}

+ {{end}} + +

+ {{if eq .Scope "all"}} + {{.Site.NotesTotal}} notes across every change{{if .Here}} · {{.Here}} here{{end}} + {{else if .ScopeEmpty}} + nothing recorded at this change — showing all {{.Site.NotesTotal}} + {{else}} + {{.Here}} notes here{{if .Elsewhere}} · {{.Elsewhere}} elsewhere{{end}} + {{end}} +

+ + {{if .Live}} + +
+ + {{if eq .Scope "all"}}{{end}} +
+ {{if .Rev}}

← back to {{short .Default}}, where the log points

{{end}} + {{end}} +
+{{end}} diff --git a/vrsite/templates/frag-note.tmpl b/vrsite/templates/frag-note.tmpl index 56f7a8f..0c3182c 100644 --- a/vrsite/templates/frag-note.tmpl +++ b/vrsite/templates/frag-note.tmpl @@ -1,7 +1,8 @@ -{{define "note"}}{{$n := .N}}{{$p := .P}} -
+ data-kind="{{$n.Kind}}" data-file="{{$n.File}}" data-date="{{if not $n.At.IsZero}}{{$n.At.Format "2006-01-02"}}{{end}}" + data-start="{{$n.Start}}" data-end="{{$n.End}}">
{{if $n.File}}{{base $n.File}}{{lines $n}}{{end}} {{if $n.Kind}}{{$n.Kind}}{{end}} @@ -12,7 +13,12 @@ {{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}} + {{with $p.ConvHref $n}}conversation{{end}} + {{if $n.Change}} + {{if $p.Live}}{{short $n.Change}} + {{else}}{{short $n.Change}}{{end}} + {{end}}
{{end}} @@ -30,6 +36,8 @@ hx-on::after-request="if(event.detail.successful){this.reset();{{if eq .Kind "notes"}}htmx.trigger('#notefilters','change');{{end}}}" method="post" action="{{.Href "notes"}}"> + +
{{if .File}} @@ -44,7 +52,7 @@
- as {{.User}} → the log + as {{.User}} at {{short .ChangeID}} → the log
diff --git a/vrsite/templates/layout.tmpl b/vrsite/templates/layout.tmpl index c3fe250..9bc9ddd 100644 --- a/vrsite/templates/layout.tmpl +++ b/vrsite/templates/layout.tmpl @@ -23,9 +23,7 @@
- {{if and .Live .Rev}} -

browsing {{short .ChangeID}} · back to @

- {{end}} + {{template "changebar" .}} {{if .Live}}
{{end}} @@ -52,6 +50,7 @@ {{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 if eq .Kind "session"}}{{template "page-session" .}} {{else}}{{template "page-index" .}}{{end}} diff --git a/vrsite/templates/page-files.tmpl b/vrsite/templates/page-files.tmpl index 53757ea..3f158fe 100644 --- a/vrsite/templates/page-files.tmpl +++ b/vrsite/templates/page-files.tmpl @@ -2,8 +2,8 @@

Files

- everything at change {{short .ChangeID}} · - traced files carry a coverage bar + everything at change {{short .ChangeID}} · + traced files carry a coverage bar{{if eq .Scope "change"}}, from reads at this change{{end}} ◆ marks files with notes

diff --git a/vrsite/templates/page-index.tmpl b/vrsite/templates/page-index.tmpl index 2c115cc..bd377ac 100644 --- a/vrsite/templates/page-index.tmpl +++ b/vrsite/templates/page-index.tmpl @@ -2,8 +2,10 @@

{{.Site.Title}}

- {{len .Site.All}} files, {{len .Site.Order}} traced · {{len .Site.Notes}} notes · - change {{short .Site.Change}} · theme {{.Site.Theme.Name}} + {{len .Files}} files at {{short .ChangeID}} · + {{len .Site.Order}} traced, {{len .Site.Notes}} notes + {{if or (eq .Scope "all") .ScopeEmpty}}across every change{{else}}here{{end}} · + theme {{.Site.Theme.Name}}

@@ -23,7 +25,9 @@ {{range .Site.Agents}} {{.Short}} - {{.Model}}{{.Reason}}{{short .Session}} + {{.Model}}{{.Reason}} + {{if and $.Live .Session}}{{short .Session}} + {{else}}{{short .Session}}{{end}} {{.Reads}}{{.Greps}}{{.Notes}} {{end}} diff --git a/vrsite/templates/page-notes.tmpl b/vrsite/templates/page-notes.tmpl index 974dc64..242c137 100644 --- a/vrsite/templates/page-notes.tmpl +++ b/vrsite/templates/page-notes.tmpl @@ -7,7 +7,16 @@

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 eq .Scope "all"}} + all {{.Site.NotesTotal}} in the log, every change + {{else if .ScopeEmpty}} + all {{.Site.NotesTotal}} in the log — nothing was recorded at {{short .ChangeID}} + {{else}} + {{len .Site.Notes}} written at {{short .ChangeID}}{{if .Elsewhere}} · + {{if .Live}}{{.Elsewhere}} more at other changes + {{else}}{{.Elsewhere}} more at other changes are not in this export{{end}}{{end}} + {{end}} + {{if .Live}} · anything you add here is appended to the log at this change — the repo is never touched{{end}}

diff --git a/vrsite/templates/page-session.tmpl b/vrsite/templates/page-session.tmpl new file mode 100644 index 0000000..9a35e8d --- /dev/null +++ b/vrsite/templates/page-session.tmpl @@ -0,0 +1,70 @@ +{{/* One session's conversation, with its vr log woven in by time. */}} +{{define "page-session"}} +{{$c := .Conv}} +
+

+ {{if $c.Agent}}{{$c.Agent}} {{end}} + {{short $c.Session}} +

+

+ {{if $c.Model}}{{$c.Model}} · {{end}}{{$c.Reads}} reads · {{$c.Greps}} greps · {{$c.Notes}} notes + {{if $c.Dir}} · {{base $c.Dir}}{{end}} + {{if $c.Harness}} · {{$c.Harness}}{{end}} +

+ {{if $c.Path}} +

{{$c.Path}}

+ {{else}} +

no transcript found for this session — searched + {{if $c.Roots}}{{range $i, $r := $c.Roots}}{{if $i}}, {{end}}{{$r}}{{end}}{{else}}nowhere: -transcripts is empty{{end}} · + showing the vr log alone

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

{{$c.Err}}

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

+ moments {{$c.From}}–{{$c.To}} of {{$c.Total}}{{if $c.Anchor}}, around the note{{end}} · + {{if $c.Incomplete}}the rest is beyond what one page renders{{else}}show the whole conversation{{end}} +

+ {{end}} + +
+ {{range $c.Turns}} + {{if .Note}} +
+ note + {{if .Note.File}} +
{{template "note" (dict "N" .Note "P" $)}}
+ {{else}} +
{{template "note" (dict "N" .Note "P" $)}}
+ {{end}} +
+ {{else if eq .Role "vr"}} +
+ vr + {{if .File}}{{.Text}} + {{else}}{{.Text}}{{end}} +
+ {{else if eq .Role "tool"}} +
+ {{.Tool}} + {{.Detail}} +
+ {{else if eq .Role "result"}} +
+ →{{if .Tool}} {{.Tool}}{{end}} + {{.Detail}} +
+ {{else}} +
+ {{.Role}} +

{{.Text}}

+
+ {{end}} + {{end}} + {{if not $c.Turns}}

nothing recorded for this session

{{end}} +
+
+{{end}} -- cgit v1.3