Skip to content

feat(pull-requests): review threads in the diff pane and Review tab as the viewer - #8980

Merged
saddlepaddle merged 3 commits into
mainfrom
superset/pr-review-threads-viewer
Oct 28, 2026
Merged

saddlepaddle merged 3 commits into
mainfrom
superset/pr-review-threads-viewer

Conversation

@saddlepaddle

@saddlepaddle saddlepaddle commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Stacked on #8799 (→ #8771 → #8765).

Summary

The last places that read or resolved review threads with the workspace host's GitHub access now act as the viewer, the same way the PR pane does (local gh first, then the Superset connection):

  • Diff pane: thread annotations and the inline CommentThread, both reply and resolve
  • Sidebar Review tab: the thread list, and "resolve all" in CommentsSection

The host still answers which PR the workspace links to (git.getPullRequest reads its own database; it doesn't call GitHub). That lookup is now one hook, useLinkedPullRequest, which also returns the PR as a PullRequestTarget.

One cache for threads. Every surface reads usePullRequestThreads(target) and writes through useReviewThreadActions(target). Resolving a thread in the PR pane updates the diff pane and the Review tab right away; the old cross-cache invalidation of git.getPullRequestThreads is gone.

Conversation comments. The Review tab lists them, and the host's thread read used to supply them. pullRequestOnGithub(...).threads() now returns the latest 100 in the same GraphQL request. The PR pane keeps taking its conversation from the PR read, so they aren't shown twice.

CommentThread now takes onReply/onSetResolved props instead of calling the host itself, so its test passes plain functions.

After this, no desktop or mobile code calls the deprecated host thread procedures (git.*Thread*, pullRequests.getThreads/replyToThread/setThreadResolution).

Follow-up

The diff pane's CommentThread and the Code tab's PullRequestCommentThread are now the same component with injected actions and could be merged.

Test plan

  • tests: desktop 8820, shared 1500 (new: conversation comments come back with threads, minus empty ones), trpc 740, host PR suites 465, mobile 239, all passing
  • tsc clean in touched files; check:i18n, sherif
  • In the app: resolve a thread in the PR pane → the diff pane annotation and the Review tab update; reply from the diff pane is attributed to you in a cloud workspace

Summary by cubic

Review threads in the diff pane and sidebar Review tab now act as the viewer (local gh first, then the Superset connection) instead of the workspace host's GitHub access, matching the PR pane.

  • All surfaces read and write threads through usePullRequestThreads and useReviewThreadActions, so resolving or replying in one view updates the others immediately; "resolve all" writes every thread, then refreshes the list once.
  • useLinkedPullRequest is the single hook for which PR a workspace links to; the host still answers the lookup, and the PR is returned as a PullRequestTarget.
  • Thread reads now return the latest 100 conversation comments in the same GraphQL request; the Review tab lists them and the PR pane filters them out.
  • Without a GitHub login the Review tab explains why comments are missing and offers "Connect GitHub"; reads the organization's App can't make likewise ask for a connection instead of a dead-end not-found.
  • Mobile PR rows read their diffstat with one REST request again, merges return GitHub's message, and Settings says it could not check rather than "Not connected".
  • CommentThread now takes onReply and onSetResolved props instead of calling the host itself.
  • No desktop or mobile code calls the deprecated host thread procedures (git.*Thread*, pullRequests.getThreads/replyToThread/setThreadResolution) anymore.

Follow-up

The diff pane's CommentThread and the Code tab's PullRequestCommentThread are now the same component with injected actions and could be merged.

Written for commit 2ca017a. Summary will update on new commits.

View guided diff Turn on auto-fix

Review fixes (whole stack)

  • feat(pull-requests): act as the viewer, by PR identity; chat PR badges open the pane #8765: a read that GitHub refused no longer falls back to the host's gh, which could show a PR the viewer can't access.
  • Connect GitHub: reads the org's App can't make (repo not installed, or no installation) now offer "Connect GitHub" instead of a dead-end not-found.
  • Mobile PR list: rows read their diffstat with one REST request (getPullRequestDiffstat), not the full detail read.
  • Merges and thread reads: merges return GitHub's message again, and failed thread reads log their cause.
  • Review tab: says why comments are missing and offers "Connect GitHub"; "resolve all" refreshes once.
  • Mobile Settings: says "Couldn't check" when the connection status fails to load.
  • Copy: the docs say which identity reads and which writes, and the German, Dutch and Polish strings are reworded.

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Preview Deployment

🔗 Preview Links

Service Status Link
Neon Database (Neon) ❌ View Branch
Vercel API (Vercel) ✅ Open Preview
Vercel Web (Vercel) ✅ Open Preview
Vercel Marketing (Vercel) ✅ Open Preview
Vercel Docs (Vercel) ✅ Open Preview

Preview updates automatically with new commits

@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with two non-blocking concerns from the previous review still open.

Findings

  1. P2 Missing login hides review comments ▶
  2. P2 Resolve all repeats GitHub reads ▶
Fix with agent prompt
### Issue 1
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useReviewTab/useReviewTab.tsx:undefined-39
The Review tab now needs the viewer's GitHub login, but it never shows when that login is missing. If the host knows the linked PR but the viewer has no local login or Superset connection, `threadsQuery` fails and the tab shows an empty comment list.

Pass `threadsQuery.isError` and `fetchFailed` through to the comments view, and offer a way to connect GitHub instead of saying there are no comments.

### Issue 2
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/CommentsSection/CommentsSection.tsx:144-147
`handleResolveAll` now calls an action that refreshes the entire thread list after each thread is resolved. Previously, it refreshed once after the batch finished. Resolving many threads can now start repeated GitHub reads for the same PR.

Let the batch skip each action's refresh, then refresh once after all writes finish.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Moves workspace review threads to the viewer’s GitHub access and one shared cache.

  • Diff-pane thread actions refresh the same list used by the other review panes.
  • The Review tab lists conversation comments with review threads.

The previous-review ancestry and merge-base checks did not both pass, so this review used the full PR diff.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Host["Host: linked PR record"] --> Target["useLinkedPullRequest"]
  Target --> Threads["usePullRequestThreads"]
  Threads --> Diff["Diff pane"]
  Threads --> Review["Review tab"]
  Threads --> Pane["PR pane"]
  Diff --> Actions["Viewer thread actions"]
  Review --> Actions
  Pane --> Actions
  Actions --> Cache["Refresh shared thread cache"]
  Cache --> Threads
Loading

Reviews (2) · Last reviewed commit: "feat(pull-requests): review threads in t..." · Reviewed by Greptile

refetchOnWindowFocus: true,
},
);
const threadsQuery = usePullRequestThreads(target, { enabled: hasPR });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Missing login hides review comments

The Review tab now needs the viewer's GitHub login, but it never shows when that login is missing. If the host knows the linked PR but the viewer has no local login or Superset connection, threadsQuery fails and the tab shows an empty comment list.

Pass threadsQuery.isError and fetchFailed through to the comments view, and offer a way to connect GitHub instead of saying there are no comments.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useReviewTab/useReviewTab.tsx
Line: 38

Comment:
**Missing login hides review comments**

The Review tab now needs the viewer's GitHub login, but it never shows when that login is missing. If the host knows the linked PR but the viewer has no local login or Superset connection, `threadsQuery` fails and the tab shows an empty comment list.

Pass `threadsQuery.isError` and `fetchFailed` through to the comments view, and offer a way to connect GitHub instead of saying there are no comments.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment on lines 144 to 147
const results = await Promise.allSettled(
resolvableThreadIds.map((threadId) =>
setReviewThreadResolution.mutateAsync({
workspaceId,
threadId,
resolved: true,
}),
threadActions.setResolved(threadId, true),
),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Resolve all repeats GitHub reads

handleResolveAll now calls an action that refreshes the entire thread list after each thread is resolved. Previously, it refreshed once after the batch finished. Resolving many threads can now start repeated GitHub reads for the same PR.

Let the batch skip each action's refresh, then refresh once after all writes finish.

Knowledge Base Used: Hold GitHub failures and reduce pull-request refresh load

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/CommentsSection/CommentsSection.tsx
Line: 144-147

Comment:
**Resolve all repeats GitHub reads**

`handleResolveAll` now calls an action that refreshes the entire thread list after each thread is resolved. Previously, it refreshed once after the batch finished. Resolving many threads can now start repeated GitHub reads for the same PR.

Let the batch skip each action's refresh, then refresh once after all writes finish.

**Knowledge Base Used:** [Hold GitHub failures and reduce pull-request refresh load](https://app.greptile.com/personal-org-6810/-/custom-context/knowledge-base/paradevai/paradev/-/reverts/incident-mitigation_7246-20260906-github-quota-0d373cc.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@saddlepaddle
saddlepaddle force-pushed the superset/pr-viewer-credentials branch from 1e367c2 to 7e10066 Compare October 28, 2026 01:12
@saddlepaddle
saddlepaddle force-pushed the superset/pr-review-threads-viewer branch from 35022d5 to cbad5f6 Compare October 28, 2026 01:13
@saddlepaddle
saddlepaddle marked this pull request as draft October 28, 2026 01:52
@saddlepaddle
saddlepaddle marked this pull request as ready for review October 28, 2026 01:52
@saddlepaddle saddlepaddle reopened this Oct 28, 2026
@saddlepaddle
saddlepaddle marked this pull request as draft October 28, 2026 01:53
@saddlepaddle
saddlepaddle marked this pull request as ready for review October 28, 2026 01:53
@saddlepaddle
saddlepaddle force-pushed the superset/pr-viewer-credentials branch from d5fe261 to 209263d Compare October 28, 2026 02:57
@saddlepaddle
saddlepaddle force-pushed the superset/pr-review-threads-viewer branch from 37ad061 to 449ec1e Compare October 28, 2026 02:57
@saddlepaddle
saddlepaddle force-pushed the superset/pr-viewer-credentials branch from 209263d to ef193c3 Compare October 28, 2026 03:14
…s the viewer

The diff pane's comment threads and annotations, the sidebar Review tab and
its resolve-all read and write review threads with the viewer's own GitHub
login, through the same client and cache as the PR pane. The host only says
which pull request the workspace links to. The shared thread read now also
returns the conversation comments the Review tab lists.
…all with one refresh

Without a GitHub login the Review tab offered no comments and no reason;
it now says so and offers to connect GitHub, or that the comments could not
load. Resolve all writes every thread and then reads the list once, as it
did before, instead of once per thread.
- Reads the organization's App cannot make ask the viewer to connect GitHub,
  instead of a not-found with no way forward.
- Mobile PR rows read their diffstat with one REST request again.
- Merges return GitHub's message; failed thread reads are logged with their
  cause.
- Mobile Settings says it could not check rather than "Not connected".
- The sandbox note says which identity reads and which writes; German, Dutch
  and Polish wording says "with your account" rather than calques.

This branch was previously deployed

1 inactive deployment
preview — 2ca017a8 Deployed Oct 28, 2026 by saddlepaddle via Deploy API #13026
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