summaryrefslogtreecommitdiff
path: root/web/templates/page-session.tmpl
blob: 1155b67bbeb859036b7f6e12584e7a152213fea3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{{/* One session's conversation, with its notevi log woven in by time. */}}
{{define "page-session"}}
{{$c := .Conv}}
<header class="filehead">
  <h1>
    {{if $c.Agent}}<span class="chip am{{$c.Bit}}">{{$c.Agent}}</span> {{end}}
    <code title="{{$c.Session}}">{{short $c.Session}}</code>
  </h1>
  <p class="meta">
    {{if $c.Model}}{{$c.Model}} · {{end}}{{$c.Reads}} reads · {{$c.Greps}} greps · {{$c.Notes}} notes
    {{if $c.Dir}} · <span title="{{$c.Dir}}">{{base $c.Dir}}</span>{{end}}
    {{if $c.Harness}} · {{$c.Harness}}{{end}}
  </p>
  {{if $c.Path}}
    <p class="meta"><code>{{$c.Path}}</code></p>
  {{else}}
    <p class="meta hint">no transcript found for this session — searched
      {{if $c.Roots}}{{range $i, $r := $c.Roots}}{{if $i}}, {{end}}<code>{{$r}}</code>{{end}}{{else}}nowhere: <code>-transcripts</code> is empty{{end}} ·
      showing the notevi log alone</p>
  {{end}}
  {{if $c.Err}}<p class="err">{{$c.Err}}</p>{{end}}
</header>

<section class="convpage">
  {{if $c.Windowed}}
  <p class="meta">
    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}}<a href="{{$c.AllHref}}">show the whole conversation</a>{{end}}
  </p>
  {{end}}

  <div class="conv" data-anchor="{{$c.Anchor}}">
    {{range $c.Turns}}
      {{if .Note}}
        <div class="turn t-note{{if .Here}} here{{end}}">
          <span class="role">note</span><time>{{.Clock}}</time>
          {{if .Note.File}}
          <div class="notewrap" data-href="{{$.NoteHref .Note}}" tabindex="0" role="link"
               title="open this note on the code it is about">{{template "note" (dict "N" .Note "P" $)}}</div>
          {{else}}
          <div class="notewrap">{{template "note" (dict "N" .Note "P" $)}}</div>
          {{end}}
        </div>
      {{else if eq .Role "notevi"}}
        <div class="turn t-notevi">
          <span class="role">notevi</span><time>{{.Clock}}</time>
          {{if .File}}<a class="what" href="{{$.Href "code" .File}}">{{.Text}}</a>
          {{else}}<span class="what">{{.Text}}</span>{{end}}
        </div>
      {{else if eq .Role "tool"}}
        <div class="turn t-tool">
          <span class="role">{{.Tool}}</span><time>{{.Clock}}</time>
          <code class="what">{{.Detail}}</code>
        </div>
      {{else if eq .Role "result"}}
        <div class="turn t-result{{if eq .Kind "error"}} bad{{end}}">
          <span class="role">→{{if .Tool}} {{.Tool}}{{end}}</span><time></time>
          <code class="what">{{.Detail}}</code>
        </div>
      {{else}}
        <div class="turn t-say t-{{.Role}}">
          <span class="role">{{.Role}}</span><time>{{.Clock}}</time>
          <p>{{.Text}}</p>
        </div>
      {{end}}
    {{end}}
    {{if not $c.Turns}}<p class="meta hint">nothing recorded for this session</p>{{end}}
  </div>
</section>
{{end}}