Review comment links don't work for files that exceed max_git_diff limits #8153

Open
opened 2025-11-02 07:55:25 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @jpraet on GitHub (Nov 22, 2021).

Gitea Version

1.16.0+dev-581-gbaed01f24

Git Version

No response

Operating System

No response

How are you running Gitea?

try.gitea.io

Database

No response

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Description

With #16829 and #17739 we can now display files beyond MAX_GIT_DIFF_FILES and MAX_GIT_DIFF_LINES, and add review comments on them.

But the files view initially only loads the first page of files, and only those files that don't exceed the max lines.
So direct links (e.g. when navigating from the conversation view) to comments that are added on such files do not work.

Example:

Screenshots

No response

Originally created by @jpraet on GitHub (Nov 22, 2021). ### Gitea Version 1.16.0+dev-581-gbaed01f24 ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? try.gitea.io ### Database _No response_ ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Description With #16829 and #17739 we can now display files beyond MAX_GIT_DIFF_FILES and MAX_GIT_DIFF_LINES, and add review comments on them. But the files view initially only loads the first page of files, and only those files that don't exceed the max lines. So direct links (e.g. when navigating from the conversation view) to comments that are added on such files do not work. Example: * https://try.gitea.io/jpraet-org/test-repo/pulls/1/files#issuecomment-112226 (a comment on file 105, but only 100 are loaded) * https://try.gitea.io/jpraet-org/test-repo/pulls/2/files#issuecomment-112222 (a commend on a large file) ### Screenshots _No response_
Author
Owner

@zeripath commented on GitHub (Nov 22, 2021):

I don't think we can fix this very easily.

@zeripath commented on GitHub (Nov 22, 2021): I don't think we can fix this very easily.
Author
Owner

@wxiaoguang commented on GitHub (Nov 23, 2021):

It depends on our frontend refactoring to provide a better frontend component mechanism.

@wxiaoguang commented on GitHub (Nov 23, 2021): It depends on our frontend refactoring to provide a better frontend component mechanism.
Author
Owner

@Gusted commented on GitHub (Nov 24, 2021):

It depends on our frontend refactoring to provide a better frontend component mechanism.

So, the front-end can detect that isssuecomment-xxx is specified in the URL, and it can very easily check if it's in the DOM.

When the code knows that it's the DOM, do nothing, but if it sees that isssuecomment-xxx isn't in the dom, and it sees that the show more files button is present(and code will make a guess that this comment is in those files), then it could show a popup:

"It seems like that a specific comment should be shown, but the comment could not be found in the loaded files. Would you like to load the additional files of this PR and see if it's present in those" (something along those lines).

@Gusted commented on GitHub (Nov 24, 2021): > It depends on our frontend refactoring to provide a better frontend component mechanism. So, the front-end can detect that `isssuecomment-xxx` is specified in the URL, and it can very easily check if it's in the DOM. When the code knows that it's the DOM, do nothing, but if it sees that `isssuecomment-xxx` isn't in the dom, and it sees that the show more files button is present(and code will make a guess that this comment is in those files), then it could show a popup: "It seems like that a specific comment should be shown, but the comment could not be found in the loaded files. Would you like to load the additional files of this PR and see if it's present in those" (something along those lines).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8153