Skip to content

feat(review): PR context panel — summary, comments, and checks#350

Merged
backnotprop merged 2 commits into
mainfrom
feat/review-gh-enhancements
Mar 20, 2026
Merged

feat(review): PR context panel — summary, comments, and checks#350
backnotprop merged 2 commits into
mainfrom
feat/review-gh-enhancements

Conversation

@backnotprop
Copy link
Copy Markdown
Owner

Summary

  • Adds Summary, Comments, and Checks tabs to the ReviewPanel when reviewing a GitHub PR
  • Tabs appear as icon buttons inline in the panel header (only in PR mode, local review unchanged)
  • Data fetched lazily via new /api/pr-context endpoint on first tab click
  • Uses DOMPurify for safe rendering of GitHub markdown/HTML content in comments and PR body
  • Extended inline markdown renderer with link and bare URL support

Partial progress on #348 (PR Context Panel section complete).

Details

Backend:

  • PRContext type + fetchPRContext() with defensive parsing of gh pr view --json response (handles missing fields, nested author objects, varied shapes)
  • New GET /api/pr-context endpoint in review server (PR mode only)

Frontend:

  • usePRContext hook — lazy fetch with loading/error states
  • PRSummaryTab — PR body (block-level markdown), labels (colored badges), linked issues, state/draft badge
  • PRCommentsTab — chronologically merged comments + reviews with state badges
  • PRChecksTab — merge readiness (handles merged/closed/open states), CI checks grouped by workflow
  • MarkdownBody shared component with DOMPurify sanitization for HTML passthrough

Test plan

  • plannotator review https://github.com/owner/repo/pull/N — tabs appear in panel header
  • Click Summary → PR description, labels, linked issues render
  • Click Comments → chronological thread with review state badges
  • Click Checks → merge status + CI checks with pass/fail icons
  • Merged PRs show "Merged" badge (not "Unknown")
  • Local review (plannotator review) → no tabs, unchanged behavior
  • HTML in comments (e.g. <sub>) renders safely via DOMPurify
  • bun test packages/shared/ && bun test packages/review-editor/ — all tests pass

… tabs

When reviewing a GitHub PR, the ReviewPanel now shows icon tabs for
Summary (PR body, labels, linked issues), Comments (chronological
thread of comments + reviews), and Checks (CI status, merge readiness).
Tabs only appear in PR mode; local review is unchanged.

Data fetched lazily via new /api/pr-context endpoint on first tab click.
Uses DOMPurify for safe HTML rendering of GitHub markdown content.
Inline markdown renderer extended with link and bare URL support.

Closes #348

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@backnotprop
Copy link
Copy Markdown
Owner Author

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

…bodies

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@backnotprop backnotprop merged commit 1821943 into main Mar 20, 2026
2 checks passed
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