Skip to content

feat: add PR review comments sidebar panel#213

Open
eugenioenko wants to merge 1 commit into
mainfrom
feat/pr-comments-sidebar
Open

feat: add PR review comments sidebar panel#213
eugenioenko wants to merge 1 commit into
mainfrom
feat/pr-comments-sidebar

Conversation

@eugenioenko

Copy link
Copy Markdown
Owner

Summary

  • Add a new Reviews sidebar panel that displays PR review comments when a pull request is loaded
  • Fetch both inline review comments and general issue comments from GitHub via gh api
  • Display comments grouped by file (inline) with a "General" section for issue-level comments
  • Add input widget at the bottom for posting new general comments to the PR
  • Wire into existing PR loading flow: comments are fetched automatically when a PR is opened via Changes panel

Changes

  • internal/github/github.go -- New PRComment type, FetchPRComments, AddPRComment, AddPRInlineComment functions
  • internal/ui/reviews_widget.go -- New ReviewsWidget using BaseWidget + SelectableList pattern with scrollbar, input, and file grouping
  • internal/app/widgets.go -- Register Reviews panel in sidebar via sidebar.AddPanel("reviews", "Reviews", reviews)
  • internal/app/app.go -- Add Reviews field to App struct
  • internal/app/callbacks.go -- Wire OnOpenFile (navigate to file:line) and OnAddComment (post comment via GitHub API)
  • internal/app/pr.go -- New PRCommentsFetchResult and PRCommentAddResult event types, FetchPRComments/RefreshPRComments methods
  • internal/app/eventloop.go -- Handle comment fetch/add results; auto-fetch comments when PR is loaded
  • internal/app/commands_git.go -- Register reviews.refresh command
  • tests/e2e/sidebar_test.go -- Update overflow test for 4-panel sidebar

Test plan

  • Unit tests for PRComment type and JSON parsing (internal/github/github_test.go)
  • Unit tests for ReviewsWidget creation, comment grouping, rendering, selection styles, callbacks, and loading state (internal/ui/reviews_widget_test.go)
  • E2E sidebar overflow test updated for 4 panels (tests/e2e/sidebar_test.go)
  • make build succeeds
  • make test passes (pre-existing config test failure unrelated)
  • Manual: open a PR URL, verify Reviews tab appears and shows comments
  • Manual: click an inline comment to navigate to the file/line
  • Manual: type a comment in the input and press Enter to post it

🤖 Generated with Claude Code

Add a new "Reviews" sidebar panel that displays PR review comments
when a PR is loaded. Includes fetching inline/general comments from
GitHub, displaying them grouped by file, and posting new general
comments via an input widget at the bottom of the panel.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant