Only show diff file tree when more than one file changed#27775
Merged
silverwind merged 2 commits intogo-gitea:mainfrom Oct 25, 2023
Merged
Only show diff file tree when more than one file changed#27775silverwind merged 2 commits intogo-gitea:mainfrom
silverwind merged 2 commits intogo-gitea:mainfrom
Conversation
delvh
approved these changes
Oct 24, 2023
| @@ -1,7 +1,8 @@ | |||
| {{$showFileTree := (and (not .DiffNotAvailable) (gt .Diff.NumFiles 1))}} | |||
Member
There was a problem hiding this comment.
The double negation is an interesting choice.
Had to think way too hard about it.
Member
Author
There was a problem hiding this comment.
Yeah, negated vars are generally bad, but you can read it as "if diff is available and number of files is greater than one".
lunny
approved these changes
Oct 25, 2023
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Oct 25, 2023
* giteaoffical/main: Fix issue not showing on default board and add test (go-gitea#27720) Show placeholder email in privacy popup (go-gitea#27770) Add word-break to organization name and description (go-gitea#26624) Add border to file tree 'sub-items' and add padding to 'item-file' (go-gitea#27593) Fix the missing repo count in new team page and edit team page (go-gitea#27743) Only show diff file tree when more than one file changed (go-gitea#27775) Add gap between diff boxes (go-gitea#27776)
fuxiaohei
pushed a commit
to fuxiaohei/gitea
that referenced
this pull request
Jan 17, 2024
) When 0 or 1 files changed in a diff, we don't need to show a file tree. This behaviour matches GitHub. Single-file diff after this change, note absence of button: <img width="1234" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/3618438b-e655-42a3-989f-f299267b2b8b"> Co-authored-by: Giteabot <teabot@gitea.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When 0 or 1 files changed in a diff, we don't need to show a file tree. This behaviour matches GitHub. Single-file diff after this change, note absence of button: