{{ define "title" }} {{ .Pull.Title }} · pull #{{ .Pull.PullId }} · {{ .RepoInfo.FullName }} {{ end }} {{ define "extrameta" }} {{ template "repo/pulls/fragments/og" (dict "RepoInfo" .RepoInfo "Pull" .Pull) }} {{ end }} {{ define "mainLayout" }}
{{ block "contentLayout" . }} {{ block "content" . }}{{ end }} {{ end }}
{{ block "contentAfterLayout" . }}
{{ block "contentAfter" . }}{{ end }}
{{ end }}
{{ end }} {{ define "repoContentLayout" }}
{{ block "repoContent" . }}{{ end }}
{{ template "repo/fragments/labelPanel" (dict "RepoInfo" $.RepoInfo "Defs" $.LabelDefs "Subject" $.Pull.AtUri "State" $.Pull.Labels) }} {{ template "repo/fragments/participants" $.Pull.Participants }} {{ template "repo/fragments/backlinks" (dict "RepoInfo" $.RepoInfo "Backlinks" $.Backlinks) }} {{ template "repo/fragments/externalLinkPanel" $.Pull.AtUri }}
{{ end }} {{ define "contentAfter" }} {{ template "repo/fragments/diff" (list .Diff .DiffOpts $) }} {{ end }} {{ define "repoContent" }} {{ template "repo/pulls/fragments/pullHeader" . }} {{ if .Pull.IsStacked }}
{{ template "repo/pulls/fragments/pullStack" . }}
{{ end }} {{ end }} {{ define "resize-grip" }} {{ $id := index . 0 }} {{ $target := index . 1 }} {{ $direction := index . 2 }} {{ end }} {{ define "diffLayout" }} {{ $diff := index . 0 }} {{ $opts := index . 1 }} {{ $root := index . 2 }}
{{ template "resize-grip" (list "resize-files" "files" "before") }}
{{ template "diffFiles" (list $diff $opts) }}
{{ template "resize-grip" (list "resize-subs" "subs" "after") }} {{ template "subsPanel" $ }}
{{ end }} {{ define "subsPanel" }} {{ $root := index . 2 }} {{ $pull := $root.Pull }}

History

{{ template "subsPanelSummary" $ }}
{{ template "submissions" $root }}
{{ end }} {{ define "subsPanelSummary" }} {{ $root := index . 2 }} {{ $pull := $root.Pull }} {{ $rounds := len $pull.Submissions }} {{ $comments := $pull.TotalComments }}
{{ $rounds }} round{{ if ne $rounds 1 }}s{{ end }} {{ $comments }} comment{{ if ne $comments 1 }}s{{ end }} {{ i "chevron-up" "size-4" }}
{{ end }} {{ define "subsCheckbox" }} {{ end }} {{ define "subsToggle" }} {{ end }} {{ define "submissions" }} {{ $lastIdx := sub (len .Pull.Submissions) 1 }} {{ if not .LoggedInUser }} {{ template "loginPrompt" $ }} {{ end }} {{ range $ridx, $item := reverse .Pull.Submissions }} {{ $idx := sub $lastIdx $ridx }} {{ template "submission" (list $item $idx $lastIdx $) }} {{ end }} {{ end }} {{ define "submission" }} {{ $item := index . 0 }} {{ $idx := index . 1 }} {{ $lastIdx := index . 2 }} {{ $root := index . 3 }} {{ $round := $item.RoundNumber }}
{{ template "submissionHeader" $ }} {{ template "submissionComments" $ }}
{{ end }} {{ define "submissionHeader" }} {{ $item := index . 0 }} {{ $lastIdx := index . 2 }} {{ $root := index . 3 }} {{ $round := $item.RoundNumber }}
{{ template "user/fragments/picLink" (list $root.Pull.OwnerDid "size-8") }}
{{ template "submissionInfo" $ }} {{ template "submissionCommits" $ }} {{ template "submissionPipeline" $ }} {{ if eq $lastIdx $round }} {{ block "mergeCheck" $root }} {{ end }} {{ end }}
{{ end }} {{ define "submissionInfo" }} {{ $item := index . 0 }} {{ $idx := index . 1 }} {{ $root := index . 3 }} {{ $round := $item.RoundNumber }}
{{ $handle := resolve $root.Pull.OwnerDid }} {{ $handle }} submitted #{{ $round }} {{ template "repo/fragments/shortTime" $item.Created }}
{{ if ne $root.ActiveRound $round }} {{ i "diff" "w-4 h-4" }} diff {{ end }} {{ if ne $idx 0 }} {{ i "chevrons-left-right-ellipsis" "w-4 h-4 rotate-90" }} interdiff {{ end }}
{{ end }} {{ define "submissionCommits" }} {{ $item := index . 0 }} {{ $root := index . 3 }} {{ $round := $item.RoundNumber }} {{ $patches := $item.AsFormatPatch }} {{ if $patches }}
{{ i "git-commit-horizontal" "w-4 h-4" }} {{ len $patches }} commit{{ if ne (len $patches) 1 }}s{{ end }}
expand
{{ range $patches }} {{ template "submissionCommit" (list . $item $root) }} {{ end }}
{{ end }} {{ end }} {{ define "submissionCommit" }} {{ $patch := index . 0 }} {{ $item := index . 1 }} {{ $root := index . 2 }} {{ $round := $item.RoundNumber }} {{ with $patch }}
{{ $fullRepo := "" }} {{ if and $root.Pull.IsForkBased $root.Pull.PullSource.Repo }} {{ $fullRepo = printf "%s/%s" $root.Pull.OwnerDid $root.Pull.PullSource.Repo.Name }} {{ else if $root.Pull.IsBranchBased }} {{ $fullRepo = $root.RepoInfo.FullName }} {{ end }} {{ if $fullRepo }} {{ slice .SHA 0 8 }} {{ else }} {{ slice .SHA 0 8 }} {{ end }}
{{ .Title | description }} {{ if gt (len .Body) 0 }} {{ end }} {{ if gt (len .Body) 0 }} {{ end }}
{{ end }} {{ end }} {{ define "mergeCheck" }} {{ $isOpen := .Pull.State.IsOpen }} {{ if and $isOpen .MergeCheck .MergeCheck.Error }}
{{ i "triangle-alert" "w-4 h-4 text-red-600 dark:text-red-500" }} {{ .MergeCheck.Error }}
{{ else if and $isOpen .MergeCheck .MergeCheck.IsConflicted }}
{{ i "triangle-alert" "text-red-600 dark:text-red-500 w-4 h-4" }} merge conflicts detected
expand
{{ if gt (len .MergeCheck.Conflicts) 0 }} {{ end }}
{{ else if and $isOpen .MergeCheck }}
{{ i "check" "w-4 h-4 text-green-600 dark:text-green-500" }} no conflicts, ready to merge
{{ end }} {{ end }} {{ define "mergeStatus" }} {{ if .Pull.State.IsClosed }}
{{ i "ban" "w-4 h-4" }} closed without merging
{{ else if .Pull.State.IsMerged }}
{{ i "git-merge" "w-4 h-4" }} pull request successfully merged
{{ else if .Pull.State.IsDeleted }}
{{ i "git-pull-request-closed" "w-4 h-4" }} This pull has been deleted (possibly by jj abandon or jj squash)
{{ end }} {{ end }} {{ define "resubmitStatus" }} {{ if .ResubmitCheck.Yes }}
{{ i "triangle-alert" "w-4 h-4" }} this branch has been updated, consider resubmitting
{{ end }} {{ end }} {{ define "submissionPipeline" }} {{ $item := index . 0 }} {{ $root := index . 3 }} {{ $pipeline := index $root.Pipelines $item.SourceRev }} {{ with $pipeline }} {{ $id := .Id }} {{ if .Statuses }}
{{ template "repo/pipelines/fragments/pipelineSymbol" (dict "Pipeline" $pipeline "ShortSummary" false) }}
expand
{{ range $name, $all := .Statuses }}
{{ $lastStatus := $all.Latest }} {{ $kind := $lastStatus.Status.String }}
{{ template "repo/pipelines/fragments/workflowSymbol" $all }} {{ $name }}
{{ end }}
{{ end }} {{ end }} {{ end }} {{ define "submissionComments" }} {{ $item := index . 0 }} {{ $idx := index . 1 }} {{ $lastIdx := index . 2 }} {{ $root := index . 3 }} {{ $round := $item.RoundNumber }} {{ $c := len $item.Comments }}
{{ i "circle-plus" "size-4 z-5" }} expand {{ $c }} comment{{ if ne $c 1 }}s{{ end }}
{{ range $item.Comments }} {{ template "submissionComment" . }} {{ end }}
{{ if eq $lastIdx $item.RoundNumber }} {{ block "mergeStatus" $root }} {{ end }} {{ block "resubmitStatus" $root }} {{ end }} {{ end }}
{{ if $root.LoggedInUser }} {{ template "repo/pulls/fragments/pullActions" (dict "LoggedInUser" $root.LoggedInUser "Pull" $root.Pull "RepoInfo" $root.RepoInfo "RoundNumber" $item.RoundNumber "MergeCheck" $root.MergeCheck "ResubmitCheck" $root.ResubmitCheck "BranchDeleteStatus" $root.BranchDeleteStatus "Stack" $root.Stack) }} {{ end }}
{{ end }} {{ define "submissionComment" }}
{{ template "user/fragments/picLink" (list .OwnerDid "size-8") }}
{{ .Body | markdown }}
{{ end }} {{ define "loginPrompt" }}
sign up or login to add to the discussion
{{ end }}