feat(ui): create a comment aggregator to reduce noise in issues (#6523)

Closes: https://codeberg.org/forgejo/forgejo/issues/6042
Continuation of: https://codeberg.org/forgejo/forgejo/pulls/6284
Replaces: https://codeberg.org/forgejo/forgejo/pulls/6285
Context: https://codeberg.org/forgejo/forgejo/pulls/6284#issuecomment-2518599

Create a new type of comment: `CommentTypeAggregator`

Replaces the grouping of labels and review request in a single place: the comment aggregator

The whole list of comments is "scanned", if they can get aggregated (diff of time < 60secs, same poster, open / close issue, add / del labels, add /del review req), they are added to the aggregator.
Once needed, the list of all the aggregated comments are replaced with a single aggregated comment containing all the data required.

In templates, have a specific HTML rendering part for the comment aggregator, reuse the same rendering as with the other types of comments.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6523
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: Litchi Pi <litchi.pi@proton.me>
Co-committed-by: Litchi Pi <litchi.pi@proton.me>
This commit is contained in:
Litchi Pi 2025-03-05 17:24:51 +00:00 committed by 0ko
parent 2c27a0f727
commit dc7f5d6b84
8 changed files with 1264 additions and 1006 deletions

View file

@ -759,7 +759,7 @@ td .commit-summary {
.repository.view.issue .comment-list .timeline-item,
.repository.view.issue .comment-list .timeline-item-group {
padding: 16px 0;
padding: 0.65rem 0;
}
.repository.view.issue .comment-list .timeline-item-group .timeline-item {
@ -842,6 +842,18 @@ td .commit-summary {
margin-right: 0.25em;
}
.repository.view.issue .comment-list .timeline-item .aggregated-actions .badge {
width: 20px;
height: 20px;
margin-top: 5px;
padding: 12px;
}
.repository.view.issue .comment-list .timeline-item .aggregated-actions .badge .svg {
width: 20px;
height: 20px;
}
.singular-commit {
display: flex;
align-items: center;