feat(mobile): list a pull request's changed files on their own screen

Merged
DA
3d ago
+883-209

What

The first step of the iOS code viewer (STAG-3904): the iOS pull request page can now list the files a pull request changes.

  • Entry: for now, Files changed in the PR page's ⋯ menu. STAG-3903 is reworking that page's sections, so the entry moves to its Files segment or row once Dean picks. This avoids touching the page body in the meantime.
  • The screen (pull-request-files-screens.tsx, on its own route …/pull/<ws>/<owner>/<name>/<number>/files):
    • one section per folder, in the desktop tree's order
    • each file with its status letter (A/M/D/R) in its tone, and its +N −N inked as the pull request card inks them
    • the bar's title "Files changed" over a summary line ("8 files · +5009 −5")
    • a search by path, a pull to read again, and the panel's words for reading, failed, empty, and truncated
  • Press on a file: opens its diff on GitHub (/files#diff-<sha256 of path>). The native diff view comes in the next PR.
  • Data: the same act the desktop's Files changed reads (ACT_KIND.PULL_REQUESTS_CHANGES), read when the screen first shows, never when the page opens.

Shared rules moved, not copied

CHANGES_WORDS, fileNotice, treeOrder, filterFiles, startsCollapsed, STATUS_LETTER, and STATUS_WORDS move from @repo/panel's changes-model.ts into a new @repo/features/changed-files, since @repo/ui-native can't import the panel. The panel imports them from there. Their tests move with them, so nothing is duplicated. Two things are new there:

  • folderSections, the per-folder sections
  • gitHubFileDiffLink, GitHub's file anchor

Fixture and flow

The Inbox fixture answers the changes read for #128 with eight invented files, including a binary picture, a lockfile, and a 5,000-line generated file the diff view will be timed against. apps/mobile/maestro/pull-request-files.yaml opens the screen from the ⋯ menu and searches it.

Tests

  • Ran: packages/features/src/changed-files.test.ts (the moved tests, plus folderSections and the GitHub anchor checked against a hash worked out by hand) and packages/panel/src/tasks/changes-model.test.ts.
  • Ran: packages/host/src/fixture-pull-requests.test.ts.
  • Typechecked @repo/mobile, @repo/ui-native, @repo/features, @repo/panel, @repo/host.
  • Linted the changed files with oxlint and Biome.
  • Left to CI: everything else.
  • Not run yet: the simulator pass on Dean's Mac. It goes through the Mac queue agent (the pull-request-files flow) before this merges.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added a “Files changed” view for pull requests, with file status and change counts, path search, and links to view diffs on GitHub.
    • Added loading, error, empty, and no-match states, plus an indicator when the file list is truncated.