Skip to content

feat: PR review comments hub (full-screen modal)#215

Open
eugenioenko wants to merge 2 commits into
mainfrom
feat/pr-comments-surprise
Open

feat: PR review comments hub (full-screen modal)#215
eugenioenko wants to merge 2 commits into
mainfrom
feat/pr-comments-surprise

Conversation

@eugenioenko

Copy link
Copy Markdown
Owner

Summary

  • Approach: Full-Screen Review Hub Modal — instead of a sidebar, bottom panel, or sliding panel, PR review comments appear in a full-screen modal dialog (like GitHub's review summary page, but in TUI). Comments are organized by file with section headers, showing inline review comments grouped under their file paths and general comments in a dedicated section.
  • Adds GitHub API functions (FetchPRComments, AddPRComment, AddPRInlineComment) that shell out to gh api to fetch and post PR review comments
  • Adds ReviewHubWidget — a full-screen focusable overlay with keyboard-driven navigation (j/k, arrows, n/p for section jumps, PgUp/PgDn, Home/End), scrollbar, mouse support, and action shortcuts (Enter to jump to code, a to add comment, r to reply inline)
  • Adds theme-aware comment styles (StyleCommentMarker, StyleCommentUser, StyleCommentBody, StyleCommentFile) wired through the config/theme system
  • Registers pr.comments command (bound to Ctrl+K G) and pr.addComment command (palette only)
  • Integrates with async event loop pattern — comments are fetched in a goroutine and posted via PostEvent(EventInterrupt), and after posting a comment the hub auto-refetches to show the new comment

Test plan

  • Unit tests for PRComment type structure (TestPRCommentType)
  • Unit tests for ReviewHubWidget construction, row building, rendering, keyboard nav, escape dismiss, enter navigation, add comment shortcut, section jumping, multiline comments, reply inline, modal event consumption (14 tests)
  • Unit test for formatCommentDate helper
  • make build compiles cleanly
  • make test — all existing + new tests pass
  • Manual: open a PR with pr.review, then use Ctrl+K G or command palette "Git: PR Comments" to open the Review Hub

🤖 Generated with Claude Code

eugenioenko and others added 2 commits June 19, 2026 20:22
Implement PR review comment reading and writing via a full-screen
Review Hub modal dialog. Comments are fetched from GitHub and displayed
organized by file, with inline review comments grouped under file
headers and general comments in a separate section. Users can navigate
with keyboard (j/k/arrows, n/p for sections), press Enter to jump to
commented code, 'a' to add a general comment, and 'r' to reply inline.

- GitHub API: FetchPRComments, AddPRComment, AddPRInlineComment
- ReviewHubWidget: full-screen modal with scrollable comment list
- Theme: CommentStyles with marker/user/body/file colors
- Commands: pr.comments (Ctrl+K G), pr.addComment
- Async fetch/post with event loop integration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
StyleCount was 55 but 4 new comment styles were added (indices 55-58),
causing index-out-of-bounds panic in BuildStyleMap on startup.

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