From 1b4e3e30f176718abf83a537082b751819d1dda3 Mon Sep 17 00:00:00 2001 From: Jimmy Praet Date: Sat, 17 Feb 2024 00:07:19 +0100 Subject: [PATCH 1/2] Show outdated comments when (un)resolving conversation on PR timeline --- routers/web/repo/pull_review.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/routers/web/repo/pull_review.go b/routers/web/repo/pull_review.go index 217f2dea6d07c..f84510b39d85d 100644 --- a/routers/web/repo/pull_review.go +++ b/routers/web/repo/pull_review.go @@ -156,7 +156,8 @@ func UpdateResolveConversation(ctx *context.Context) { func renderConversation(ctx *context.Context, comment *issues_model.Comment, origin string) { ctx.Data["PageIsPullFiles"] = origin == "diff" - comments, err := issues_model.FetchCodeCommentsByLine(ctx, comment.Issue, ctx.Doer, comment.TreePath, comment.Line, ctx.Data["ShowOutdatedComments"].(bool)) + showOutdatedComments := origin == "timeline" || ctx.Data["ShowOutdatedComments"].(bool) + comments, err := issues_model.FetchCodeCommentsByLine(ctx, comment.Issue, ctx.Doer, comment.TreePath, comment.Line, showOutdatedComments) if err != nil { ctx.ServerError("FetchCodeCommentsByLine", err) return From cedee0abbab89cd31909d00de70b274a6fc5c032 Mon Sep 17 00:00:00 2001 From: Jimmy Praet Date: Sat, 17 Feb 2024 10:39:24 +0100 Subject: [PATCH 2/2] Update the test --- routers/web/repo/pull_review_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routers/web/repo/pull_review_test.go b/routers/web/repo/pull_review_test.go index 65019af40b168..7e6594774a848 100644 --- a/routers/web/repo/pull_review_test.go +++ b/routers/web/repo/pull_review_test.go @@ -68,9 +68,9 @@ func TestRenderConversation(t *testing.T) { renderConversation(ctx, preparedComment, "timeline") assert.Contains(t, resp.Body.String(), `