Skip to content

feat(prview): PR review-comment threading, diff hunks, and web-parity activity (closes #852) - #891

Draft
ysrfz wants to merge 1 commit into
dlvhdr:mainfrom
ysrfz:feat/pr-comment-threading
Draft

feat(prview): PR review-comment threading, diff hunks, and web-parity activity (closes #852)#891
ysrfz wants to merge 1 commit into
dlvhdr:mainfrom
ysrfz:feat/pr-comment-threading

Conversation

@ysrfz

@ysrfz ysrfz commented May 19, 2026

Copy link
Copy Markdown

Summary

Status: WIP — please comment if you don't like the current direction while I polish the edges.

Reworks the PR activity panel to look more like GitHub web's Conversation tab. A few things going on here:

  • Thread grouping — review comments now sit under the thread they belong to instead of flat-by-timestamp. Replies get a compact ↳ {author} prefix.
  • Diff hunks — fetch diffHunk on review comments and render the last 4 content lines above each thread (mirroring the collapsed preview on web). @@ headers get stripped since they're just positional metadata.
  • Thread badges[Outdated] and [Resolved] render inline next to the anchor, and wrap to the next line when the anchor is too wide rather than getting clipped.
  • DISMISSED glyph — was rendering as blank space before. Now uses a faint so dismissed approvals don't look like rendering bugs.
  • Implicit-Review unwrap — GitHub auto-generates a state=COMMENTED, body="" wrapper whenever a thread starts outside a formal review. The TUI was rendering these as empty xyz reviewed blocks. Now: 0 threads → hide; 1 → promote the thread up a level; 2+ → promote them all as siblings.
  • Conversation count — the N comments figure in the title now matches the web (N) badge, including the slightly weird case where reviews with state=COMMENTED + body + zero inline comments get excluded (web treats them as redundant with plain IssueComments, even though it still renders the card — I went back and forth on this one, ended up matching web for consistency).

Keybindings and overall panel layout unchanged.

How Did You Test this Change?

  • go test ./internal/tui/components/prview ./internal/data — added 14 new tests in activity_test.go covering each behaviour above (thread grouping, diff-hunk truncation, badges, DISMISSED glyph, implicit-review unwrap cases, count-badge web-parity)
  • go build && go vet ./... clean
  • Manual side-by-side against gh-dash v4.24.1 on a 20+-review PR (mixed thread/IssueComment/DISMISSED activity); will attach screenshots once the UI is polished

Images/Videos

(will attach side-by-side screenshots once I'm happy with the UI)

AI Usage Disclosure

Per AI_POLICY.md: wrote the code with Claude Code as a pair-programming assistant, with substantial AI involvement on the implementation drafts and tests. Each design decision (web-parity counting, implicit-review unwrap cases, diff-hunk truncation length, badge wrap behaviour) was driven and reviewed by me, with multiple rounds of pushback on the approach before landing. I understand the changes and can explain how the activity-panel pipeline interacts with the GraphQL fragment and the existing PR view — happy to walk through any part on request.

Closes #852

Closes dlvhdr#852.

Reworks the PR activity panel to mirror GitHub web's Conversation tab:
group review comments under their parent thread, render the last 4 lines
of each comment's diff hunk above the thread, surface [Outdated] and
[Resolved] badges (wrapping to next line when the anchor overflows),
render a glyph for DISMISSED reviews, and unwrap GitHub's implicit
state=COMMENTED,body="" review wrappers (0/1/2+ thread cases).

Also aligns the activity title's "N comments" figure with the web (N)
badge, including the case where state=COMMENTED reviews with a body and
zero inline comments are excluded.
@github-actions

This comment has been minimized.

@dlvhdr

dlvhdr commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Hey @ysrfz :)
I've updated my AI policy to disallow any AI usage.
I am willing to explore your idea though and I think a first good step would be to open an issue to discuss it.
We can then make sure to take performance into account as well as build a figma mock we can agree on.
wdyt?

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.

PR activity view flattens review threads and drops the code context

3 participants