-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Use git diff-tree
for DiffFileTree
on diff pages
#33514
base: main
Are you sure you want to change the base?
Conversation
git diff-tree
for DiffFileTree
on diff pages
4799444
to
5752410
Compare
I think you don't need to update all the language files except en_US. |
I am not sure I understand, If I remove it from |
Because other language files will be synced from translate.gitea.com, so basicaly you just need to change the |
b50105b
to
0982492
Compare
I did a test manually, looks like a modified file can not be selected. |
@lunny Apologizes for the delay. I wasn't able to reproduce your issue. Could you provide some more details? Screen.Recording.2025-02-24.at.1.47.47.PM.mov |
0982492
to
705f380
Compare
705f380
to
dbd2c36
Compare
@@ -184,8 +184,6 @@ export async function loadMoreFiles(url: string) { | |||
// the response is a full HTML page, we need to extract the relevant contents: | |||
// 1. append the newly loaded file list items to the existing list | |||
$('#diff-incomplete').replaceWith($resp.find('#diff-file-boxes').children()); | |||
// 2. re-execute the script to append the newly loaded items to the JS variables to refresh the DiffFileTree | |||
$('body').append($resp.find('script#diff-data-script')); |
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.
Since the legacy script#diff-data-script
won't be executed again anymore, these JS code should be moved from "tmpl" to "ts" files?
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.
I am not sure what you mean, the script embedded in the template still runs on first load and needs information from go to template the script.
It could be more minimal such that the template only embeds JSON information however this was also true before this pull request.
Let me know if I have misunderstood. 😃
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.
It could be more minimal such that the template only embeds JSON information however this was also true before this pull request.
Actually that was not true before this PR .... the old code was written intentionally to make it could reload the data when "load more", but it seems that the "load more" won't affect the script in tmpl now.
Never mind, I could do some following up changes to refactor the legacy code.
The [rule](https://typescript-eslint.io/rules/no-use-before-define/) is a superset of the eslint base rule, and I tested it with #33514 (comment) where it does not raise an error for cyclic types.
== Changes * removes Show Status button on diff * uses `git diff-tree` to generate the file tree for the diff update locale to remove diff.show_diff_stats
dbd2c36
to
4e74e74
Compare
ps: no need to force-push when review starts, the final merge is a squash merge. Force-push makes the review difficult because every-line needs to be re-reviewed since everything is in a commit. |
Modify Diff View FileTree to show all files
Changes
git diff-tree
to generate the file tree for the diffDiffFileList.vue
and "Show Stats" in diff optionsOpen Questions
Demo
In this demo I set
git.MAX_GIT_DIFF_FILES=1
in myapp.ini
to demonstrate a worst case example. In most cases the behaviour isn't nearly as jarring as we load a bunch of files at a time.Screen.Recording.2025-02-06.at.6.51.03.PM.mov