Skip to content

Commit 3ff3c5b

Browse files
authored
Solving the issue of UI disruption when the review is deleted without refreshing (#29951) (#29968)
backport #29951
1 parent 58a0ba7 commit 3ff3c5b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

web_src/js/features/repo-issue.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ export function initRepoIssueCommentDelete() {
162162
_csrf: csrfToken,
163163
}).done(() => {
164164
const $conversationHolder = $this.closest('.conversation-holder');
165-
165+
const $parentTimelineItem = $this.closest('.timeline-item');
166+
const $parentTimelineGroup = $this.closest('.timeline-item-group');
166167
// Check if this was a pending comment.
167168
if ($conversationHolder.find('.pending-label').length) {
168169
const $counter = $('#review-box .review-comments-counter');
@@ -185,6 +186,11 @@ export function initRepoIssueCommentDelete() {
185186
}
186187
$conversationHolder.remove();
187188
}
189+
// Check if there is no review content, move the time avatar upward to avoid overlapping the content below.
190+
if (!$parentTimelineGroup.find('.timeline-item.comment').length && !$parentTimelineItem.find('.conversation-holder').length) {
191+
const $timelineAvatar = $parentTimelineGroup.find('.timeline-avatar');
192+
$timelineAvatar.removeClass('timeline-avatar-offset');
193+
}
188194
});
189195
}
190196
return false;

0 commit comments

Comments
 (0)