From 725bd11ace515c67caa3c049dc7edb7673252a69 Mon Sep 17 00:00:00 2001 From: Liam Jarvis Date: Wed, 27 Dec 2023 15:59:07 +0900 Subject: [PATCH] feat: Show resolved by on review threads This commit shows who resolved the thread on the buffer Signed-off-by: Liam Jarvis --- lua/octo/gh/graphql.lua | 2 ++ lua/octo/ui/writers.lua | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/lua/octo/gh/graphql.lua b/lua/octo/gh/graphql.lua index be5c4ae1..e9652335 100644 --- a/lua/octo/gh/graphql.lua +++ b/lua/octo/gh/graphql.lua @@ -183,6 +183,7 @@ M.start_review_mutation = [[ diffSide startDiffSide isResolved + resolvedBy { login } isCollapsed isOutdated comments(first:100) { @@ -1414,6 +1415,7 @@ query { startLine originalStartLine isResolved + resolvedBy { login } isCollapsed isOutdated comments(first:100) { diff --git a/lua/octo/ui/writers.lua b/lua/octo/ui/writers.lua index f1a7e490..dc53974f 100644 --- a/lua/octo/ui/writers.lua +++ b/lua/octo/ui/writers.lua @@ -851,6 +851,12 @@ function M.write_review_thread_header(bufnr, opts, line) -- ) --vim.list_extend(header_vt, resolved_bubble) vim.list_extend(header_vt, { { conf.resolved_icon, "OctoGreen" } }) + if opts.resolvedBy then + vim.list_extend( + header_vt, + { { " [Resolved by: ", "OctoSymbol" }, { opts.resolvedBy.login, "OctoDetailsLabel" }, { "] ", "OctoSymbol" } } + ) + end end M.write_block(bufnr, { "" }) @@ -1312,6 +1318,7 @@ function M.write_threads(bufnr, threads) end_line = end_line, isOutdated = thread.isOutdated, isResolved = thread.isResolved, + resolvedBy = thread.resolvedBy, commit = comment.originalCommit.abbreviatedOid, })