feat(mobile): pull request screen with merge, checks, reviewers and description

Merged
SA
3mo ago
+3971-375

What & why

Merging a pull request from the phone. Replaces the merge button on the diff screen with a dedicated pull request screen, reached from a chip above the workspace composer (or a list sheet when a branch has several PRs).

The screen

  • Header: status pill, diffstat (tap → files changed), title. No bar title — the PR names itself. Copy-link button and a native … menu (Copy link · Open in GitHub · Share) as separate glass buttons; copying shows a transient "Copied Link" pill in the bar.
  • State card: one headline naming what the PR is waiting on (Waiting for Review, Resolve Conflicts to Merge, Blocked by Branch Rules, Ready to Merge, …), rows justifying it (checks tally with progress ring, reviewers), and only the actions GitHub would accept. Merge stays offered through running or failed checks; a missing approval removes it. Merge confirms with number, title and method before calling github.mergePR, and refetches after.
  • Sheets: checks (native segmented filter in the header — All 19 · Failed 0 · Passed 19 — with a Fix All toolbar button when anything failed), check detail, reviewers, and the PR list. All native headers with X close.
  • Description: rendered with react-native-enriched-markdown (not the streaming wrapper), HTML stripped (bot badges, comments, <picture> blocks; fenced and inline code preserved), clamped at 280pt behind a native blur + fade with See More/See Less.

Host service

  • New getPullRequestDetail: one GraphQL round trip for mergeability, per-viewer capabilities, checks with isRequired, reviewers, threads, queue, allowed merge methods, body.
  • Reads reviewDecision — the only field that sees rulesets. This repo requires review through a ruleset, so branchProtectionRule is null and requiredApprovals reads 0; without reviewDecision a review-blocked PR read "Blocked by Branch Rules" instead of "Waiting for Review".
  • Capabilities are permission-only; mergeability is a separate signal so the button doesn't vanish while GitHub is still computing it (spinner instead).

Shared

  • One pullRequestStatus module colours the home rows, the workspace chip and the PR list — three copies collapsed to one.
  • +not-found route with a Go home escape.

Deps: expo-linear-gradient (new native module — rebuild the dev client), @react-native-masked-view/masked-view (already compiled in via expo-router; added as a direct dep so it resolves).

How I tested it

Local stack (api + relay + desktop host) against the per-worktree DB, driven on the iOS simulator with Maestro. Verified live against #6492 (review-required, 19 green checks) and a merged PR for the merged card. Every card state was diffed across a fixture set before/after the mergeability change; identical output.

Screenshots: workspace chip → PR list → PR screen → checks sheet → reviewers sheet (strip attached below).

Not verified, worth a human tap:

  • The merge itself has never executed — I never merged a real PR. The confirm flow was verified on the old diff screen this PR deletes.
  • The "Copied Link" pill's slide animation and the four-segment checks filter (needs a PR mid-CI) are code-verified only.

Known gaps, deliberate:

  • Mark Ready / Update Branch / Reopen / Dequeue alert "Not available yet" — no host procedures. Same reason the … menu omits Rename and Close PR.
  • allowedMergeMethods comes from repo settings (all three) while the ruleset permits squash only.
  • Inline-code highlight sits ~2pt high at line-height 22: the library draws it from the line fragment top; a limit of the renderer, documented in constants.ts.

Checklist

  • PR title follows conventional commits (type(scope): subject)
  • bun run lint and bun run typecheck pass (CI fails on lint warnings too)
  • "Allow edits from maintainers" is checked on fork PRs

Summary by CodeRabbit

  • New Features
    • Added comprehensive pull request views with status, description, merge actions, changed files, checks, reviewers, and GitHub links.
    • Added workspace pull request lists and quick-access navigation.
    • Added detailed check and reviewer sheets, filtering, status indicators, and progress summaries.
    • Added pull-to-refresh, loading, offline, and unavailable states.
    • Added a custom not-found screen with navigation back home.
  • Bug Fixes
    • Improved pull request status ordering and organization loading behavior.
    • Improved merge error handling and user-facing feedback.