Skip to content

feat: review inbox with state-tracked PR comments#217

Open
eugenioenko wants to merge 1 commit into
mainfrom
feat/pr-review-inbox
Open

feat: review inbox with state-tracked PR comments#217
eugenioenko wants to merge 1 commit into
mainfrom
feat/pr-review-inbox

Conversation

@eugenioenko

Copy link
Copy Markdown
Owner

Summary

  • Adds a Review Inbox sidebar panel (Ctrl+K V) that treats PR comments as tracked tasks with states: Open -> Addressed -> Verified -> Dismissed
  • Auto-detects "addressed" comments by checking git log for file modifications after the comment timestamp
  • Shows gutter markers (diamond indicators) on commented lines in the editor, with colors reflecting comment state
  • Navigation commands (Ctrl+K N / command palette) let you jump through unresolved comments across files like diagnostic jumping
  • Status bar shows live progress (e.g. "3/7 resolved") when a review is active
  • State persists locally in .ttt-review-state.json so review progress survives across editor sessions
  • Comments auto-load when a PR is opened via the Changes panel

Architecture

  • internal/github/github.go -- new FetchPRComments, AddPRComment, AddPRInlineComment functions using gh CLI
  • internal/github/review_state.go -- CommentState enum, ReviewState persistence, DetectAddressed heuristic
  • internal/ui/review_inbox_widget.go -- sidebar panel widget with file-grouped comments, state indicators, and keyboard shortcuts (v=verify, d=dismiss, r=reopen, a=reply)
  • internal/app/review.go -- app-layer wiring: async comment fetch, state management, gutter marker updates, navigation
  • internal/app/commands_review.go -- command palette entries for all review actions

Design Decisions

  • Comments are tasks, not messages: each thread has a trackable state
  • The editor shows current code, not stale diffs -- gutter markers highlight where comments exist
  • Navigation wraps around like diagnostic jumping (next/prev cycle through all files)
  • State detection is best-effort (checks if file was modified after comment) with manual override
  • Uses existing patterns: SelectableList, BaseWidget, PostEvent for async, term.Style* constants for colors

Test plan

  • Unit tests for GitHub API JSON parsing (internal/github/github_test.go)
  • Unit tests for review state management (internal/github/review_state_test.go)
  • Unit tests for inbox widget: comments, state transitions, progress, markers, expansion (internal/ui/review_inbox_widget_test.go)
  • E2E sidebar tab overflow test updated for new panel
  • make build && make test passes
  • Manual: open a PR URL, verify inbox populates and gutter markers appear
  • Manual: use v/d/r keys to change comment states
  • Manual: use Ctrl+K N to navigate through unresolved comments

🤖 Generated with Claude Code

Add a Review Inbox sidebar panel that provides a better PR review
experience than GitHub's web UI. Comments are tracked as tasks with
states (Open -> Addressed -> Verified -> Closed), and the editor shows
live code with gutter markers on commented lines.

Key features:
- GitHub API layer for fetching/posting PR review comments
- Review Inbox sidebar panel with file-grouped comment threads
- Comment state machine: Open, Addressed, Verified, Dismissed
- Auto-detection of "addressed" comments via git log
- Gutter markers on commented lines (diamond indicators)
- Next/prev unresolved navigation (Ctrl+K N)
- Status bar progress display (e.g. "3/7 resolved")
- State persistence via .ttt-review-state.json
- Comments auto-load when a PR is opened via Changes

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