NuGet / NuGetGallery

NuGet Gallery is a package repository that powers https://www.nuget.org. Use this repo for reporting NuGet.org issues.
https://www.nuget.org/
Apache License 2.0
1.52k stars 643 forks source link

[NuGet.org Bug]: Changing selected Version briefly flickers to the README tab #9985

Open donnie-msft opened 3 weeks ago

donnie-msft commented 3 weeks ago

Impact

It bothers me. A fix would be nice

Describe the bug

When looking at a package (eg, https://www.nuget.org/packages/Newtonsoft.Json/13.0.2) and changing the selected version, I noticed a brief flickering of the screen. What is shown is the image that's in the README tab for this package. I also can tell that the README tab is briefly shown as selected before going back to the Versions tab.

Repro Steps

  1. https://www.nuget.org/packages/Newtonsoft.Json/13.0.2
  2. Select a different version
  3. Observe the brief appearance of the README tab's content

Expected Behavior

Changing versions should not switch tabs.

Screenshots

https://github.com/NuGet/NuGetGallery/assets/49205731/9a611cdd-482e-42b2-904f-22a0418a34e9

Additional Context and logs

No response

joelverhagen commented 3 weeks ago

This is because of the way we cache and evaluate the currently selected tab. I believe it is done "on document ready" which is some time after the first paint on page load. It should be possible to use the local storage or anchor text to determine the current tab during initial render, but it may be a non-trivial change to the scripts on this page.

This is a legitimate issue, as the recording shows (thanks for that @donnie-msft) but I think the priority may be low compared to the other efforts our team is currently involved in.

I will mark this as a good first issue. I think this could be handled with relative ease by a community member, if they want to give it a try!