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

Diff view of editor is broken #23265

Closed
JakobDev opened this issue Mar 3, 2023 · 4 comments · Fixed by #23307
Closed

Diff view of editor is broken #23265

JakobDev opened this issue Mar 3, 2023 · 4 comments · Fixed by #23307
Labels
topic/ui Change the appearance of the Gitea UI type/bug
Milestone

Comments

@JakobDev
Copy link
Contributor

JakobDev commented Mar 3, 2023

Description

The diff of the built-in Editor is completely broken. It doesn't show the Line numbers and also doesn't show, when another part of the file starts.

Screenshots

The diff of the Editor:
grafik

The normal diff view after making the commit for comparison:
grafik

Gitea Version

1.18.3

Can you reproduce the bug on the Gitea demo site?

Yes

Operating System

Manjaro

Browser Version

Firefox 110

@JakobDev JakobDev added type/bug topic/ui Change the appearance of the Gitea UI labels Mar 3, 2023
@lunny
Copy link
Member

lunny commented Mar 3, 2023

Could you try 1.18.5?

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Mar 3, 2023

On try.gitea.io, it's also broken.

ps: IMO, not "completely" broken, only partially broken 😂 the diff part still works, but the line number & hidden block don't work. Luckily, users could still see the diff. And yes, this is a regression bug and should be fixed.

image

@silverwind
Copy link
Member

"broken" does not accurately describe this issue.

@wxiaoguang
Copy link
Contributor

It has been broken for long time, not only one regression I guess.

See Fix broken code editor diff preview #23307

@lunny lunny added this to the 1.18.6 milestone Mar 5, 2023
lunny pushed a commit that referenced this issue Mar 6, 2023
Close #23265, the code editor diff preview has been broken for long
time.

* Fix the regression for `data-line-num`
    * `.code-diff` is necessary to show the line number
* Fix the regression for #12434
* The diff:
[12434](https://github.com/go-gitea/gitea/pull/12434/files?diff=unified&w=1)
    * It hides the Type(4) (aka HunkHeader)  for unexpected cases.


Diff with ignoring whitespaces:
https://github.com/go-gitea/gitea/pull/23307/files?diff=unified&w=1

Before: see the issue #23265

After:

![image](https://user-images.githubusercontent.com/2114189/222942810-286dc9af-0b39-4e9d-8585-8c299b881241.png)
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Mar 6, 2023
Close go-gitea#23265, the code editor diff preview has been broken for long
time.

* Fix the regression for `data-line-num`
    * `.code-diff` is necessary to show the line number
* Fix the regression for go-gitea#12434
* The diff:
[12434](https://github.com/go-gitea/gitea/pull/12434/files?diff=unified&w=1)
    * It hides the Type(4) (aka HunkHeader)  for unexpected cases.


Diff with ignoring whitespaces:
https://github.com/go-gitea/gitea/pull/23307/files?diff=unified&w=1

Before: see the issue go-gitea#23265

After:

![image](https://user-images.githubusercontent.com/2114189/222942810-286dc9af-0b39-4e9d-8585-8c299b881241.png)
jolheiser pushed a commit that referenced this issue Mar 6, 2023
Backport #23307

Close #23265, the code editor diff preview has been broken for long
time.

* Fix the regression for `data-line-num`
    * `.code-diff` is necessary to show the line number
* Fix the regression for #12434
* The diff:
[12434](https://github.com/go-gitea/gitea/pull/12434/files?diff=unified&w=1)
    * It hides the Type(4) (aka HunkHeader)  for unexpected cases.


Diff with ignoring whitespaces:
https://github.com/go-gitea/gitea/pull/23307/files?diff=unified&w=1

Before: see the issue #23265

After:


![image](https://user-images.githubusercontent.com/2114189/222942810-286dc9af-0b39-4e9d-8585-8c299b881241.png)

Co-authored-by: wxiaoguang <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
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.

4 participants