leetcode-patterns icon indicating copy to clipboard operation
leetcode-patterns copied to clipboard

Two filters do not work together

Open Yashwin12 opened this issue 4 years ago • 4 comments

Following steps to re-create this issue:

  1. Filter problems with any difficulty. (In the screenshot "easy" is selected)
  2. After this, filter out with any company. (Over here "Capital One" is selected)

In the screenshot, one can see it filters out with Capital One and clearly disregard the "easy" difficulty filter. I think UI should either incorporate "smart filtering" - results considering both the filters OR reset the previously selected filter from the screen.

Screen Shot 2021-02-02 at 7 38 23 PM

Yashwin12 avatar Feb 03 '21 00:02 Yashwin12

Hey @Yashwin12 ✌🏽 Thanks a bunch for pointing this bug out - I just tried reproducing it using the STR you listed but it looks like filtering is working as intended:

https://user-images.githubusercontent.com/13009507/106686762-e9fc6a00-6598-11eb-9afc-c2e9fcf45afa.mp4

Are you able to reproduce it in Incognito mode, or just the regular website? We can try to narrow down what's busted from there

seanprashad avatar Feb 03 '21 01:02 seanprashad

Hi @SeanPrashad, thank you for replying back. Actually, I found why it was behaving like this; I accidentally hit the "previous" button in the browser. Please consider below STR and gif to reproduce the filter issue.

  1. Select company filter. ( Over here "Capital One" is selected )
  2. Navigate to the "previous" page in the browser.
  3. Navigate back to the Leetcode Patterns page. You can still see the filter value is present, but the values are not shown according to its filter. (I think it disregards the filter value and shows all the results).

leetCodePatterns

Yashwin12 avatar Feb 05 '21 19:02 Yashwin12

Amazing stuff! I am also able to confirm the bug based on your updated STR listed.

The current behaviour doesn't save your settings (ie. Which difficulty, companies, and patterns you have filtered by, if any).

Over in #87, it was requested that these settings be saved like how the checkboxes are via Local Storage. As of right now, I think this is a UI bug which will hopefully be solved when #87 lands!

seanprashad avatar Feb 05 '21 19:02 seanprashad

Great! I think saving filter selection in local storage is a good idea, but as a user on the page refresh, it makes more sense (at least over here) to reset filters. Just my two cents!!

Yashwin12 avatar Feb 05 '21 19:02 Yashwin12