Skip to content

Commit 6675ddc

Browse files
brymutwxiaoguang
andauthored
fix: Exclude code expansion arrows when DiffBlobExcerptData is not available. (#36060)
Resolves #35994 Do not render code expansion arrows when `DiffBlobExcerptData` is not available (code file preview, pull conversation diff comment). --------- Signed-off-by: wxiaoguang <[email protected]> Co-authored-by: wxiaoguang <[email protected]>
1 parent 5fdc848 commit 6675ddc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

templates/repo/diff/section_unified.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{$file := .file}}
2-
{{/* this tmpl is also used by the PR Conversation page, so the "AfterCommitID" and "DiffBlobExcerptData" may not exist */}}
2+
{{/* this tmpl is also used by the PR Conversation page, so "DiffBlobExcerptData" may not exist */}}
33
{{$diffBlobExcerptData := $.root.DiffBlobExcerptData}}
44
<colgroup>
55
<col width="50">
@@ -12,10 +12,10 @@
1212
{{range $k, $line := $section.Lines}}
1313
<tr class="{{.GetHTMLDiffLineType}}-code nl-{{$k}} ol-{{$k}}" data-line-type="{{.GetHTMLDiffLineType}}">
1414
{{if eq .GetType 4}}
15-
{{if $.root.AfterCommitID}}
15+
{{if $diffBlobExcerptData}}
1616
<td colspan="2" class="lines-num">{{$line.RenderBlobExcerptButtons $file.NameHash $diffBlobExcerptData}}</td>
1717
{{else}}
18-
{{/* for code file preview page or comment diffs on pull comment pages, do not show the expansion arrows */}}
18+
{{/* when DiffBlobExcerptData is not available (code file preview, pull conversation diff comment), do not show the expansion arrows */}}
1919
<td colspan="2" class="lines-num"></td>
2020
{{end}}
2121
{{else}}

0 commit comments

Comments
 (0)