From edf2fc30b823d27d3933855a9746d2fd392b205c Mon Sep 17 00:00:00 2001 From: wbtiger <28288271@qq.com> Date: Tue, 2 Jun 2026 22:03:04 +0800 Subject: [PATCH] fix: pr +review now posts a journal comment alongside the formal review The GitLink API has two separate systems for PR feedback: - POST /pulls/:id/reviews creates a formal review (approve/reject/comment) that only appears in the "Reviews" panel - POST /issues/:issueID/journals creates a comment visible in the main PR conversation tab Previously, `pr +review` only called the reviews API, so the review content was invisible to the contributor in the main PR conversation. Now it also posts a journal summary so the review is visible where contributors expect to see it. Co-Authored-By: Claude Opus 4.7 --- shortcuts/pr/pr.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/shortcuts/pr/pr.go b/shortcuts/pr/pr.go index 5fd983b..4dc384f 100644 --- a/shortcuts/pr/pr.go +++ b/shortcuts/pr/pr.go @@ -328,6 +328,20 @@ func Shortcuts() []*common.Shortcut { if err != nil { return err } + + // Also post a journal comment so the review is visible in the PR conversation. + prEnv, journalErr := ctx.CallAPI("GET", fmt.Sprintf("%s/pulls/%s", ctx.RepoPath(), id), nil) + if journalErr == nil { + if issueID, extractErr := extractIssueID(prEnv); extractErr == nil { + statusLabel := map[string]string{ + "approved": "approved", "rejected": "rejected", "common": "commented", + }[status] + summary := fmt.Sprintf("## Review: %s\n\n%s", statusLabel, content) + ctx.CallAPI("POST", fmt.Sprintf("/v1/%s/%s/issues/%d/journals", ctx.Owner, ctx.Repo, issueID), + map[string]interface{}{"notes": summary}) + } + } + return ctx.Output(env) }, },