A vibe coded tangled fork which supports pijul.

appview: collapse diffs of generated files by default

Signed-off-by: oppiliappan <me@oppi.li>

authored by

oppiliappan and committed by tangled.org 70b7627f 4eaf8ae7

+16 -2
+3
appview/pages/funcmap.go
··· 453 453 } 454 454 return result 455 455 }, 456 + "isGenerated": func(path string) bool { 457 + return enry.IsGenerated(path, nil) 458 + }, 456 459 // constant values used to define a template 457 460 "const": func() map[string]any { 458 461 return map[string]any{
+13 -2
appview/pages/templates/repo/fragments/diff.html
··· 138 138 {{ $idx := index . 0 }} 139 139 {{ $file := index . 1 }} 140 140 {{ $isSplit := index . 2 }} 141 + {{ $isGenerated := false }} 141 142 {{ with $file }} 142 - <details open id="file-{{ .Id }}" class="group border border-gray-200 dark:border-gray-700 w-full mx-auto rounded bg-white dark:bg-gray-800 drop-shadow-sm" tabindex="{{ add $idx 1 }}"> 143 + {{ $n := .Names }} 144 + {{ if $n.New }} 145 + {{ $isGenerated = isGenerated $n.New }} 146 + {{ else if $n.Old }} 147 + {{ $isGenerated = isGenerated $n.Old }} 148 + {{ end }} 149 + <details {{ if not $isGenerated }}open{{ end }} id="file-{{ .Id }}" class="group border border-gray-200 dark:border-gray-700 w-full mx-auto rounded bg-white dark:bg-gray-800 drop-shadow-sm" tabindex="{{ add $idx 1 }}"> 143 150 <summary class="list-none cursor-pointer sticky top-12 group-open:border-b border-gray-200 dark:border-gray-700"> 144 151 <div id="diff-file-header" class="rounded cursor-pointer bg-white dark:bg-gray-800 flex justify-between"> 145 152 <div id="left-side-items" class="p-2 flex gap-2 items-center overflow-x-auto"> ··· 148 155 {{ template "repo/fragments/diffStatPill" .Stats }} 149 156 150 157 <div class="flex gap-2 items-center overflow-x-auto"> 151 - {{ $n := .Names }} 152 158 {{ if and $n.New $n.Old (ne $n.New $n.Old)}} 153 159 {{ $n.Old }} {{ i "arrow-right" "w-4 h-4" }} {{ $n.New }} 154 160 {{ else if $n.New }} 155 161 {{ $n.New }} 156 162 {{ else }} 157 163 {{ $n.Old }} 164 + {{ end }} 165 + {{ if $isGenerated }} 166 + <span class="text-gray-400 dark:text-gray-500" title="Generated files are collapsed by default"> 167 + {{ i "circle-question-mark" "size-4" }} 168 + </span> 158 169 {{ end }} 159 170 </div> 160 171 </div>