@@ -88,8 +88,9 @@ type DiffLine struct {
8888 Content string
8989 Comments issues_model.CommentList // related PR code comments
9090 SectionInfo * DiffLineSectionInfo
91- HasHiddenComments bool // indicates if this expand button has comments in hidden lines
92- HiddenCommentCount int // number of hidden comments in this section
91+ HasHiddenComments bool // indicates if this expand button has comments in hidden lines
92+ HiddenCommentCount int // number of hidden comments in this section
93+ HiddenCommentIDs []int64 // IDs of hidden comments in this section
9394}
9495
9596// DiffLineSectionInfo represents diff line section meta data
@@ -491,19 +492,25 @@ func (diff *Diff) LoadComments(ctx context.Context, issue *issues_model.Issue, c
491492 // Mark expand buttons that have comments in hidden lines
492493 if line .Type == DiffLineSection && line .SectionInfo != nil {
493494 hiddenCommentCount := 0
495+ var hiddenCommentIDs []int64
494496 // Check if there are comments in the hidden range
495- for commentLineNum := range lineCommits {
497+ for commentLineNum , comments := range lineCommits {
496498 absLineNum := int (commentLineNum )
497499 if commentLineNum < 0 {
498500 absLineNum = int (- commentLineNum )
499501 }
500502 if absLineNum > line .SectionInfo .LastRightIdx && absLineNum < line .SectionInfo .RightIdx {
501503 hiddenCommentCount ++
504+ // Collect comment IDs
505+ for _ , comment := range comments {
506+ hiddenCommentIDs = append (hiddenCommentIDs , comment .ID )
507+ }
502508 }
503509 }
504510 if hiddenCommentCount > 0 {
505511 line .HasHiddenComments = true
506512 line .HiddenCommentCount = hiddenCommentCount
513+ line .HiddenCommentIDs = hiddenCommentIDs
507514 }
508515 }
509516 }
0 commit comments