feat(diff): Add search and extension filter to diff sidebar (#37068)

Adds a search box and a file-extension filter to the pull request diff
sidebar, so reviewers can narrow a large diff down to the files they
care about.

Both filters apply to the file tree and to the diff itself. The
extension menu follows GitHub: extensions sorted alphabetically,
dotfiles and extension-less files in their own buckets, and the
selection kept in the same `file-filters[]` query parameter, so a
filtered view is shareable and survives a reload.

The menu can list every extension in a diff, so `createTippy` gains an
opt-in `limitSizeToViewport` option that caps a popup to the space left
in the viewport and scrolls its content. Popups that do not ask for it
are unchanged.

Closes https://github.com/go-gitea/gitea/issues/27256
Signed-off-by: silverwind <me@silverwind.io>
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Claude (Opus 4.7) <noreply@anthropic.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Nicolas <bircni@icloud.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
McMichalK
2026-08-23 18:31:22 +02:00
committed by GitHub
parent 4852091e85
commit 2bcf950b78
28 changed files with 914 additions and 133 deletions
+12 -3
View File
@@ -2597,9 +2597,9 @@
"repo.diff.file_byte_size": "Size",
"repo.diff.file_suppressed": "File diff suppressed because it is too large",
"repo.diff.file_suppressed_line_too_long": "File diff suppressed because one or more lines are too long",
"repo.diff.too_many_files": "Some files were not shown because too many files have changed in this diff",
"repo.diff.show_more": "Show More",
"repo.diff.load": "Load Diff",
"repo.diff.too_many_files": "Loaded %[1]d of %[2]d files, more files were not shown because too many files have changed in this diff.",
"repo.diff.show_more": "Show more",
"repo.diff.load": "Load diff",
"repo.diff.generated": "Generated",
"repo.diff.vendored": "Vendored",
"repo.diff.comment.add_line_comment": "Add line comment",
@@ -2627,6 +2627,15 @@
"repo.diff.has_escaped": "This line has hidden Unicode characters",
"repo.diff.show_file_tree": "Show file tree",
"repo.diff.hide_file_tree": "Hide file tree",
"repo.diff.filter_files": "Filter files…",
"repo.diff.filter_files_clear": "Clear filter",
"repo.diff.filter_by_file_extension": "Filter by file extension",
"repo.diff.file_extensions": "File extensions",
"repo.diff.no_file_extension": "No extension",
"repo.diff.dotfile_extension": "Dotfiles",
"repo.diff.all_file_extensions": "All extensions",
"repo.diff.no_files_matched": "No files matched your search",
"repo.diff.show_more_matching": "Show more - %[1]d matching below",
"repo.diff.submodule_added": "Submodule %[1]s added at %[2]s",
"repo.diff.submodule_deleted": "Submodule %[1]s deleted from %[2]s",
"repo.diff.submodule_updated": "Submodule %[1]s updated: %[2]s",