Skip to content

Source control: pull request client, read side (A4) #640

Description

@Tryanks

Summary

The read side of a pull-request client, in Tcode's own model (not a copy of T3 Code's page). Phase A4 of #535. Depends on #638, #532 and #639.

Destination

A PR tab on desktop next to Diff, Plan and Preview; a full-width page on phone (the shell already renders panels as compact pages). Logical regions: a compact header (title, state, draft, author, base and head, checks summary, review decision, conflict, stack position with a layer selector); a Files / Conversation switch; actions as contextual controls and sheets (A5).

Files

Reuse the existing diff renderer and selection machinery with a PR-specific input: base/head revision identity, repository-relative paths with previous path for renames, per-file availability (missing side, not loaded, binary, oversized, failed), explicit completeness, and review anchors tied to revision, path, side and line range. Never fall back to the local checkout (the current view reads missing content from cwd, crates/ui/src/diff/view.rs:450–500, which is wrong for another revision or a fork). Whole diff first (8 MiB cap, and a longer per-request deadline: the transport from #638 caps every request at 30 s, which upstream lets callers raise for large patch reads; raise the cap here for diff and file reads), paged files on refusal; file text at immutable revisions on expansion (contents endpoint, 1 MiB per file); byte-bounded caches; binary and oversized files stay visible with an explanation and an open action; whitespace and split toggles preserve source coordinates. Viewed-file state is account-specific host data (GraphQL viewerViewedState, 100 per page, 5 pages; beyond that shown as unknown); mark/unmark is the one mutation in this phase.

Conversation

Issue comments, reviews, review threads (resolve state, replies paged past the first page), reactions, author avatars. Outdated and resolved threads keep stable ids and fall back to the conversation when their lines are absent. Existing read sharing from A1–A3 with upstream TTLs: detail 60 s (merged 10 min), activity 60 s, checks 15 s, diff 60 s, viewed files 15 s, identity 10 min; failures 0. The on-disk read cache is decided here with real readers: single-flight plus TTLs first, persistence only if a measured restart storm shows up.

Media

A host query bound to the PR the client may read (not an HTTP proxy): bounded bytes with MIME, size, validator and expiry. Only GitHub asset URLs are accepted before any redirect; token only for github.com, www.github.com, raw.githubusercontent.com, media.githubusercontent.com and never on the signed-object hop; at most 3 HTTPS redirects; image, video and audio MIME only; limits enforced while reading; decoded dimensions bounded; byte-bounded client cache partitioned by host and account; nothing private persisted across an account change; SVG decoded as an image only. Images first; video and audio open externally until a range-capable asset read exists.

Dropped from upstream's client

Hover preview card, repository search and listing filters, multi-environment routing.

Evidence required

A PR with rename, deletion, binary and oversized files and an outdated multiline review; phone geometry in both themes with layer navigation and retained scroll state; two real clients including a phone over iroh: private image, expired signed URL, over-cap response, account switch; wire size and peak memory measured.

Reference

T3 Code: apps/server/src/pullRequest/GitHubPullRequestApi.ts (diff, files, contents, activity, review threads, viewed files), PullRequestService.ts (caches), apps/server/src/assets/GitHubMediaFetch.ts, apps/web/src/components/pullRequest/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions