Skip to content
flow

FeaturesPR review

PR review

Review a pull request in a Flow tab, with its summary, grouped diff, comments, pending reviews, reviewer requests, quick links and review sessions.

View as Markdown
On this page

A PR review tab shows a pull request inside Flow: its description and conversation on a Summary view, its diff on a Changes view, and the tools to comment, review, request reviewers and change its status. A PR review session is a whole session built around one PR, with the PR as its primary tab and a checkout of its branch.

Review tabs work without any experiment. How to reach a PR from a session, the Reviews and My PRs queue pages and the merge / ready / draft / close changes are on Pull requests.

Open a review tab

  • Press ⌥⌘R (Review pull request) in a session whose branch has a PR.
  • Press ⇧⌘G (Open pull request) or click the PR pill in the session's header while git.open_pr_in_review is on (the default).
  • On the Dashboard, click a card's PR label (the same rule as ⇧⌘G).
  • Open any PR as a review session (below).

A review tab on a PR that is already open in the group is focused instead of opening twice. Several tabs on one PR share one fetch.

Identity row and toolbar

The top row shows the PR's title and repo #N. At its right:

  • Refresh, Copy link and Open on GitHub buttons. Refresh reads the PR again; its icon spins until something changes, fails, or 3 seconds pass.
  • The state chip (Open, Draft, Merged or Closed in the PR colours). On an open PR, click it for the status selector: a #N State · … header with what stands between the PR and a merge, then Merge pull request, Enable or Disable auto-merge, Convert to draft or Mark ready for review, Close pull request (each enabled only when it applies) and Open in GitHub. A draft's selector adds Mark ready for review (…) rows that mark it ready and request reviewers in one go (see Request reviewers). A merged or closed PR's chip opens it in the browser.

The toolbar under it:

  • Summary and Changes, followed by the PR's +A −D.
  • The viewed progress, a bar and x / y viewed.
  • On Changes: the Groups pill (the Diff groups panel), Unified / Split, Wrap, File tree, and fold all / unfold all.
  • On Summary: a button that shows or hides the details column.
  • Finish review, with the count of pending comments (see Comment and review).

While a PR is loading the page reads "Loading pull request…". A failed first load shows the error over a Retry button. A failed refresh keeps the page and shows "Refresh failed: …" under the title.

Summary view

The main column shows the title, the author, the age and head → base, then the description, rendered as GitHub-flavored Markdown: headings, lists and task lists, code, tables, quotes, GitHub alerts (Note, Tip, Important, Warning, Caution), collapsible <details>, footnotes and images. A mermaid code block is drawn as a diagram on your Mac; click it to enlarge it, or use "Show source". Click an image to enlarge it in the image viewer.

Activity

Under the description, Activity is the PR's conversation: the opening, comments, reviews and inline review threads. It reads newest first by default; the "Newest first" / "Oldest first" toggle at the right of the heading (or the Toggle PR activity order action) flips it for every review tab.

  • Comments, reviews with a body and review threads are cards, with a copy-link button and a ↗ to open the comment on GitHub. The PR author's comments carry an "Author" pill.
  • A thread card shows its file and line, a three-line slice of the diff and the comments. A resolved thread starts folded to its header; click any thread's header to fold or unfold it.
  • A comment GitHub hid shows as one dim line naming the reason, with a Show / Hide link.
  • On a page longer than the pane, a rail of ticks down the left gutter marks the description and every entry. Hover a tick for a card about the entry; click to scroll there.

Details column

The right-hand column lists, top to bottom: Quick links (when configured, see Quick links), Merge status, Comments, Reviews, Checks and Commits. Click a caption to fold its section; Commits starts folded. The column is shared by every review tab:

  • Drag the handle on its left edge to resize it (220 to 480 px, 300 by default); dragging it nearly shut hides it. Double-click the handle to reset it.
  • Hide or show it with the toolbar's panel button or Toggle PR details panel.

Reviews shows the review decision, each reviewer's standing review and each pending request ("awaiting"), with a Request pill and a ↻ re-request button (see Request reviewers). Click a check with a web page to open it, or a commit to open it on GitHub.

Issue and PR references

#123, owner/repo#123 and bare PR or issue URLs in the title, the description and comments turn into chips with the state glyph and colour: open green, merged purple, closed red, a draft or an issue closed as not planned grey. A bare #123 means the PR's own repository. Hover a chip for a card with the title, state, author and an excerpt; click it to open it. pr.ref_chips sets the look:

ValueLook
github (default)A reference alone in its paragraph shows its title; one inside a sentence stays compact
titledAlways show titles
compactNumbers only

The same chips show in a Notes preview. A reference Flow can't resolve stays the text or link it was.

Selecting text

Drag over the page's text to select it and press ⌘C to copy, as in a text view. A selection across a split diff copies the left and right cells one under the other.

Changes view

The diff, one card per file, with the file tree at the right.

  • A file card's header shows a language dot, the path (old → new for a rename) and +A −D. Click it to fold the card. The header of the card you are reading stays pinned at the top while you scroll.
  • Unified shows one column; Split shows the old and new sides side by side.
  • Wrap (pr.diff_wrap, on by default) wraps long lines inside their cells; off, each cell scrolls sideways while the line numbers stay put. The setting applies to every review tab.
  • Code is syntax-highlighted in your terminal palette's colours.
  • Gaps between hunks read "N unmodified lines". A binary file reads "Binary file".
  • Inline review threads show under the line they are on, in both modes.

File tree

The tree lists the changed files by group, with a filter field at the top (↩ or Esc hands the keyboard back). Click a row to scroll to its file, unfolding it and its group. Drag the tree's left edge to resize it (200 to 560 px, 280 by default); double-click to reset.

Viewed files

Each tree row has a viewed checkbox and each file card a Mark viewed / ✓ Viewed pill. V toggles the current file: the selected file, else the file whose header is pinned at the top. A viewed file's name reads dim. If a file's diff changes after you mark it, it reads un-viewed again. Viewed marks are kept on your Mac per PR and are never sent to GitHub.

Markdown preview

A Markdown file (.md, .markdown, .mdx) has a Preview pill in its card header. On, the card shows the rendered document instead of the diff: in Split the old and new versions side by side, in Unified one column, with removed blocks on red and added blocks on green. Toggle Markdown preview does the same for the selected file. A previewed card takes no inline comments or notes.

Open in Files

Right-click a diff line or a file header and pick Open in Files, or press ⌥⌘O over a line, to open the file in a Files tab on the PR branch's local checkout, at that line. Without a line under the pointer, ⌥⌘O opens the file at the top of the column. It needs the head branch checked out on your Mac (a PR review session's checkout counts); otherwise it reads "Not checked out locally", and a file the PR deletes reads "Deleted in this PR".

Personal notes on lines

The same right-click menu offers Add note on line and Add note on hunk. A note is saved to the session's notebook, never posted to GitHub; it hangs under its line as a "Note" card with Open in Notes, marked Moved or Outdated when the diff changed. Notes aren't available in a remote session. See Notes.

Large diffs

GitHub won't serve a diff over 300 changed files or 20,000 changed lines. For such a PR the Summary works, and Changes is refused with a dialog offering Open on GitHub.

Diff groups

The Changes view sorts files into named, foldable groups. By default:

GroupHoldsFolded
CodeEverything no other group takesno
BoilerplateNothing by pattern; only a decisions model fills itno
TestsTest files by path (test directories, *_test.go, *.spec.ts, conftest.py, snapshots and so on)yes

A group's header shows its file count, its share of the changed lines and +A −D; click it to fold the group. An empty group is hidden, and with only one non-empty group there are no headers at all. A group holding an open comment or a pending draft never starts folded, so unsent work stays visible.

The Diff groups panel

Click the toolbar's Groups pill (or run Toggle PR diff groups panel) to edit the groups. The panel takes the file tree's place.

  1. Under APPLIES TO, pick the repository's name (your own override for this repository) or All repos (your setting everywhere).
  2. Each group is a numbered card in sieve order: the first group whose pattern matches takes the file. Use ↑ ↓ to reorder and × to delete. Each card has a name, a path pattern (with /i for case-insensitive), a Hunks pattern and a Description, and previews what it catches right now. The Code card is always last in the sieve.
  3. + Add group adds an empty group; the presets add Docs, Lockfiles, Generated, CI or Boilerplate with ready-made patterns.
  4. Page order sets the order the groups show on the page, separate from the sieve.

Text commits on ↩ or when you leave the field; Esc restores it. With no field focused, Esc closes the panel. A pattern that doesn't compile is refused. Reset to defaults removes the setting at that scope. Saved changes re-sort every open review tab.

The configuration

The panel writes pr.diff_groups, a JSON object. Patterns are regular expressions matched against the file's new path only, never its content. For example, to add a Docs group and keep Tests:

json
{
  "groups": [
    { "id": "tests", "collapsed": true },
    { "id": "docs", "name": "Docs", "patterns": ["(^|/)docs?/", "\\.(md|mdx|rst)$"], "collapsed": false }
  ],
  "rest_name": "Code",
  "rest_collapsed": false,
  "display": ["rest", "docs", "tests"]
}
  • groups is the sieve, in order. A stored list replaces the built-in one: this example has no Boilerplate group. A group with a built-in id (tests, boilerplate) takes the built-in's values for any field it leaves out.
  • rest is the id of Code, the group of everything left; rest_name names it and rest_collapsed folds it.
  • display is the page order; ids it misses are added.
  • Each group may also carry hunk_patterns (by-hunk sorting, below) and description (what a decisions model reads).
  • A malformed group or a pattern that doesn't compile is dropped (it matches nothing) and noted under the cards.

pr.diff_groups resolves by scope: your override for the repository, then the team's value in the repository's .flowspace.json (under its settings object), then your User setting. See Settings scopes.

Sort by hunk

Turn on pr.diff_by_hunk (Settings › General › Pull requests › "Sort hunks, not whole files, into diff groups") to sort each hunk instead of each file. A group then takes a hunk when its path pattern matches the file, or when its hunk_patterns match every telling changed line (the line itself, or the scope it sits in, such as mod tests {). The built-in Tests group recognises Rust test modules, #[test], Python def test_ and class Test…, and describe / it / test blocks. A hunk mixing code and tests stays in Code. A file whose hunks land in several groups shows one card per group, each reading k of n hunks.

Sort hunks with a decisions model

With the Decisions experiment on, a model can sort every hunk into the groups, including Boilerplate, which no pattern fills.

Note: Decisions is an experiment (ALPHA). Turn it on in Settings › Experiments (features.decisions). While it is off, the "Sort hunks with the decisions model" row is hidden and nothing is sent anywhere.

  1. Turn on Settings › Experiments › Decisions.
  2. In Settings › Decisions, pick a provider (TypeSafe, OpenAI, Ollama, LM Studio or a custom URL), its model and key source, and press Test connection.
  3. Turn on Settings › General › Pull requests › Sort hunks with the decisions model (pr.diff_by_model). It sorts by hunk whether or not pr.diff_by_hunk is on.
  4. Optionally describe each group in the Diff groups panel's Description field; the model reads the names and descriptions.

When a review tab shows a PR, one background job asks the model about every hunk it hasn't answered before. The patterns sort meanwhile, and keep any hunk the model answers with a probability under 0.5, refuses or fails on, and any past 300 calls for one PR. A dim line under the cards says how it stands, such as Sorting 47 hunks with jev-latest… or Sorted by jev-1.14.0 · 47 hunks · 7 by patterns. Answers are cached on your Mac, so an unchanged hunk is never asked twice.

Warning: With a hosted provider (TypeSafe, OpenAI, or a custom URL off your machine), each hunk's path, heading and text, up to 160 lines and about 8,000 characters, is sent to that provider. With Ollama or LM Studio it stays local.

To tell Flow when a hunk is in the wrong group, right-click a line in it and open Hunk group: pick "✓ Code is right" (the group it is in) or "Should be:" another group. Each pick appends a sample to ~/.flow/hunk_samples/OWNER/REPO.jsonl. This works with the model off too.

Comment and review

Nothing you write is posted until you press its button; a review's inline comments wait as drafts until you submit the review.

The comment box

Every composer has Write and Preview tabs and a Markdown toolbar. ⌘↩ runs its main button. A composer holding the keyboard keeps every key except unbound ⌘ chords; ⌘C copies its own selection.

Top-level comments

The "Add a comment" box sits under the Activity heading (newest first) or at the end of the conversation (oldest first). Its Comment button posts a comment on the PR.

To attach images, use the box's Image button (several files), drop files on it, or paste an image; pasted images are saved under ~/.flow/attachments/. GitHub's CLI uploads them when you post: it needs gh 2.99 or newer and push access, and takes PNG, JPEG, GIF, WebP, SVG, MP4, MOV and WebM. Images can only go in top-level comments.

Inline comments and pending reviews

  1. On Changes, hover a diff line and click the + in its gutter. A comment box opens under the line.
  2. To comment on a range, shift-click another line in the same hunk.
  3. Choose Add single comment to post it now, or Start a review to keep it as a pending draft. Further drafts use Add review comment.
  4. Pending drafts hang under their lines as "Pending" cards with Edit and Delete. They are kept per PR on your Mac, so they survive closing the tab or quitting Flow.
  5. Click Finish review in the toolbar. In the popover, write an optional summary, choose Comment, Approve or Request changes, and press Submit with N comments (or Submit review with no drafts), or ⌘↩.

Approve and Request changes are disabled on your own PR. Request changes needs a summary; Comment needs one when no drafts are pending. A review can't be submitted while a pending draft has unsaved edits.

Replies, resolving and edits

  • Every thread ends with a "Reply…" box and a Resolve / Unresolve button (also in the thread's header), shown when GitHub lets you.
  • Your own comments carry Edit and Delete. Delete asks first.

After a successful write the PR is read again fresh. A failure keeps your text and shows GitHub's message.

Request reviewers

While a PR is open, the Request pill beside the Reviews caption (or Request reviewers…, unbound) opens the reviewer picker:

  • A search field, then Groups (your configured groups, each with its own Request button), Starred, Top contributors (the repository's 10 most frequent commit authors on the default branch over the last year, bots and the PR author left out) and, once you type, Results from GitHub (users, then teams).
  • Pick any number of people and teams. Each person shows where they stand on the PR (author, requested, approved, changes requested, commented). A team offers Team (request the team) or Members (request each member).
  • Request N sends the request. Save as group… saves your picks as a group in ~/.flow/flowspace.json.
  • Esc, or a click elsewhere on the page, closes the picker.

The ↻ button on a reviewer's row re-requests their review. On a draft, the state chip's Mark ready for review (…) rows offer up to five quick choices, the groups and people you request most in the repository first, and mark the PR ready before requesting them.

Reviewer groups

Define groups in the reviewers key of .flowspace.json (the repository's, a subdirectory's, your per-repository file or ~/.flow/flowspace.json):

json
{
  "reviewers": {
    "groups": [
      {
        "name": "be reviewers",
        "members": ["alice", "org/backend", "org/infra/*", "org/web/{random:2}", "org/sre/{robin:1}"],
        "auto_merge": true
      }
    ],
    "starred": ["alice"],
    "ignored": ["dependabot", "carol"]
  }
}
MemberRequests
loginThat user
org/teamThe team itself
org/team/*Each member of the team
org/team/{random:N}N members at random
org/team/{robin:N}The N members requested least recently in this repository (never-requested first)
  • The PR author, ignored logins and duplicates are skipped. A leading @ is dropped.
  • "auto_merge": true on a group also enables auto-merge on the PR when you request that group; its quick row reads "(NAME · auto-merge)".
  • Groups from several files combine by name (case-insensitive), the nearest file winning; starred and ignored are unions. See .flowspace.json.

Quick links put your own links at the top of the details column: dashboards, deploys, tickets. Configure them in the quick_links key of .flowspace.json:

json
{
  "quick_links": {
    "links": [
      { "label": "Grafana", "url": "https://grafana.example.com/d/x?var-repo={repo}&var-pr={number}" },
      { "label": "Deploy", "url": "https://deploy.example.com/{owner}/{repo}/{branch}", "repos": ["myorg/*"] },
      { "label": "Team channel", "url": "https://chat.example.com/channels/{codeowners}" }
    ],
    "patterns": [
      { "label": "Rollout {1}", "match": "https://rollout\\.example\\.com/(\\w+)/\\S+", "in": ["body", "comments"] },
      { "label": "Ticket {1}", "match": "\\b(ABC-\\d+)\\b", "url": "https://jira.example.com/browse/{1}" }
    ]
  }
}
  • links are fixed links. patterns find links in the PR's text: match is a regular expression run over the description ("body", the default) and, with "comments", the comments and reviews. Each match is a link, at most 20 per pattern; url defaults to the whole match.
  • repos (optional) limits a link or pattern to repositories matching owner/name globs, * matching anything.
  • Only http:// and https:// links show, and a link whose URL needs a value that is empty is dropped. Duplicates by URL are dropped.
  • Files combine: links from every file, then patterns. A config change applies on the next refresh.
  • Flow reads the repository's own files and its CODEOWNERS only when the session's directory is a checkout of the PR's repository; otherwise only ~/.flow/flowspace.json.
TokenValue
{host}The PR's host
{owner}, {repo}, {slug}The owner, the repository name, owner/name
{number}The PR number
{branch}, {base}The head and base branches
{author}The author's login
{sha}The head commit
{title}The PR title
{codeowners}The CODEOWNERS owners of the changed files, comma-separated
{0}, {1}, …A pattern's whole match and its capture groups

In a URL each value is percent-encoded, except {slug}'s slash and a capture that starts the URL. {codeowners} reads .github/CODEOWNERS, CODEOWNERS or docs/CODEOWNERS; for each changed file the last matching rule wins.

PR review sessions

A review session is a session group whose primary tab is the PR's review tab, named #N and the PR's title, working in a checkout of the PR's branch. Open one:

  • From the palette: Open PR as session… (unbound), then type or paste a PR URL, owner/repo#N, host/owner/repo#N, #N or N. A bare number means the current session's repository.
  • By pasting a PR URL straight into the palette: an "Open owner/repo#N as session" row comes first.
  • From the Reviews and My PRs pages: Start review / Open PR session, ↩, or the @mention callout's buttons.

If a session on that PR is already open, the row reads "Resume" and Flow switches to it. A new session opens on the Sessions page (on the Dashboard its card is focused).

Where the checkout comes from

On a background thread, Flow looks through the clones it knows (your open sessions' directories, the repository picker's pins and recents, and ~/src) and each clone's worktrees, and uses the first that applies:

  1. An existing checkout of the PR's head branch, yours. It is never removed.
  2. A read-only review worktree at CLONE/.worktrees/pr-N, detached at the PR's head (fetched from pull/N/head). Closing the session removes it, unless another session works in it, you changed something in it, or it holds a notebook page; then it is kept and a toast says so.
  3. A new clone under pr.clone_dir (default ~/src), with the head branch checked out. The clone is yours to keep. A fork's branch gets a review worktree in the new clone instead.

Set pr.clone_dir to an empty string to never clone; a session with no checkout then reads GitHub only. For example:

sh
flow-cli settings set pr.clone_dir "~/code"

Every read names the PR's repository, so a session whose directory is some other checkout still shows the right PR.

What a review session remembers

Viewed files, pending review drafts and the head commit you last saw are kept on your Mac per PR, shared by every review tab on it, and never sent to GitHub. A Dashboard card for the session shows the viewed progress and reads "New commits" once the PR's head moves past the one you saw.

Settings

KeyTypeDefaultEffect
git.open_pr_in_reviewbooleantrue⇧⌘G, the PR pill and a Dashboard card's PR label open a review tab; off, the browser
git.pin_pr_review_tabbooleantrueReview tabs open pinned to the front of their pane
pr.diff_wrapbooleantrueWrap long diff lines; off, cells scroll sideways
pr.ref_chipsgithub, titled or compactgithubHow #123 references show
pr.diff_groupsJSON objectCode, Boilerplate, TestsThe diff groups; scoped per repository
pr.diff_by_hunkbooleanfalseSort hunks, not whole files, into groups
pr.diff_by_modelbooleanfalseSort hunks with the decisions model (shown only with features.decisions on)
pr.clone_dirtext~/srcWhere a review session clones a repository it can't find; empty turns cloning off
features.decisionsbooleanfalseThe Decisions experiment

The toggles are under Settings › General › Pull requests. Review-tab actions without a default chord (Toggle PR details panel, Toggle PR activity order, Toggle PR diff groups panel, Toggle Markdown preview, Request reviewers…, Open PR as session…) can be bound in Settings › Keyboard; see Keybindings.

Limits

  • Review tabs read github.com and one GitHub Enterprise Cloud tenant (NAME.ghe.com); other hosts open in the browser.
  • Diffs over 300 files or 20,000 lines can't be shown (GitHub's own limit).
  • Images can only be attached to top-level comments, and need gh 2.99 or newer.
  • There is no whitespace toggle in the diff.
  • A remote session's PR is read and written from this Mac, with this Mac's GitHub credentials; personal line notes aren't available there.
Sources

Written from these files in the Flow app repo

  • src/pr_review.rs
  • src/pr_review_ui.rs
  • src/pr_cache.rs
  • src/pr_compose.rs
  • src/pr_compose_ui.rs
  • src/pr_write.rs
  • src/pr_diff_groups.rs
  • src/pr_groups_ui.rs
  • src/pr_hunk_model.rs
  • src/pr_session.rs
  • src/pr_session_ui.rs
  • src/reviewers.rs
  • src/reviewers_ui.rs
  • src/pr_links.rs
  • src/pr_refs.rs
  • src/pr_refs_app.rs
  • src/pr_status.rs
  • src/dashboard_ui.rs
  • src/md_diff.rs
  • src/gh.rs
  • src/flowspace.rs
  • src/command.rs
  • src/pages.rs
  • src/settings_catalog.rs
  • src/scope.rs
  • src/bus.rs
  • docs/decisions.md
  • docs/settings-scopes.md