-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Use git diff-tree
for DiffFileTree
on diff pages
#33514
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
Merged
silverwind
merged 8 commits into
go-gitea:main
from
McRaeAlex:gitea/am/file-tab-diff-tree
Feb 28, 2025
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4e74e74
Modify Diff View FileTree to show all files
McRaeAlex 3580286
Clean up code to address review comments
McRaeAlex 5619691
removed path() from DiffTreeRecord
McRaeAlex b1ba89d
Update web_src/js/components/DiffFileTreeItem.vue
McRaeAlex 7adbb76
remove legacy script block and simplify loadUntilFound
wxiaoguang adf5f3c
add missing return
wxiaoguang 3995ef5
Merge branch 'main' into gitea/am/file-tab-diff-tree
wxiaoguang a4d3bf4
Merge branch 'main' into gitea/am/file-tab-diff-tree
GiteaBot 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
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 |
---|---|---|
@@ -1,11 +1,16 @@ | ||
import {reactive} from 'vue'; | ||
import type {Reactive} from 'vue'; | ||
|
||
const {pageData} = window.config; | ||
|
||
let diffTreeStoreReactive: Reactive<Record<string, any>>; | ||
export function diffTreeStore() { | ||
if (!diffTreeStoreReactive) { | ||
diffTreeStoreReactive = reactive(window.config.pageData.diffFileInfo); | ||
window.config.pageData.diffFileInfo = diffTreeStoreReactive; | ||
diffTreeStoreReactive = reactive({ | ||
files: pageData.DiffFiles, | ||
fileTreeIsVisible: false, | ||
selectedItem: '', | ||
}); | ||
} | ||
return diffTreeStoreReactive; | ||
} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this removal, will it not flash wrong content on page load when diff tree is visible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I may be misunderstanding and this was just some data modification that has no reason to be in templates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's not related to "content flash" (and this block was marked as "module", it only executes after DOM ready).
Some old PRs used very tricky methods to make the Vue work, now it's the time to make code overall right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we should remove all such template js, except those cases that serve the purpose of avoiding flash, but those are better migrated to web components.