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

Side by Side Image comparison link does not work for svgs #17112

Closed
delvh opened this issue Sep 21, 2021 · 4 comments
Closed

Side by Side Image comparison link does not work for svgs #17112

delvh opened this issue Sep 21, 2021 · 4 comments
Labels
Milestone

Comments

@delvh
Copy link
Member

delvh commented Sep 21, 2021

Gitea Version

1.15.2

Operating System

Linux

Browser Version

Firefox 92.0

Can you reproduce the bug on the Gitea demo site?

https://try.gitea.io/delvh/kanban-test/pulls/21/files

Description

The link to use side by side comparison of an existing with a changed image does not work anymore. The only way to see a side-by-side comparison is to reload the PR as then side-by-side will automatically be selected.
The cursor still appears as if you could click it.
However, when you actually click on it, nothing happens.
There is also nothing logged inside the console.

Screenshots

Not possible in this case as that would be the same as requiring proof that a package did in fact not arrive.

@saitho
Copy link
Contributor

saitho commented Oct 3, 2021

@delvh Can you provide an example or reconstruct the issue on try.gitea.io or describe how to reproduce it?

@delvh
Copy link
Member Author

delvh commented Oct 3, 2021

Surprisingly, I cannot anymore.
Neither on try.gitea.io nor on a private Gitea server.
This leaves me with only three possible conclusions:
a) I hallucinated this malfunction. Unlikely. Proven not to be true.
b) It was fixed in the meantime, as now the private server is on 1.15.3. Also unlikely, because I wouldn't know which commit might have fixed it. Also not true.
c) There is a weird edge case somewhere in the JS that occurs on 1 out of 1000 images, i.e. an improperly handled error. The likeliest option. Possibly even beyond the scope of Gitea, if an external library is used to deliver this functionality.

@delvh delvh changed the title Side by Side Image comparison link does not work anymore Side by Side Image comparison link does not work for svgs Oct 19, 2021
@delvh
Copy link
Member Author

delvh commented Oct 19, 2021

I can reproduce the bug on try.gitea.io now: https://try.gitea.io/delvh/kanban-test/pulls/21/files
There seem to be two different preconditions to create this error:

  1. There is an already existing svg changed in this PR
  2. There is a newly added svg in this PR

Because of the newly added svg, the js somehow gets confused and thinks "I'm already on Side-by-side comparison, no need to do anything" because the control is mirrored for any image, I guess?

I don't know whether that applies to other image types as well.
I do know, however, that it applies to commit diffs too.

@silverwind
Copy link
Member

Fixed by #17375

@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
Projects
None yet
Development

No branches or pull requests

5 participants