loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Solving the issue of UI disruption when the review is deleted without refreshing (#29951)

**After deleting the review and refreshing, the display is normal.
However, Without refreshing, the interface will be broken**

https://github.com/go-gitea/gitea/assets/37935145/f5cb19a6-eb26-47b0-b8ee-15b575bbe1ac

**after**

https://github.com/go-gitea/gitea/assets/37935145/aa65922c-2ebf-4fce-ad91-35661f70329a

(cherry picked from commit 0b4ff15356769db092fd7718da553e8a216c32fa)

authored by

HEREYUA and committed by
Earl Warren
0f461400 faed9337

+7 -1
+7 -1
web_src/js/features/repo-issue.js
··· 162 162 const response = await POST($this.data('url')); 163 163 if (!response.ok) throw new Error('Failed to delete comment'); 164 164 const $conversationHolder = $this.closest('.conversation-holder'); 165 - 165 + const $parentTimelineItem = $this.closest('.timeline-item'); 166 + const $parentTimelineGroup = $this.closest('.timeline-item-group'); 166 167 // Check if this was a pending comment. 167 168 if ($conversationHolder.find('.pending-label').length) { 168 169 const $counter = $('#review-box .review-comments-counter'); ··· 184 185 $(`[data-path="${path}"] .add-code-comment[data-side="${side}"][data-idx="${idx}"]`).removeClass('tw-invisible'); 185 186 } 186 187 $conversationHolder.remove(); 188 + } 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'); 187 193 } 188 194 } catch (error) { 189 195 console.error(error);