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]: Search filters panel blinks when we click 'Apply' #9790

Open advay26 opened 5 months ago

advay26 commented 5 months ago

Impact

It bothers me. A fix would be nice

Describe the bug

The checkboxes for the framework generations and TFMs blink when the search page is loaded with filter parameters.

The likely cause for it is how we initialize checkbox states on the page. JavaScript code reads the search page URL and uses it to set the state of the checkboxes on the page. This happens after page load, which is why we see the blinking.

Repro Steps

  1. Select a framework generation or TFM filter checkbox, say .NET
  2. Click on Apply
  3. The .NET checkbox will blink after the page loads

Expected Behavior

The checkbox states should be set in the .cshtml itself so that we don't need to run any JavaScript to initialize them.

We can modify the FrameworkFilterGroup objects in the view model to have a checkbox state enum with Checked/Unchecked/Indeterminate values.

Screenshots

No response

Additional Context and logs

See https://github.com/NuGet/NuGetGallery/pull/9782#issuecomment-1907354318