feat(desktop): redesign pull requests screen with split-pane view, code diff tab, and review comments

Draft
AV
1mo ago
+2107-323

Summary

  • List: split-pane layout (list + detail side by side) with role-based All / Reviewing / Authored tabs. All shows a grouped "my work" dashboard (Needs my review / Previously reviewed / Authored); Reviewing mirrors that as two full sections (GitHub's search API rejects qualifier-level OR, so it can't be one combined query); Authored reuses the existing flat, fully paginated list. Rows show status-dot-on-icon, diff stats, and branch name.
  • Detail: header redesign with Review / Summary / Code / Checks tabs.
    • Review is backed by new getThreads/setThreadResolution procedures and reuses CommentThread (refactored to a pure presentational component so it works outside a workspace context).
    • Code is a new file tree + diff viewer built on @pierre/trees/@pierre/diffs, matching the workspace Changes pane — resizable/collapsible tree, split/unified toggle, backed by a new getDiff procedure.
  • Backend: search-pull-requests now enriches results with additions/deletions/headRefName via the existing GraphQL checks-enrichment call (no extra round trips), and accepts a viewerRelationship qualifier for the grouped list sections.

Bugs fixed along the way

  • Duplicate-path crash in the Code tab: gh pr diff --patch emits one diff --git block per commit, so a file touched across multiple commits produced a duplicate tree path and crashed @pierre/trees. Switched to the plain cumulative diff, plus a defensive dedupe as a backstop.
  • Unscrollable diff: the pull-requests layout's Outlet wrapper wasn't a flex container, so tall diff content overflowed invisibly past an ancestor's overflow:hidden with no scrollbar anywhere to reach it.
  • Borderless "Open" state pill.
  • Original PR-screen "Failed to fetch" investigation (offline-host routing) from earlier in this branch.

Test plan

  • bunx tsc --noEmit clean on apps/desktop and packages/host-service
  • bunx biome check clean on all touched files
  • bun test passes for pull-requests (13/13)
  • Verified live end-to-end over CDP against the running dev app: list tabs/grouped sections, split-pane detail, Review tab (real threads/comments), Code tab (multi-file diffs, scroll, resize, split/unified toggle, the duplicate-path crash repro + fix)
  • Manual review of the design against the Figma references

https://claude.ai/code/session_01DyR8ibewWvkhknCgKtpfXL


Summary by cubic

Redesigns the desktop Pull Requests screen to a split-pane list + detail with role-based tabs and adds Code and Review tabs to the detail view. This replaces the old flat list/minimal detail and prevents noisy errors by skipping known‑offline hosts.

  • UI
    • List: All (grouped “Needs my review”/“Previously reviewed”/“Authored”), Reviewing (two sections; GitHub search rejects qualifier‑level OR), and Authored (flat, paginated). Rows show status dot, diff stats, and branch.
    • Detail: new Review/Summary/Code/Checks tabs. Code uses @pierre/trees and @pierre/diffs with file tree, resize/collapse, and split/unified toggle. Review shows threads and supports resolve; CommentThread is now presentational.
  • Backend
    • Adds pullRequests.getDiff, pullRequests.getThreads, and pullRequests.setThreadResolution.
    • search-pull-requests accepts viewerRelationship and enriches rows with additions/deletions/headRefName via the existing GraphQL pass (no extra calls).
  • Reliability and fixes
    • useHostTargetUrl avoids routing to known‑offline hosts; detail page maps NOT_FOUND TRPCClientError to an “update device” prompt.
    • Switches from gh pr diff --patch to cumulative diff and defensively dedupes paths; fixes unscrollable diff and borderless “Open” pill.
  • Routing and filters
    • New URL params: state=open|all|merged, tab=all|reviewing|authored. Filter store persists mergedOnly and viewTab; merged takes precedence over all when serializing.

Rollout

  • Deploy desktop and host-service together. The UI degrades gracefully on older hosts, but the Review and Code tabs require the new pullRequests.getDiff/getThreads/setThreadResolution procedures.