Skip to content
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

Expanding diff view broken #18281

Closed
noerw opened this issue Jan 15, 2022 · 9 comments · Fixed by #18287
Closed

Expanding diff view broken #18281

noerw opened this issue Jan 15, 2022 · 9 comments · Fixed by #18287
Labels
topic/ui Change the appearance of the Gitea UI type/bug
Milestone

Comments

@noerw
Copy link
Member

noerw commented Jan 15, 2022

Gitea Version

1.16.0+dev-841-gd413a1f8a d413a1f

Git Version

Operating System

latest firefox

How are you running Gitea?

irrelevant

Database

No response

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Description

Expanding a diff results in broken rendering of the diff, see also attached video.

afaik this happens on PR diff page, as well as commit diff page.

Screenshots

gitea_diff-2022-01-15_12.46.02.mp4
@noerw noerw added type/bug topic/ui Change the appearance of the Gitea UI labels Jan 15, 2022
@noerw noerw added this to the 1.16.0 milestone Jan 15, 2022
@silverwind
Copy link
Member

silverwind commented Jan 15, 2022

Weird one, the JS spews some apparently escaped HTML into the DOM.

image

I think it must be a recent regression. Maybe worth a bisect.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Jan 15, 2022

The bug is caused by we wrote <code class="code-inner">{{$.section.GetComputedInlineDiffFor $line}}</code> ( Add warning for BIDI characters in page renders and in diffs (#17562) )

Before, GetComputedInlineDiffFor returns HTML text.

Now, GetComputedInlineDiffFor returns DiffInline struct, so we should change the forgotten {{$.section.GetComputedInlineDiffFor $line}} call to output the DiffInline.Content.

Possible code:

<td class="blob-excerpt lines-code{{if (not $line.RightIdx)}} lines-code-old{{end}}"><code class="code-inner">{{$.section.GetComputedInlineDiffFor $line}}</code></td>

@zeripath
Copy link
Contributor

agh this is due to an interaction between the BIDI pr and the diff PR.

When the diff PR was created the BIDI PR wasn't merged and when the BIDI PR was created the diff PR wasn't merged.

@zeripath
Copy link
Contributor

Actually no it's a bit of debugging code that got left in.

zeripath added a commit to zeripath/gitea that referenced this issue Jan 15, 2022
Unfortunately it appears that a small bit of debugging code was left in blob_excerpt.tmpl
This breaks diff expansion causing go-gitea#18281.

Fix go-gitea#18281

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit that referenced this issue Jan 16, 2022
* Remove accidental debugging in blob_excerpt.tmpl

Unfortunately it appears that a small bit of debugging code was left in blob_excerpt.tmpl
This breaks diff expansion causing #18281.

Fix #18281

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@andre161292
Copy link

This is still broken. Please have a look at https://try.gitea.io/testerxxx/gitea/pulls/1/files (or any other diff on try.gitea.io).

I'm also experiencing the issue in the gitea/gitea:1.16.0-linux-amd64 docker image.

@wxiaoguang
Copy link
Contributor

I managed to reproduce the bug:

image

@wxiaoguang wxiaoguang reopened this Feb 1, 2022
@wxiaoguang wxiaoguang modified the milestones: 1.16.0, 1.17.0 Feb 1, 2022
@wxiaoguang
Copy link
Contributor

This is still broken. Please have a look at https://try.gitea.io/testerxxx/gitea/pulls/1/files (or any other diff on try.gitea.io).

I'm also experiencing the issue in the gitea/gitea:1.16.0-linux-amd64 docker image.

@andre161292 if you meet other bugs, please help to tell the Gitea team how to reproduce it and get a screenshot. Thank you very much ~~

@lunny
Copy link
Member

lunny commented Feb 1, 2022

#18516 and #18517 have reported the problem.

@zeripath
Copy link
Contributor

zeripath commented Feb 1, 2022

Fixed by #18502

@zeripath zeripath closed this as completed Feb 1, 2022
Chianina pushed a commit to Chianina/gitea that referenced this issue Mar 28, 2022
* Remove accidental debugging in blob_excerpt.tmpl

Unfortunately it appears that a small bit of debugging code was left in blob_excerpt.tmpl
This breaks diff expansion causing go-gitea#18281.

Fix go-gitea#18281

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/ui Change the appearance of the Gitea UI type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants