Monorepo for Tangled
0
fork

Configure Feed

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

appview/pages: drop legacy compare + patch-upload fragments

Lewis: May this revision serve well! <lewis@tangled.org>

authored by

Lewis and committed by
Tangled
e21c8735 cf76a576

+103 -99
+37 -39
appview/pages/templates/repo/pulls/fragments/pullCompareBranches.html
··· 1 1 {{ define "repo/pulls/fragments/pullCompareBranches" }} 2 - <div id="patch-upload"> 3 - <label for="targetBranch" class="dark:text-white">select a source branch</label> 4 - <div class="flex flex-wrap gap-2 items-center"> 5 - <select 6 - name="sourceBranch" 7 - class="p-1 border border-gray-200 bg-white dark:bg-gray-700 dark:text-white dark:border-gray-600" 8 - > 9 - <option disabled selected>source branch</option> 2 + <div id="patch-upload" class="flex flex-wrap gap-2 items-center"> 3 + <select 4 + id="sourceBranch" 5 + name="sourceBranch" 6 + hx-post="/{{ .RepoInfo.FullName }}/pulls/new/refresh" 7 + hx-include="closest form" 8 + hx-target="#pr-compose-host" 9 + hx-swap="outerHTML" 10 + hx-trigger="change" 11 + hx-indicator="this" 12 + class="peer p-1 border border-gray-200 bg-white dark:bg-gray-700 dark:text-white dark:border-gray-600" 13 + > 14 + <option disabled {{ if not .SourceBranch }}selected{{ end }}>Source branch</option> 10 15 11 - {{ $recent := index .Branches 0 }} 12 - {{ range .Branches }} 13 - {{ $isRecent := eq .Reference.Name $recent.Reference.Name }} 14 - {{ $preset := false }} 15 - {{ if $.SourceBranch }} 16 - {{ $preset = eq .Reference.Name $.SourceBranch }} 17 - {{ else }} 18 - {{ $preset = $isRecent }} 19 - {{ end }} 20 - 21 - <option 22 - value="{{ .Reference.Name }}" 23 - {{ if $preset }} 24 - selected 25 - {{ end }} 26 - class="py-1" 27 - > 28 - {{ .Reference.Name }} 29 - {{ if $isRecent }}(new){{ end }} 30 - </option> 16 + {{ $recent := "" }} 17 + {{ if .SourceBranches }} 18 + {{ $recent = (index .SourceBranches 0).Reference.Name }} 19 + {{ end }} 20 + {{ range .SourceBranches }} 21 + {{ $isRecent := eq .Reference.Name $recent }} 22 + {{ $preset := false }} 23 + {{ if $.SourceBranch }} 24 + {{ $preset = eq .Reference.Name $.SourceBranch }} 25 + {{ else }} 26 + {{ $preset = $isRecent }} 31 27 {{ end }} 32 - </select> 33 - </div> 34 - </div> 35 28 36 - <div class="flex items-center gap-2"> 37 - <input type="checkbox" id="isStacked" name="isStacked" value="on"> 38 - <label for="isStacked" class="my-0 py-0 normal-case font-normal">Submit as stacked PRs</label> 29 + <option 30 + value="{{ .Reference.Name }}" 31 + {{ if $preset }}selected{{ end }} 32 + {{ if and $.TargetBranch (eq .Reference.Name $.TargetBranch) }}disabled{{ end }} 33 + class="py-1" 34 + > 35 + {{ .Reference.Name }} 36 + {{ if $isRecent }}(new){{ end }} 37 + {{ if and $.TargetBranch (eq .Reference.Name $.TargetBranch) }}(target){{ end }} 38 + </option> 39 + {{ end }} 40 + </select> 41 + {{ i "loader-circle" "size-4 animate-spin hidden peer-[.htmx-request]:inline text-gray-500 dark:text-gray-400" }} 39 42 </div> 40 - 41 - <p class="mt-4"> 42 - Title and description are optional; if left out, they will be extracted 43 - from the first commit. 44 - </p> 45 43 {{ end }}
+29 -45
appview/pages/templates/repo/pulls/fragments/pullCompareForks.html
··· 1 1 {{ define "repo/pulls/fragments/pullCompareForks" }} 2 - <div id="patch-upload"> 3 - <label for="forkSelect" class="dark:text-white" 4 - >select a fork to compare</label 5 - > 6 - selected: {{ .Selected }} 7 - <div class="flex flex-wrap gap-4 items-center"> 8 - <div class="flex flex-wrap gap-2 items-center"> 9 - <select 10 - id="forkSelect" 11 - name="fork" 12 - required 13 - class="p-1 border border-gray-200 bg-white dark:bg-gray-700 dark:text-white dark:border-gray-600" 14 - hx-get="/{{ $.RepoInfo.FullName }}/pulls/new/fork-branches" 15 - hx-target="#branch-selection" 16 - hx-vals='{"fork": this.value}' 17 - hx-swap="innerHTML" 18 - onchange="document.getElementById('hiddenForkInput').value = this.value;" 19 - > 20 - <option disabled selected>select a fork</option> 21 - {{ range .Forks }} 22 - <option value="{{ .Did }}/{{ .Name }}" {{ if eq .Name $.Selected }}selected{{ end }} class="py-1"> 23 - {{ .Did | resolve }}/{{ .Name }} 24 - </option> 25 - {{ end }} 26 - </select> 27 - 28 - <input 29 - type="hidden" 30 - id="hiddenForkInput" 31 - name="fork" 32 - value="" 33 - /> 34 - </div> 2 + <div id="patch-upload" class="flex flex-wrap items-center gap-2"> 3 + <div class="flex flex-wrap gap-2 items-center"> 4 + <select 5 + id="forkSelect" 6 + name="fork" 7 + required 8 + class="peer p-1 border border-gray-200 bg-white dark:bg-gray-700 dark:text-white dark:border-gray-600" 9 + hx-post="/{{ $.RepoInfo.FullName }}/pulls/new/refresh" 10 + hx-include="closest form" 11 + hx-target="#pr-compose-host" 12 + hx-swap="outerHTML" 13 + hx-trigger="change" 14 + hx-indicator="this" 15 + > 16 + <option disabled {{ if not $.Fork }}selected{{ end }}>Select a fork</option> 17 + {{ range .Forks }} 18 + {{ $ident := printf "%s/%s" .Did .Name }} 19 + <option value="{{ $ident }}" {{ if eq $ident $.Fork }}selected{{ end }} class="py-1"> 20 + {{ .Did | resolve }}/{{ .Name }} 21 + </option> 22 + {{ end }} 23 + </select> 24 + {{ i "loader-circle" "size-4 animate-spin hidden peer-[.htmx-request]:inline text-gray-500 dark:text-gray-400" }} 25 + </div> 35 26 36 - <div id="branch-selection"> 27 + <div id="branch-selection"> 28 + {{ if and .Fork .ForkBranches }} 29 + {{ template "repo/pulls/fragments/pullCompareForksBranches" (dict "SourceBranches" .ForkBranches "SourceBranch" .SourceBranch "RepoInfo" .RepoInfo) }} 30 + {{ else }} 37 31 <div class="text-sm text-gray-500 dark:text-gray-400"> 38 32 Select a fork first to view available branches 39 33 </div> 40 - </div> 34 + {{ end }} 41 35 </div> 42 36 </div> 43 - 44 - <div class="flex items-center gap-2"> 45 - <input type="checkbox" id="isStacked" name="isStacked" value="on"> 46 - <label for="isStacked" class="my-0 py-0 normal-case font-normal">Submit as stacked PRs</label> 47 - </div> 48 - 49 - <p class="mt-4"> 50 - Title and description are optional; if left out, they will be extracted 51 - from the first commit. 52 - </p> 53 37 {{ end }}
+21 -7
appview/pages/templates/repo/pulls/fragments/pullCompareForksBranches.html
··· 2 2 <div class="flex flex-wrap gap-2 items-center"> 3 3 <select 4 4 name="sourceBranch" 5 - class="p-1 border border-gray-200 bg-white dark:bg-gray-700 dark:text-white dark:border-gray-600" 5 + hx-post="/{{ .RepoInfo.FullName }}/pulls/new/refresh" 6 + hx-include="closest form" 7 + hx-target="#pr-compose-host" 8 + hx-swap="outerHTML" 9 + hx-trigger="change" 10 + hx-indicator="this" 11 + class="peer p-1 border border-gray-200 bg-white dark:bg-gray-700 dark:text-white dark:border-gray-600" 6 12 > 7 - <option disabled selected>source branch</option> 13 + <option disabled {{ if not .SourceBranch }}selected{{ end }}>Source branch</option> 8 14 9 - {{ $recent := index .SourceBranches 0 }} 15 + {{ $recent := "" }} 16 + {{ if .SourceBranches }} 17 + {{ $recent = (index .SourceBranches 0).Reference.Name }} 18 + {{ end }} 10 19 {{ range .SourceBranches }} 11 - {{ $isRecent := eq .Reference.Name $recent.Reference.Name }} 20 + {{ $isRecent := eq .Reference.Name $recent }} 21 + {{ $preset := false }} 22 + {{ if $.SourceBranch }} 23 + {{ $preset = eq .Reference.Name $.SourceBranch }} 24 + {{ else }} 25 + {{ $preset = $isRecent }} 26 + {{ end }} 12 27 <option 13 28 value="{{ .Reference.Name }}" 14 - {{ if $isRecent }} 15 - selected 16 - {{ end }} 29 + {{ if $preset }}selected{{ end }} 17 30 class="py-1" 18 31 > 19 32 {{ .Reference.Name }} ··· 21 34 </option> 22 35 {{ end }} 23 36 </select> 37 + {{ i "loader-circle" "size-4 animate-spin hidden peer-[.htmx-request]:inline text-gray-500 dark:text-gray-400" }} 24 38 </div> 25 39 {{ end }}
+16 -8
appview/pages/templates/repo/pulls/fragments/pullPatchUpload.html
··· 1 1 {{ define "repo/pulls/fragments/pullPatchUpload" }} 2 2 <div id="patch-upload"> 3 - <p> 4 - You can paste a <code>git diff</code> or a 5 - <code>git format-patch</code> patch series here. 6 - </p> 3 + <div class="flex items-center justify-between gap-2"> 4 + <p class="my-0"> 5 + You can paste a <code>git diff</code> or a 6 + <code>git format-patch</code> patch series here. 7 + </p> 8 + <span id="patch-spinner" class="group"> 9 + {{ i "loader-circle" "size-4 animate-spin hidden group-[.htmx-request]:inline text-gray-500 dark:text-gray-400" }} 10 + </span> 11 + </div> 7 12 <textarea 8 - hx-trigger="keyup changed delay:500ms, paste delay:500ms" 9 - hx-post="/{{ .RepoInfo.FullName }}/pulls/new/validate-patch" 10 - hx-swap="none" 13 + hx-trigger="paste delay:100ms, change" 14 + hx-post="/{{ .RepoInfo.FullName }}/pulls/new/refresh" 15 + hx-include="closest form" 16 + hx-target="#pr-compose-host" 17 + hx-swap="outerHTML" 18 + hx-indicator="#patch-spinner" 11 19 name="patch" 12 20 id="patch" 13 21 rows="12" ··· 16 24 index 1234567..abcdefg 100644 17 25 --- a/file.txt 18 26 +++ b/file.txt" 19 - ></textarea> 27 + >{{ .Patch }}</textarea> 20 28 </div> 21 29 {{ end }}