diff --git a/assets/images/help/pull_requests/pr-file-tree.png b/assets/images/help/pull_requests/pr-file-tree.png new file mode 100644 index 0000000000..cca0c65829 Binary files /dev/null and b/assets/images/help/pull_requests/pr-file-tree.png differ diff --git a/content/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/filtering-files-in-a-pull-request.md b/content/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/filtering-files-in-a-pull-request.md index bd7a9b087f..025220fe3e 100644 --- a/content/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/filtering-files-in-a-pull-request.md +++ b/content/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/filtering-files-in-a-pull-request.md @@ -1,6 +1,6 @@ --- title: Filtering files in a pull request -intro: 'To help you quickly review changes in a large pull request, you can filter changed files.' +intro: 'To help you quickly review changes in a large pull request, you can filter changed files{% if pr-tree-view %} or use the file tree to navigate between files{% endif %}.' redirect_from: - /github/collaborating-with-issues-and-pull-requests/reviewing-changes-in-pull-requests/filtering-files-in-a-pull-request - /articles/filtering-files-in-a-pull-request-by-file-type @@ -16,7 +16,9 @@ topics: - Pull requests shortTitle: Filter files --- -You can filter files in a pull request by file extension type, such as `.html` or `.js`, lack of an extension, code ownership, or dotfiles. +You can filter files in a pull request by file extension type, such as `.html` or `.js`, lack of an extension, code ownership, or dotfiles.{% if pr-tree-view %} You can also use the file tree to filter by file path, navigate between files, or see a high level view of the changed files.{% endif %} + +## Using the file filter dropdown {% tip %} @@ -32,6 +34,26 @@ You can filter files in a pull request by file extension type, such as `.html` o 5. Optionally, to clear the filter selection, under the **Files changed** tab, click **Clear**. ![Clear file filter selection](/assets/images/help/pull_requests/clear-file-filter.png) +{% if pr-tree-view %} +## Using the file tree + +{% data reusables.repositories.sidebar-pr %} +1. In the list of pull requests, click the pull request you'd like to filter. +{% data reusables.repositories.changed-files %} +1. If the file tree is hidden, click **Show file tree** to display the file tree. + + {% note %} + + **Note**: The file tree will not display if your screen width is too narrow or if the pull request only includes one file. + + {% endnote %} + +1. Click on a file in the file tree to view the corresponding file diff. + ![Pull request file tree](/assets/images/help/pull_requests/pr-file-tree.png) +1. To filter by file path, enter part or all of the file path in the **Filter changed files** search box. Alternatively, use the file filter dropdown. For more information, see "[Using the file filter dropdown](#using-the-file-filter-dropdown)." + +{% endif %} + ## Further reading - "[About comparing branches in a pull request](/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-comparing-branches-in-pull-requests)" diff --git a/content/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-proposed-changes-in-a-pull-request.md b/content/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-proposed-changes-in-a-pull-request.md index 3635048c07..f5713b166e 100644 --- a/content/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-proposed-changes-in-a-pull-request.md +++ b/content/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-proposed-changes-in-a-pull-request.md @@ -36,6 +36,7 @@ You can review changes in a pull request one file at a time. While reviewing the You can also choose to hide whitespace differences. The choice you make only applies to this pull request and will be remembered the next time you visit this page. {% endif %} +1. Optionally, filter the files to show only the files you want to review{% if pr-tree-view %} or use the file tree to navigate to a specific file{% endif %}. For more information, see "[Filtering files in a pull request](/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/filtering-files-in-a-pull-request)." {% data reusables.repositories.start-line-comment %} {% data reusables.repositories.type-line-comment %} {% data reusables.repositories.suggest-changes %} diff --git a/data/features/pr-tree-view.yml b/data/features/pr-tree-view.yml new file mode 100644 index 0000000000..12f8c55691 --- /dev/null +++ b/data/features/pr-tree-view.yml @@ -0,0 +1,7 @@ +# Issue 5892 +# PR file tree view +versions: + fpt: '*' + ghec: '*' + ghes: '>=3.5' + ghae: 'issue-5892'