improve commit page styles
MODIFIED
appview/pages/pages.go
MODIFIED
appview/pages/pages.go
@@ -74,8 +74,8 @@ },"splitN": func(s, sep string, n int) []string {return strings.SplitN(s, sep, n)},- "unescapeHtml": func(s string) template.HTML {- return template.HTML(s)+ "escapeHtml": func(s string) string {+ return template.HTMLEscapeString(s)},"nl2br": func(text string) template.HTML {return template.HTML(strings.Replace(template.HTMLEscapeString(text), "\n", "<br>", -1))@@ -269,10 +269,12 @@type RepoCommitParams struct {LoggedInUser *auth.UserRepoInfo RepoInfo+ Active stringtypes.RepoCommitResponse}func (p *Pages) RepoCommit(w io.Writer, params RepoCommitParams) error {+ params.Active = "overview"return p.executeRepo("repo/commit", w, params)}
@@ -12,11 +12,11 @@ <link href="/static/tw.css" rel="stylesheet" type="text/css" /><title>{{ block "title" . }}tangled{{ end }}</title></head><body class="container mx-auto px-10">- <header>- {{ block "topbar" . }}- {{ template "layouts/topbar" . }}- {{ end }}- </header>+ <header>+ {{ block "topbar" . }}+ {{ template "layouts/topbar" . }}+ {{ end }}+ </header><main class="content">{{ block "content" . }}{{ end }}</main><script src="/static/lucide.min.js"></script><script>
@@ -2,8 +2,11 @@ {{ define "title" }}{{ .RepoInfo.FullName }}{{ end }}{{ define "content" }}<section id="repo-header" class="mb-4">- <span class="text-xl">{{ .RepoInfo.FullName }}</span>- <br/>+ <p class="text-xl">+ <a href="/{{ .RepoInfo.OwnerWithAt }}" class="no-underline hover:underline">{{ .RepoInfo.OwnerWithAt }}</a>+ /+ <a href="/{{ .RepoInfo.FullName }}" class="no-underline hover:underline">{{ .RepoInfo.Name }}</a>+ </p><span>{{ if .RepoInfo.Description }}{{ .RepoInfo.Description }}
@@ -18,5 +18,5 @@{{ if .IsBinary }}<p class="text-center text-gray-400">This is a binary file and will not be displayed.</p>{{ else }}<pre class="font-mono text-sm overflow-auto relative text-ellipsis"><code>{{ range $idx, $line := $lines }}<span class="flex"><span class="{{ $code_number_style }}" style="min-width: {{$tot_chars}}ch;">{{ add $idx 1 }}</span>- <span class="whitespace-pre">{{ unescapeHtml $line }}</span></span>{{ else }}<em class="text-gray-400">this file is empty</em>{{ end }}</code></pre>{{ end}}+ <span class="whitespace-pre">{{ escapeHtml $line }}</span></span>{{ else }}<em class="text-gray-400">this file is empty</em>{{ end }}</code></pre>{{ end}}{{ end }}
@@ -8,44 +8,44 @@ {{ $stat := .Diff.Stat }}{{ $diff := .Diff.Diff }}<section class="commit">- <pre>{{- $commit.Message -}}</pre>- <div class="commit-info">- {{ $commit.Author.Name }} <a href="mailto:{{ $commit.Author.Email }}" class="commit-email">{{ $commit.Author.Email}}</a>- <div>{{ $commit.Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</div>+ <div id="commit-message">+ {{ $messageParts := splitN $commit.Message "\n\n" 2 }}+ <div>+ {{ index $messageParts 0 }}+ {{ if gt (len $messageParts) 1 }}+ <p class="mt-1 cursor-text pb-2">{{ nl2br (unwrapText (index $messageParts 1)) }}</p>+ {{ end }}+ </div></div>- <div>- <strong>commit</strong>- <p><a href="/{{ $repo }}/commit/{{ $commit.This }}" class="commit-hash">- {{ slice $commit.This 0 8 }}- </a>+ <p class="text-sm text-gray-500">+ <a href="mailto:{{ $commit.Author.Email }}" class="no-underline hover:underline text-gray-500">+ {{ $commit.Author.Name }}+ </a>+ · + {{ timeFmt $commit.Author.When }}+ · + <span class="font-mono">{{ $stat.FilesChanged }}</span> files <span class="font-mono">(+{{ $stat.Insertions }}, -{{ $stat.Deletions }})</span>+ · + <a href="/{{ $repo }}/commit/{{ $commit.This }}" class="no-underline hover:underline text-gray-500">+ {{ slice $commit.This 0 8 }}+ </a>+ {{ if $commit.Parent }}+ <--+ <a href="/{{ $repo }}/commit/{{ $commit.Parent }}" class="no-underline hover:underline text-gray-500">+ {{ slice $commit.Parent 0 8 }}+ </a>+ {{ end }}</p>- </div>- {{ if $commit.Parent }}- <div>- <strong>parent</strong>- <p><a href="/{{ $repo }}/commit/{{ $commit.Parent }}" class="commit-hash">- {{ slice $commit.Parent 0 8 }}- </a></p>- </div>-- {{ end }}<div class="diff-stat">- <div>- {{ $stat.FilesChanged }} files changed,- {{ $stat.Insertions }} insertions(+),- {{ $stat.Deletions }} deletions(-)- </div>- <div>- <br>- <strong>jump to</strong>- {{ range $diff }}- <ul>+ <br>+ <strong>jump to</strong>+ {{ range $diff }}+ <ul><li><a href="#{{ .Name.New }}">{{ .Name.New }}</a></li>- </ul>- {{ end }}- </div>+ </ul>+ {{ end }}</div></section><section>@@ -75,7 +75,7 @@ {{- end -}}{{ if .IsBinary }}<p>Not showing binary file.</p>{{ else }}- <pre>+ <pre class="overflow-auto">{{- range .TextFragments -}}<p>{{- .Header -}}</p>{{- range .Lines -}}
@@ -101,7 +101,7 @@ {{ $messageParts := splitN .Message "\n\n" 2 }}<div class="text-base cursor-pointer"><div><div class="flex items-center gap-1">- <a href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}" class="inline no-underline hover:underline hover:text-sky-400">{{ index $messageParts 0 }}</a>+ <a href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}" class="inline no-underline hover:underline">{{ index $messageParts 0 }}</a>{{ if gt (len $messageParts) 1 }}<button class="text-sm inline rounded-sm bg-gray-300 text-gray-700 px-1 w-fit hover:bg-gray-400"hx-on:click="this.parentElement.nextElementSibling.classList.toggle('hidden')">…</button>
MODIFIED
jetstream/jetstream.go
MODIFIED
jetstream/jetstream.go
@@ -29,6 +29,9 @@ mu sync.RWMutex}func (j *JetstreamClient) AddDid(did string) {+ if did == "" {+ return+ }j.mu.Lock()j.cfg.WantedDids = append(j.cfg.WantedDids, did)j.mu.Unlock()@@ -37,7 +40,11 @@ }func (j *JetstreamClient) UpdateDids(dids []string) {j.mu.Lock()- j.cfg.WantedDids = dids+ for _, did := range dids {+ if did != "" {+ }+ j.cfg.WantedDids = append(j.cfg.WantedDids, did)+ }j.mu.Unlock()j.reconnectCh <- struct{}{}}