firasdib / Regex101

This repository is currently only used for issue tracking for www.regex101.com
3.21k stars 198 forks source link

Regex Library: Add toggle for my-voted-on entries #2105

Open OnlineCop opened 11 months ago

OnlineCop commented 11 months ago

Feature

When viewing the Library, a user can upvote or downvote others' entries.

In the left sidebar, there are options for ORDER BY and FILTER BY FLAVOR.

I propose another option: SHOW/HIDE MY VOTES.

Rationale

At the time of this writing, there are 862 pages (20 entries per page) of library entries. If I am able to vote on a few entries a day, a feature to hide entries that I've already voted on would help me quite a bit.

UX: User Experience

This part is just personal preference, so discussions are welcome if anyone has differing opinions.

  1. I think a 3-way toggle makes the most sense here: OFF would mean there is no filtering; SHOW would mean that I only see entries for which I have upvoted/downvoted, and HIDE would mean that I only see entries for which I have NOT upvoted/downvoted.
  2. To allow me to adjust my vote in case of an accidental click (or hotkey shortcut, if there is one), an entry should not get removed from view immediately.

This would mean that this filter should only be applied in a few cases:

  1. When the active page is fully refreshed.
    • Opening/Closing the modal window to view more details about an entry should not trigger this.
  2. When another page is selected (i.e. going from Page 3 to Page 4).
  3. When the SHOW/HIDE MYVOTES toggle is selected again.