Monorepo for Tangled tangled.org
2

Configure Feed

Select the types of activity you want to include in your feed.

appview/diff: add [view file] button

![](https://x.eti.tf/9ee3f60.png)

resolves
[TAN-456](https://linear.app/tangled/issue/TAN-456/in-diff-view-add-open-full-file-button)

Signed-off-by: eti <eti@eti.tf>

+26 -7
+1 -1
appview/pages/templates/repo/commit.html
··· 153 153 154 154 155 155 {{ define "contentAfter" }} 156 - {{ template "repo/fragments/diff" (list .Diff .DiffOpts) }} 156 + {{ template "repo/fragments/diff" (list .Diff .DiffOpts "" (printf "/%s/blob/%s" .RepoInfo.FullName (pathEscape .Diff.Commit.This))) }} 157 157 {{end}}
+1 -1
appview/pages/templates/repo/compare/compare.html
··· 21 21 {{ end }} 22 22 23 23 {{ define "contentAfter" }} 24 - {{ template "repo/fragments/diff" (list .Diff .DiffOpts) }} 24 + {{ template "repo/fragments/diff" (list .Diff .DiffOpts "" (printf "/%s/blob/%s" .RepoInfo.FullName (pathEscape .Head))) }} 25 25 {{end}}
+22 -3
appview/pages/templates/repo/fragments/diff.html
··· 101 101 {{ define "diffLayout" }} 102 102 {{ $diff := index . 0 }} 103 103 {{ $opts := index . 1 }} 104 - {{ $padBottom := gt (len .) 2 }} 104 + {{ $padBottom := and (gt (len .) 2) (index . 2) }} 105 + {{ $blobBase := "" }} 106 + {{ if gt (len .) 3 }}{{ $blobBase = index . 3 }}{{ end }} 105 107 106 108 <div class="flex col-span-full flex-grow"> 107 109 <!-- left panel --> ··· 115 117 116 118 <!-- main content --> 117 119 <div id="diff-files" class="flex-1 min-w-0 sticky top-12 {{ if $padBottom }}pb-12{{ end }}"> 118 - {{ template "diffFiles" (list $diff $opts) }} 120 + {{ template "diffFiles" (list $diff $opts $blobBase) }} 119 121 </div> 120 122 121 123 </div> ··· 124 126 {{ define "diffFiles" }} 125 127 {{ $diff := index . 0 }} 126 128 {{ $opts := index . 1 }} 129 + {{ $blobBase := "" }} 130 + {{ if gt (len .) 2 }}{{ $blobBase = index . 2 }}{{ end }} 127 131 {{ $files := $diff.ChangedFiles }} 128 132 {{ $isSplit := $opts.Split }} 129 133 <div class="flex flex-col gap-4"> ··· 133 137 </div> 134 138 {{ else }} 135 139 {{ range $idx, $file := $files }} 136 - {{ template "diffFile" (list $idx $file $isSplit) }} 140 + {{ template "diffFile" (list $idx $file $isSplit false $blobBase) }} 137 141 {{ end }} 138 142 {{ end }} 139 143 </div> ··· 145 149 {{ $isSplit := index . 2 }} 146 150 {{ $collapsed := false }} 147 151 {{ if gt (len .) 3 }}{{ $collapsed = index . 3 }}{{ end }} 152 + {{ $blobBase := "" }} 153 + {{ if gt (len .) 4 }}{{ $blobBase = index . 4 }}{{ end }} 148 154 {{ $isGenerated := false }} 149 155 {{ $isDeleted := false }} 150 156 {{ with $file }} ··· 182 188 {{ end }} 183 189 </div> 184 190 </div> 191 + <div class="flex items-center pr-1"> 192 + {{ if and $blobBase $n.New }} 193 + <a 194 + href="{{ $blobBase }}/{{ $n.New }}" 195 + onclick="event.stopPropagation()" 196 + class="btn-flat hidden md:flex" 197 + title="Open file" 198 + > 199 + {{ i "eye" "size-4" }} 200 + <span class="hidden md:inline">View file</span> 201 + </a> 202 + {{ end }} 185 203 <label 186 204 data-review-btn="file-{{ .Id }}" 187 205 onclick="event.stopPropagation()" ··· 197 215 <span class="hidden peer-checked:inline text-green-600 dark:text-green-400">{{ i "circle-check" "size-4" }}</span> 198 216 <span class="hidden md:inline">Reviewed</span> 199 217 </label> 218 + </div> 200 219 </div> 201 220 </summary> 202 221
+2 -2
input.css
··· 223 223 224 224 .btn-flat { 225 225 @apply inline-flex items-center justify-center 226 - min-h-[32px] px-2 py-[6px] 226 + min-h-[32px] px-2 py-[6px] gap-1.5 227 227 rounded 228 - text-sm text-gray-900 dark:text-gray-100 cursor-pointer 228 + text-sm text-gray-900 dark:text-gray-100 cursor-pointer no-underline hover:no-underline 229 229 transition-colors duration-150 ease-in-out 230 230 focus:outline-none 231 231 focus-visible:outline focus-visible:outline-2 focus-visible:outline-gray-400