# Reviewing pull requests

Read the code, discuss changes, and submit your review to GitHub.

Let's start with an open pull request. You can get to it from the inbox, a repository's pull request list, or a GitHub link in the launcher.

The pull request has three tabs: **Discussion** for the description and conversation, **Changes** for reviewing the code, and **Commits** for individual commits.

> [!NOTE]
> Chonk uses a local copy of the repository for fast diffs and file navigation. Repositories up to 100 MB are cloned automatically. For each larger repository, Chonk asks once before cloning.

## Code review

Open **Changes** to review the diff. You will notice three tabs:

- **Unreviewed** shows the changes you still need to review.
- **Reviewed** shows the changes you have already marked reviewed.
- **All** shows the full current pull request diff.

As you read the diff, mark files or individual diff sections as reviewed. Chonk remembers the code you reviewed. Suppose you review a file and the author then changes one line. **Unreviewed** shows the diff between the version you reviewed and the new version. The rest of the file stays reviewed. If the author removes code you had reviewed, that removal also appears as a new change to check.

![A pull request diff with Unreviewed, Reviewed, and All filters](/images/screenshots/docs/pull-request-changes.png)

You can mark a whole file as reviewed with <span class="kbd-group"><kbd>Shift</kbd> <kbd>R</kbd></span> while your pointer is over it.

With your pointer over the diff, <kbd>E</kbd> shows or hides all unchanged lines in the diff. <span class="kbd-group"><kbd data-linux="Ctrl">Cmd</kbd> <kbd>Click</kbd></span> on a line opens the full file in a new tab, where you can view its history or use blame to see which commits last changed each line. <span class="kbd-group"><kbd data-linux="Ctrl">Cmd</kbd> <kbd>Shift</kbd> <kbd>F</kbd></span> searches across all files at the selected revision of the repository.

## Comments and reviews

You can leave comments in the diff. New review comments become part of your draft and wait until you submit the review. General discussion comments and replies to existing threads are sent right away (through the [outbox](/docs/sync-and-outbox)).

Holding <span class="kbd-group"><kbd>Shift</kbd> <kbd>C</kbd></span> lets you select lines with your pointer; the comment editor opens when you release the keys. You can also conveniently suggest code changes by pressing <span class="kbd-group"><kbd>Shift</kbd> <kbd>E</kbd></span> and editing the diff in place. Once you are finished, clicking **Suggest** opens a comment editor with your edits in a ```` ```suggestion ```` block. The author's branch stays unchanged.

![A comment editor on a selected line in a pull request diff](/images/screenshots/docs/review-comment.png)

When your feedback is ready, open **Review** to check your draft comments, add an optional summary, and choose **Comment**, **Approve**, or **Request changes**. Chonk submits the review in the background. If it fails, the [outbox](/docs/sync-and-outbox#outbox) shows the error and lets you retry.

### When the code changes

Comments follow the code as it changes. A **Code changed** label means the commented code has since been edited; select **Show original** to see what the comment referred to. If the lines are no longer in the diff, the thread is labeled **Detached** and shown at the end of the file with its original snippet.

If the author pushes changes that make your draft comment outdated, Chonk flags it and prevents you from submitting the stale review. You can use **Reposition** to place the comment in the updated diff, edit the comment if needed, or delete it if it no longer applies.

## Merge status

The merge status card shows checks, reviews, and unresolved comments, along with whether the pull request is ready to merge. It also shows when an action is needed, such as approving workflow runs or marking a draft as ready for review.

<img src="/images/screenshots/docs/merge-status.png" alt="Passing checks, an approved review, and the merge button" width="288">

When the pull request is ready to merge, choose one of the available merge methods and review the details. The available actions follow your GitHub permissions and the repository's rules.

A merge applies to the changes you saw. If the author pushes more code before the merge reaches GitHub, GitHub can reject it. Review the new changes before trying again.
