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

Prevent invalid behavior for file reviewing when loading more files #21230

Merged
merged 9 commits into from
Sep 21, 2022

Conversation

delvh
Copy link
Member

@delvh delvh commented Sep 21, 2022

The problem was that many PR review components loaded by Show more received the same ID as previous batches, which confuses browsers (when clicked).
All such occurrences should now be fixed.

Additionally improved the background of the viewed checkbox:
new background

Lastly, the go-licenses.json was automatically updated.

Fixes #21228.
Fixes #20681.

The problem was that later loaded files got the same ID, which confused
the browsers when clicked.

Additionally auto-update the go-licenses.json
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 21, 2022
@delvh
Copy link
Member Author

delvh commented Sep 21, 2022

I've noticed that this problem is present at least once more in this block (there are multiple other occurrences of {{i}} in the same range), however, I don't know where this might all be called, so I left it untouched for now.
If someone knows where the other ones are called, please feel free to fix it either in this PR or a new one.

@wxiaoguang
Copy link
Contributor

I've noticed that this problem is present at least once more in this block (there are multiple other occurrences of {{i}} in the same range), however, I don't know where this might all be called, so I left it untouched for now. If someone knows where the other ones are called, please feel free to fix it either in this PR or a new one.

Good catch, I think these {{$i}} should be fixed together. If you do not mind, I can submit my changes on this PR.

@delvh
Copy link
Member Author

delvh commented Sep 21, 2022

I have nothing against that.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Sep 21, 2022

One more thing .... should we remove the background of the checked viewed input?

It looks a little strange ....

image

Or maybe this (like GitHub)

image

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Sep 21, 2022
@delvh
Copy link
Member Author

delvh commented Sep 21, 2022

I don't think it's a good idea to remove it completely as it definitely helps with skimming through a PR,
but if you want to enhance it, I'm all for it.
I'm not really a designer, so better designs are always welcome.

@delvh
Copy link
Member Author

delvh commented Sep 21, 2022

Ah, the other changes didn't require any JS changes at all?

@wxiaoguang
Copy link
Contributor

Ah, the other changes didn't require any JS changes at all?

Yes, if I understand correctly, the other changes are only for SVG/CSV diff, to toggle the source. These IDs are used by data-toggle-selector, luckily they are on the same page.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Sep 21, 2022

I don't think it's a good idea to remove it completely as it definitely helps with skimming through a PR, but if you want to enhance it, I'm all for it. I'm not really a designer, so better designs are always welcome.

How do you think about this? (I could propose a new PR if we want to keep this PR simple)

image

image

@delvh
Copy link
Member Author

delvh commented Sep 21, 2022

Fine with me.
I have nothing against adding it to this PR.

@silverwind
Copy link
Member

Lastly, the go-licenses.json was automatically updated.

Odd, must be a bug in go-licenses, our go dependencies did not change since last generation.

@wxiaoguang
Copy link
Contributor

Lastly, the go-licenses.json was automatically updated.

Odd, must be a bug in go-licenses, our go dependencies did not change since last generation.

I also experience such problem. I just ignore(reset) that file everytime. It's good to get it in.

@delvh
Copy link
Member Author

delvh commented Sep 21, 2022

Well, it's inside our go.mod (

gitea/go.mod

Line 106 in 0a9a86b

gopkg.in/yaml.v3 v3.0.1
), and it wasn't inside go-licenses.json previously…

@GiteaBot GiteaBot removed the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Sep 21, 2022
@GiteaBot GiteaBot added the lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. label Sep 21, 2022
@silverwind
Copy link
Member

silverwind commented Sep 21, 2022

Well, it's inside our go.mod (

gitea/go.mod

Line 106 in 0a9a86b

gopkg.in/yaml.v3 v3.0.1

), and it wasn't inside go-licenses.json previously…

Might be because gopkg.in is down sometimes, so the license fetcher can not fetch license from there. We should probably exclude licenses from there if the service is unstable.

Edit: Thought, there are more packages from gopkg.in that also appear to be unaffected, so maybe it's a wrong lead.

Also use of a GOPROXY should prevent such issues in first place. Maybe we should just recommend setting one for all developers.

@wxiaoguang wxiaoguang merged commit acee32c into go-gitea:main Sep 21, 2022
@delvh delvh deleted the no-duplicate-viewed-checkbox-ids branch September 21, 2022 17:49
delvh added a commit to delvh/gitea that referenced this pull request Sep 21, 2022
…o-gitea#21230)

The problem was that many PR review components loaded by `Show more`
received the same ID as previous batches, which confuses browsers (when
clicked). All such occurrences should now be fixed.

Additionally improved the background of the `viewed` checkbox.

Lastly, the `go-licenses.json` was automatically updated.

Fixes go-gitea#21228.
Fixes go-gitea#20681.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@delvh delvh added the backport/done All backports for this PR have been created label Sep 21, 2022
zjjhot added a commit to zjjhot/gitea that referenced this pull request Sep 22, 2022
* upstream/main:
  Use absolute links in feeds (go-gitea#21229)
  Prevent invalid behavior for file reviewing when loading more files (go-gitea#21230)
  Respect `REQUIRE_SIGNIN_VIEW` for packages (go-gitea#20873)
  Make Clone in VSCode link get updated correctly (go-gitea#21225)
  Configure golangci-lint to show all issues (go-gitea#21106)
  Fix user visible check (go-gitea#21210)
  Fix template bug of admin monitor (go-gitea#21208)
  Clarify that `ENABLE_SWAGGER` only influences the API docs, not the routes (go-gitea#21215)
  Enable fluid page layout on medium size viewports (go-gitea#21178)
  [API] teamSearch show teams with no members if user is admin (go-gitea#21204)
techknowlogick pushed a commit that referenced this pull request Sep 23, 2022
…21230) (#21234)

Backport of #21230

The problem was that many PR review components loaded by `Show more`
received the same ID as previous batches, which confuses browsers (when
clicked). All such occurrences should now be fixed.

Additionally improved the background of the `viewed` checkbox.

Fixes #21228.
Fixes #20681.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@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
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
5 participants