-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Improve implementation of diff-file-tree #32768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 9 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3be6a1d
Improve implementation of diff-file-tree
kerwin612 5cf8d37
fix lint-error
kerwin612 08def88
fix
kerwin612 9032432
fix
kerwin612 678e0a2
Merge branch 'main' into optimize-diff-file-tree
kerwin612 f5d22f0
fix
kerwin612 d9a23e9
Merge branch 'main' into optimize-diff-file-tree
kerwin612 50b8c44
fix
kerwin612 c387ea4
fixed sort
kerwin612 ec05be0
add tests
kerwin612 edb932c
fix
kerwin612 04568db
Merge branch 'main' into optimize-diff-file-tree
kerwin612 60ca821
Merge branch 'main' into optimize-diff-file-tree
kerwin612 91cef16
Merge branch 'main' into optimize-diff-file-tree
kerwin612 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <div id="diff-file-tree" class="file-tree tw-hidden not-mobile"> | ||
| <div class="file-tree-items"> | ||
| {{range .Files}} | ||
| {{template "repo/diff/file_tree_item" .}} | ||
| {{end}} | ||
| </div> | ||
| {{if .IsIncomplete}} | ||
| <div class="tw-pt-1"> | ||
| <a class="ui basic tiny button diff-show-more-files" data-href="{{.LoadMoreLink}}">{{ctx.Locale.Tr "repo.diff.show_more"}}</a> | ||
| </div> | ||
| {{end}} | ||
| </div> |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| {{if .IsFile}} | ||
| <a class="item-file {{if .File.IsViewed}} viewed {{end}}" title="{{.Name}}" href="#diff-{{.File.NameHash}}"> | ||
| <!-- file --> | ||
| {{svg "octicon-file"}} | ||
| <span class="gt-ellipsis tw-flex-1">{{.Name}}</span> | ||
| {{if eq .File.Type 1}} | ||
| {{svg "octicon-diff-added" 16 "text green"}} | ||
| {{else if eq .File.Type 2}} | ||
| {{svg "octicon-diff-modified" 16 "text yellow"}} | ||
| {{else if eq .File.Type 3}} | ||
| {{svg "octicon-diff-removed" 16 "text red"}} | ||
| {{else if eq .File.Type 4}} | ||
| {{svg "octicon-diff-renamed" 16 "text teal"}} | ||
| {{else if eq .File.Type 5}} | ||
| {{svg "octicon-diff-renamed" 16 "text green"}} | ||
| {{end}} | ||
| </a> | ||
| {{else}} | ||
| <div class="item-directory" title="{{.Name}}"> | ||
| <!-- directory --> | ||
| {{svg "octicon-chevron-right" 16 "tw-hidden"}} | ||
| {{svg "octicon-chevron-down" 16}} | ||
| {{svg "octicon-file-directory-fill" 16 "text primary tw-hidden"}} | ||
| {{svg "octicon-file-directory-open-fill" 16 "text primary"}} | ||
| <span class="gt-ellipsis">{{.Name}}</span> | ||
| </div> | ||
| {{end}} | ||
| {{if and .Children (gt (len .Children) 0)}} | ||
| <div class="sub-items"> | ||
| {{range .Children}} | ||
| {{template "repo/diff/file_tree_item" .}} | ||
| {{end}} | ||
| </div> | ||
| {{end}} |
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.