refactor(pull-requests): move the last PR callers off the host's gh

Merged
SA
1mo ago
+97-81

Step 1 of the PR-pane cleanup. Stacked on #8765.

Summary

Moves the last direct callers of the host procedures #8765 deprecated onto the viewer's API path:

  • ChangesControl → PRStatusGroup (desktop tab-bar PR badge): merge and mark ready use mergePullRequest / setPullRequestDraft from pullRequestClient, in place of host github.mergePR / github.markPullRequestReady. The host's refreshByWorkspaces sync after a write stays; that's the host's own state, not GitHub auth.
  • New-workspace prompt context (fetchPrBody): reads the linked PR's body with readPullRequestContent, keyed by the PR's URL, in place of host pullRequests.getContent.
  • Mobile per-row diffstat (usePullRequestDiffstat): integration.github.getPullRequestDetail (without activity) in place of host github.getPR. This drops the host URL plumbing from PullRequestsSheet / RowDiffstat.

After this, the only callers of the deprecated host PR procedures are the desktop pullRequestClient fallbacks, which step 4 removes.

Behaviour note: in a session workspace (no project) with no GitHub connection, merge from the badge now fails with the "Connect GitHub" error. It used to merge through the host's gh.

Test plan

  • desktop: tests for the prompt context, lib/github and ChangesControl pass; tsc clean in touched files
  • mobile: bun test 233/233; tsc clean in touched files
  • In the app: merge and mark ready from the tab-bar badge are attributed to the viewer; the PR list sheet shows diffstats with the host offline