From 6675ddc117939c616f1b460ba71f6fc17788e8c0 Mon Sep 17 00:00:00 2001 From: Bryan Mutai Date: Fri, 5 Dec 2025 07:07:22 +0300 Subject: [PATCH] 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 Co-authored-by: wxiaoguang --- templates/repo/diff/section_unified.tmpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/repo/diff/section_unified.tmpl b/templates/repo/diff/section_unified.tmpl index 908b14656e..6776198b75 100644 --- a/templates/repo/diff/section_unified.tmpl +++ b/templates/repo/diff/section_unified.tmpl @@ -1,5 +1,5 @@ {{$file := .file}} -{{/* this tmpl is also used by the PR Conversation page, so the "AfterCommitID" and "DiffBlobExcerptData" may not exist */}} +{{/* this tmpl is also used by the PR Conversation page, so "DiffBlobExcerptData" may not exist */}} {{$diffBlobExcerptData := $.root.DiffBlobExcerptData}} @@ -12,10 +12,10 @@ {{range $k, $line := $section.Lines}} {{if eq .GetType 4}} - {{if $.root.AfterCommitID}} + {{if $diffBlobExcerptData}} {{$line.RenderBlobExcerptButtons $file.NameHash $diffBlobExcerptData}} {{else}} - {{/* for code file preview page or comment diffs on pull comment pages, do not show the expansion arrows */}} + {{/* when DiffBlobExcerptData is not available (code file preview, pull conversation diff comment), do not show the expansion arrows */}} {{end}} {{else}}