Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
17be181
feat(diff): Enable commenting on expanded lines in PR diffs
brymut Oct 14, 2025
1b9ac2c
feat(gitdiff): Use generatePatchForUnchangedLine instead to generate …
brymut Oct 16, 2025
8216008
fix(PR): Add permission check
brymut Oct 16, 2025
30e3fd1
fix(diff): update hidden comment count on code expand buttons
brymut Oct 16, 2025
b234f31
feat(gitdiff): fix code context in conversation tab
brymut Oct 16, 2025
4b85c50
fix(gitdiff): remove patching logic duplication
brymut Oct 17, 2025
2c33c7d
feat(diff): Enhance hidden comment expansion when sharing link
brymut Oct 18, 2025
19ed046
fix: highlighting to shared hidden comments
brymut Oct 18, 2025
3e0c892
test(diff): add tests for helper functions in ExcerptBlob
brymut Oct 18, 2025
aafa231
refactor(gitdiff): Extract hidden comment calculation to shared metho…
brymut Oct 18, 2025
fd2fc61
clean up code-expander-button
wxiaoguang Oct 18, 2025
a95ebbb
fix
wxiaoguang Oct 18, 2025
38d40a6
fix tmpl var
wxiaoguang Oct 18, 2025
6408c43
add missing comment
wxiaoguang Oct 18, 2025
bbd4799
fine tune tests
wxiaoguang Oct 18, 2025
c0b8201
remove unnecessary code
wxiaoguang Oct 18, 2025
590df91
fix: handle righthunksize == 0 scenario
brymut Oct 18, 2025
d1fc0d7
fine tune
wxiaoguang Oct 19, 2025
9356dbe
fix: remove reduntant test
brymut Oct 19, 2025
78cd2ce
fix(gitdiff): fix line number handling in `FillHiddenCommentIDsForDif…
brymut Oct 19, 2025
bb714b4
fine tune
wxiaoguang Oct 19, 2025
c5c1c2b
Merge branch 'main' into enable-commenting-unchanged-line
wxiaoguang Oct 19, 2025
af864c2
fix assumption
wxiaoguang Oct 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions routers/web/repo/compare.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"net/http"
"net/url"
"path/filepath"
"sort"
"strings"

"code.gitea.io/gitea/models/db"
Expand Down Expand Up @@ -43,6 +44,7 @@ import (
"code.gitea.io/gitea/services/context/upload"
"code.gitea.io/gitea/services/gitdiff"
pull_service "code.gitea.io/gitea/services/pull"
user_service "code.gitea.io/gitea/services/user"
)

const (
Expand Down Expand Up @@ -947,6 +949,41 @@ func ExcerptBlob(ctx *context.Context) {
section.Lines = append(section.Lines, lineSection)
}
}
if ctx.Doer != nil {
ctx.Data["SignedUserID"] = ctx.Doer.ID
}
isPull := ctx.FormBool("is_pull")
ctx.Data["PageIsPullFiles"] = isPull

if isPull {
issueIndex := ctx.FormInt64("issue_index")
ctx.Data["IssueIndex"] = issueIndex
if issueIndex > 0 {
if issue, err := issues_model.GetIssueByIndex(ctx, ctx.Repo.Repository.ID, issueIndex); err == nil && issue.IsPull {
ctx.Data["Issue"] = issue
ctx.Data["CanBlockUser"] = func(blocker, blockee *user_model.User) bool {
return user_service.CanBlockUser(ctx, ctx.Doer, blocker, blockee)
}

if allComments, err := issues_model.FetchCodeComments(ctx, issue, ctx.Doer, ctx.FormBool("show_outdated")); err == nil {
if lineComments, ok := allComments[filePath]; ok {
for _, line := range section.Lines {
if comments, ok := lineComments[int64(line.LeftIdx*-1)]; ok {
line.Comments = append(line.Comments, comments...)
}
if comments, ok := lineComments[int64(line.RightIdx)]; ok {
line.Comments = append(line.Comments, comments...)
}
sort.SliceStable(line.Comments, func(i, j int) bool {
return line.Comments[i].CreatedUnix < line.Comments[j].CreatedUnix
})
}
}
}
}
}
}

ctx.Data["section"] = section
ctx.Data["FileNameHash"] = git.HashFilePathForWebUI(filePath)
ctx.Data["AfterCommitID"] = commitID
Expand Down
136 changes: 120 additions & 16 deletions services/gitdiff/gitdiff.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,15 @@ const (

// DiffLine represents a line difference in a DiffSection.
type DiffLine struct {
LeftIdx int // line number, 1-based
RightIdx int // line number, 1-based
Match int // the diff matched index. -1: no match. 0: plain and no need to match. >0: for add/del, "Lines" slice index of the other side
Type DiffLineType
Content string
Comments issues_model.CommentList // related PR code comments
SectionInfo *DiffLineSectionInfo
LeftIdx int // line number, 1-based
RightIdx int // line number, 1-based
Match int // the diff matched index. -1: no match. 0: plain and no need to match. >0: for add/del, "Lines" slice index of the other side
Type DiffLineType
Content string
Comments issues_model.CommentList // related PR code comments
SectionInfo *DiffLineSectionInfo
HasHiddenComments bool // indicates if this expand button has comments in hidden lines
HiddenCommentCount int // number of hidden comments in this section
}

// DiffLineSectionInfo represents diff line section meta data
Expand Down Expand Up @@ -485,6 +487,25 @@ func (diff *Diff) LoadComments(ctx context.Context, issue *issues_model.Issue, c
sort.SliceStable(line.Comments, func(i, j int) bool {
return line.Comments[i].CreatedUnix < line.Comments[j].CreatedUnix
})

// Mark expand buttons that have comments in hidden lines
if line.Type == DiffLineSection && line.SectionInfo != nil {
hiddenCommentCount := 0
// Check if there are comments in the hidden range
for commentLineNum := range lineCommits {
absLineNum := int(commentLineNum)
if commentLineNum < 0 {
absLineNum = int(-commentLineNum)
}
if absLineNum > line.SectionInfo.LastRightIdx && absLineNum < line.SectionInfo.RightIdx {
hiddenCommentCount++
}
}
if hiddenCommentCount > 0 {
line.HasHiddenComments = true
line.HiddenCommentCount = hiddenCommentCount
}
}
}
}
}
Expand Down Expand Up @@ -1370,19 +1391,102 @@ outer:

// CommentAsDiff returns c.Patch as *Diff
func CommentAsDiff(ctx context.Context, c *issues_model.Comment) (*Diff, error) {
diff, err := ParsePatch(ctx, setting.Git.MaxGitDiffLines,
setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles, strings.NewReader(c.Patch), "")
// Try to parse existing patch first
if c.Patch != "" {
diff, err := ParsePatch(ctx, setting.Git.MaxGitDiffLines,
setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles, strings.NewReader(c.Patch), "")
if err == nil && len(diff.Files) > 0 && len(diff.Files[0].Sections) > 0 {
return diff, nil
}
}

// If patch is empty or invalid, generate code context for unchanged line comments
if c.TreePath != "" && c.CommitSHA != "" && c.Line != 0 {
return generateCodeContextForComment(ctx, c)
}

return nil, fmt.Errorf("no valid patch or context available for comment ID: %d", c.ID)
}

func generateCodeContextForComment(ctx context.Context, c *issues_model.Comment) (*Diff, error) {
if err := c.LoadIssue(ctx); err != nil {
return nil, fmt.Errorf("LoadIssue: %w", err)
}
if err := c.Issue.LoadRepo(ctx); err != nil {
return nil, fmt.Errorf("LoadRepo: %w", err)
}
if err := c.Issue.LoadPullRequest(ctx); err != nil {
return nil, fmt.Errorf("LoadPullRequest: %w", err)
}

pr := c.Issue.PullRequest
if err := pr.LoadBaseRepo(ctx); err != nil {
return nil, fmt.Errorf("LoadBaseRepo: %w", err)
}

gitRepo, closer, err := gitrepo.RepositoryFromContextOrOpen(ctx, pr.BaseRepo)
if err != nil {
log.Error("Unable to parse patch: %v", err)
return nil, err
return nil, fmt.Errorf("RepositoryFromContextOrOpen: %w", err)
}
if len(diff.Files) == 0 {
return nil, fmt.Errorf("no file found for comment ID: %d", c.ID)
defer closer.Close()

// Get the file content at the commit
commit, err := gitRepo.GetCommit(c.CommitSHA)
if err != nil {
return nil, fmt.Errorf("GetCommit: %w", err)
}

entry, err := commit.GetTreeEntryByPath(c.TreePath)
if err != nil {
return nil, fmt.Errorf("GetTreeEntryByPath: %w", err)
}

blob := entry.Blob()
dataRc, err := blob.DataAsync()
if err != nil {
return nil, fmt.Errorf("DataAsync: %w", err)
}
defer dataRc.Close()

// Read file lines
scanner := bufio.NewScanner(dataRc)
var lines []string
for scanner.Scan() {
lines = append(lines, scanner.Text())
}
if err := scanner.Err(); err != nil {
return nil, fmt.Errorf("scanner error: %w", err)
}
secs := diff.Files[0].Sections
if len(secs) == 0 {
return nil, fmt.Errorf("no sections found for comment ID: %d", c.ID)

// Validate comment line is within file bounds
commentLine := int(c.UnsignedLine())
if commentLine < 1 || commentLine > len(lines) {
return nil, fmt.Errorf("comment line %d is out of file bounds (1-%d)", commentLine, len(lines))
}

// Calculate line range to show (commented line + lines above it, matching CutDiffAroundLine behavior)
contextLines := setting.UI.CodeCommentLines
startLine := max(commentLine-contextLines, 1)
endLine := commentLine

var patchBuilder strings.Builder
patchBuilder.WriteString(fmt.Sprintf("diff --git a/%s b/%s\n", c.TreePath, c.TreePath))
patchBuilder.WriteString(fmt.Sprintf("--- a/%s\n", c.TreePath))
patchBuilder.WriteString(fmt.Sprintf("+++ b/%s\n", c.TreePath))
patchBuilder.WriteString(fmt.Sprintf("@@ -%d,%d +%d,%d @@\n", startLine, endLine-startLine+1, startLine, endLine-startLine+1))

for i := startLine - 1; i < endLine; i++ {
patchBuilder.WriteString(" ")
patchBuilder.WriteString(lines[i])
patchBuilder.WriteString("\n")
}

diff, err := ParsePatch(ctx, setting.Git.MaxGitDiffLines,
setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles, strings.NewReader(patchBuilder.String()), "")
if err != nil {
return nil, fmt.Errorf("ParsePatch: %w", err)
}

return diff, nil
}

Expand Down
46 changes: 42 additions & 4 deletions templates/repo/diff/blob_excerpt.tmpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{$blobExcerptLink := print $.RepoLink (Iif $.PageIsWiki "/wiki" "") "/blob_excerpt/" (PathEscape $.AfterCommitID) (QueryBuild "?" "anchor" $.Anchor)}}
{{$blobExcerptLink := print $.RepoLink (Iif $.PageIsWiki "/wiki" "") "/blob_excerpt/" (PathEscape $.AfterCommitID) "?" (Iif $.PageIsPullFiles (print "is_pull=true&issue_index=" $.IssueIndex "&") "")}}
{{if $.IsSplitStyle}}
{{range $k, $line := $.section.Lines}}
<tr class="{{.GetHTMLDiffLineType}}-code nl-{{$k}} ol-{{$k}} line-expanded">
<tr class="{{.GetHTMLDiffLineType}}-code nl-{{$k}} ol-{{$k}} line-expanded" data-line-type="{{.GetHTMLDiffLineType}}">
{{if eq .GetType 4}}
{{$expandDirection := $line.GetExpandDirection}}
<td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}">
Expand Down Expand Up @@ -33,6 +33,11 @@
<td class="lines-escape lines-escape-old">{{if and $line.LeftIdx $inlineDiff.EscapeStatus.Escaped}}<button class="toggle-escape-button btn interact-bg" title="{{template "repo/diff/escape_title" dict "diff" $inlineDiff}}"></button>{{end}}</td>
<td class="lines-type-marker lines-type-marker-old">{{if $line.LeftIdx}}<span class="tw-font-mono" data-type-marker=""></span>{{end}}</td>
<td class="lines-code lines-code-old">
{{- if and $.SignedUserID $.PageIsPullFiles $line.LeftIdx -}}
<button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-left{{if (not $line.CanComment)}} tw-invisible{{end}}" data-side="left" data-idx="{{$line.LeftIdx}}">
{{- svg "octicon-plus" -}}
</button>
{{- end -}}
{{- if $line.LeftIdx -}}
{{- template "repo/diff/section_code" dict "diff" $inlineDiff -}}
{{- else -}}
Expand All @@ -43,6 +48,11 @@
<td class="lines-escape lines-escape-new">{{if and $line.RightIdx $inlineDiff.EscapeStatus.Escaped}}<button class="toggle-escape-button btn interact-bg" title="{{template "repo/diff/escape_title" dict "diff" $inlineDiff}}"></button>{{end}}</td>
<td class="lines-type-marker lines-type-marker-new">{{if $line.RightIdx}}<span class="tw-font-mono" data-type-marker=""></span>{{end}}</td>
<td class="lines-code lines-code-new">
{{- if and $.SignedUserID $.PageIsPullFiles $line.RightIdx -}}
<button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-right{{if (not $line.CanComment)}} tw-invisible{{end}}" data-side="right" data-idx="{{$line.RightIdx}}">
{{- svg "octicon-plus" -}}
</button>
{{- end -}}
{{- if $line.RightIdx -}}
{{- template "repo/diff/section_code" dict "diff" $inlineDiff -}}
{{- else -}}
Expand All @@ -51,10 +61,24 @@
</td>
{{end}}
</tr>
{{if $line.Comments}}
<tr class="add-comment" data-line-type="{{.GetHTMLDiffLineType}}">
<td class="add-comment-left" colspan="4">
{{if eq $line.GetCommentSide "previous"}}
{{template "repo/diff/conversation" dict "." $ "comments" $line.Comments}}
{{end}}
</td>
<td class="add-comment-right" colspan="4">
{{if eq $line.GetCommentSide "proposed"}}
{{template "repo/diff/conversation" dict "." $ "comments" $line.Comments}}
{{end}}
</td>
</tr>
{{end}}
{{end}}
{{else}}
{{range $k, $line := $.section.Lines}}
<tr class="{{.GetHTMLDiffLineType}}-code nl-{{$k}} ol-{{$k}} line-expanded">
<tr class="{{.GetHTMLDiffLineType}}-code nl-{{$k}} ol-{{$k}} line-expanded" data-line-type="{{.GetHTMLDiffLineType}}">
{{if eq .GetType 4}}
{{$expandDirection := $line.GetExpandDirection}}
<td colspan="2" class="lines-num">
Expand Down Expand Up @@ -83,7 +107,21 @@
{{$inlineDiff := $.section.GetComputedInlineDiffFor $line ctx.Locale}}
<td class="lines-escape">{{if $inlineDiff.EscapeStatus.Escaped}}<button class="toggle-escape-button btn interact-bg" title="{{template "repo/diff/escape_title" dict "diff" $inlineDiff}}"></button>{{end}}</td>
<td class="lines-type-marker"><span class="tw-font-mono" data-type-marker="{{$line.GetLineTypeMarker}}"></span></td>
<td class="lines-code{{if (not $line.RightIdx)}} lines-code-old{{end}}"><code {{if $inlineDiff.EscapeStatus.Escaped}}class="code-inner has-escaped" title="{{template "repo/diff/escape_title" dict "diff" $inlineDiff}}"{{else}}class="code-inner"{{end}}>{{$inlineDiff.Content}}</code></td>
<td class="lines-code{{if (not $line.RightIdx)}} lines-code-old{{end}}">
{{- if and $.SignedUserID $.PageIsPullFiles -}}
<button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-{{if $line.RightIdx}}right{{else}}left{{end}}{{if (not $line.CanComment)}} tw-invisible{{end}}" data-side="{{if $line.RightIdx}}right{{else}}left{{end}}" data-idx="{{if $line.RightIdx}}{{$line.RightIdx}}{{else}}{{$line.LeftIdx}}{{end}}">
{{- svg "octicon-plus" -}}
</button>
{{- end -}}
<code {{if $inlineDiff.EscapeStatus.Escaped}}class="code-inner has-escaped" title="{{template "repo/diff/escape_title" dict "diff" $inlineDiff}}"{{else}}class="code-inner"{{end}}>{{$inlineDiff.Content}}</code>
</td>
</tr>
{{if $line.Comments}}
<tr class="add-comment" data-line-type="{{.GetHTMLDiffLineType}}">
<td class="add-comment-left add-comment-right" colspan="5">
{{template "repo/diff/conversation" dict "." $ "comments" $line.Comments}}
</td>
</tr>
{{end}}
{{end}}
{{end}}
11 changes: 7 additions & 4 deletions templates/repo/diff/section_split.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{$file := .file}}
{{$blobExcerptLink := print (or ctx.RootData.CommitRepoLink ctx.RootData.RepoLink) (Iif $.root.PageIsWiki "/wiki" "") "/blob_excerpt/" (PathEscape $.root.AfterCommitID) "?"}}
{{$blobExcerptLink := print (or ctx.RootData.CommitRepoLink ctx.RootData.RepoLink) (Iif $.root.PageIsWiki "/wiki" "") "/blob_excerpt/" (PathEscape $.root.AfterCommitID) "?" (Iif $.root.PageIsPullFiles (print "is_pull=true&issue_index=" $.root.Issue.Index "&") "")}}
<colgroup>
<col width="50">
<col width="10">
Expand All @@ -20,18 +20,21 @@
<td class="lines-num lines-num-old">
<div class="code-expander-buttons" data-expand-direction="{{$expandDirection}}">
{{if or (eq $expandDirection 3) (eq $expandDirection 5)}}
<button class="code-expander-button" hx-target="closest tr" hx-get="{{$blobExcerptLink}}&{{$line.GetBlobExcerptQuery}}&style=split&direction=down&&anchor=diff-{{$file.NameHash}}K{{$line.SectionInfo.RightIdx}}">
<button class="code-expander-button{{if $line.HasHiddenComments}} has-hidden-comments{{end}}" hx-target="closest tr" hx-get="{{$blobExcerptLink}}&{{$line.GetBlobExcerptQuery}}&style=split&direction=down&&anchor=diff-{{$file.NameHash}}K{{$line.SectionInfo.RightIdx}}" title="{{if $line.HasHiddenComments}}{{$line.HiddenCommentCount}} hidden comment(s){{end}}">
{{svg "octicon-fold-down"}}
{{if $line.HasHiddenComments}}<span class="ui mini label">{{$line.HiddenCommentCount}}</span>{{end}}
</button>
{{end}}
{{if or (eq $expandDirection 3) (eq $expandDirection 4)}}
<button class="code-expander-button" hx-target="closest tr" hx-get="{{$blobExcerptLink}}&{{$line.GetBlobExcerptQuery}}&style=split&direction=up&anchor=diff-{{$file.NameHash}}K{{$line.SectionInfo.RightIdx}}">
<button class="code-expander-button{{if $line.HasHiddenComments}} has-hidden-comments{{end}}" hx-target="closest tr" hx-get="{{$blobExcerptLink}}&{{$line.GetBlobExcerptQuery}}&style=split&direction=up&anchor=diff-{{$file.NameHash}}K{{$line.SectionInfo.RightIdx}}" title="{{if $line.HasHiddenComments}}{{$line.HiddenCommentCount}} hidden comment(s){{end}}">
{{svg "octicon-fold-up"}}
{{if $line.HasHiddenComments}}<span class="ui mini label">{{$line.HiddenCommentCount}}</span>{{end}}
</button>
{{end}}
{{if eq $expandDirection 2}}
<button class="code-expander-button" hx-target="closest tr" hx-get="{{$blobExcerptLink}}&{{$line.GetBlobExcerptQuery}}&style=split&anchor=diff-{{$file.NameHash}}K{{$line.SectionInfo.RightIdx}}">
<button class="code-expander-button{{if $line.HasHiddenComments}} has-hidden-comments{{end}}" hx-target="closest tr" hx-get="{{$blobExcerptLink}}&{{$line.GetBlobExcerptQuery}}&style=split&anchor=diff-{{$file.NameHash}}K{{$line.SectionInfo.RightIdx}}" title="{{if $line.HasHiddenComments}}{{$line.HiddenCommentCount}} hidden comment(s){{end}}">
{{svg "octicon-fold"}}
{{if $line.HasHiddenComments}}<span class="ui mini label">{{$line.HiddenCommentCount}}</span>{{end}}
</button>
{{end}}
</div>
Expand Down
11 changes: 7 additions & 4 deletions templates/repo/diff/section_unified.tmpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{$file := .file}}
{{$repoLink := or ctx.RootData.CommitRepoLink ctx.RootData.RepoLink}}
{{$afterCommitID := or $.root.AfterCommitID "no-after-commit-id"}}{{/* this tmpl is also used by the PR Conversation page, so the "AfterCommitID" may not exist */}}
{{$blobExcerptLink := print $repoLink (Iif $.root.PageIsWiki "/wiki" "") "/blob_excerpt/" (PathEscape $afterCommitID) "?"}}
{{$blobExcerptLink := print $repoLink (Iif $.root.PageIsWiki "/wiki" "") "/blob_excerpt/" (PathEscape $afterCommitID) "?" (Iif $.root.PageIsPullFiles (print "is_pull=true&issue_index=" $.root.Issue.Index "&") "")}}
<colgroup>
<col width="50">
<col width="50">
Expand All @@ -18,18 +18,21 @@
<td colspan="2" class="lines-num">
<div class="code-expander-buttons" data-expand-direction="{{$expandDirection}}">
{{if or (eq $expandDirection 3) (eq $expandDirection 5)}}
<button class="code-expander-button" hx-target="closest tr" hx-get="{{$blobExcerptLink}}&{{$line.GetBlobExcerptQuery}}&style=unified&direction=down&anchor=diff-{{$file.NameHash}}K{{$line.SectionInfo.RightIdx}}">
<button class="code-expander-button{{if $line.HasHiddenComments}} has-hidden-comments{{end}}" hx-target="closest tr" hx-get="{{$blobExcerptLink}}&{{$line.GetBlobExcerptQuery}}&style=unified&direction=down&anchor=diff-{{$file.NameHash}}K{{$line.SectionInfo.RightIdx}}" title="{{if $line.HasHiddenComments}}{{$line.HiddenCommentCount}} hidden comment(s){{end}}">
{{svg "octicon-fold-down"}}
{{if $line.HasHiddenComments}}<span class="ui mini label">{{$line.HiddenCommentCount}}</span>{{end}}
</button>
{{end}}
{{if or (eq $expandDirection 3) (eq $expandDirection 4)}}
<button class="code-expander-button" hx-target="closest tr" hx-get="{{$blobExcerptLink}}&{{$line.GetBlobExcerptQuery}}&style=unified&direction=up&anchor=diff-{{$file.NameHash}}K{{$line.SectionInfo.RightIdx}}">
<button class="code-expander-button{{if $line.HasHiddenComments}} has-hidden-comments{{end}}" hx-target="closest tr" hx-get="{{$blobExcerptLink}}&{{$line.GetBlobExcerptQuery}}&style=unified&direction=up&anchor=diff-{{$file.NameHash}}K{{$line.SectionInfo.RightIdx}}" title="{{if $line.HasHiddenComments}}{{$line.HiddenCommentCount}} hidden comment(s){{end}}">
{{svg "octicon-fold-up"}}
{{if $line.HasHiddenComments}}<span class="ui mini label">{{$line.HiddenCommentCount}}</span>{{end}}
</button>
{{end}}
{{if eq $expandDirection 2}}
<button class="code-expander-button" hx-target="closest tr" hx-get="{{$blobExcerptLink}}&{{$line.GetBlobExcerptQuery}}&style=unified&anchor=diff-{{$file.NameHash}}K{{$line.SectionInfo.RightIdx}}">
<button class="code-expander-button{{if $line.HasHiddenComments}} has-hidden-comments{{end}}" hx-target="closest tr" hx-get="{{$blobExcerptLink}}&{{$line.GetBlobExcerptQuery}}&style=unified&anchor=diff-{{$file.NameHash}}K{{$line.SectionInfo.RightIdx}}" title="{{if $line.HasHiddenComments}}{{$line.HiddenCommentCount}} hidden comment(s){{end}}">
{{svg "octicon-fold"}}
{{if $line.HasHiddenComments}}<span class="ui mini label">{{$line.HiddenCommentCount}}</span>{{end}}
</button>
{{end}}
</div>
Expand Down
1 change: 1 addition & 0 deletions web_src/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
@import "./repo/clone.css";
@import "./repo/commit-sign.css";
@import "./repo/packages.css";
@import "./repo/diff-hidden-comments.css";

@import "./editor/fileeditor.css";
@import "./editor/combomarkdowneditor.css";
Expand Down
Loading