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

reset selected filters after search #5033

Open
wants to merge 8 commits into
base: development
Choose a base branch
from

Conversation

ankitchauhan-aka
Copy link

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

closes #1693

Description

Testing

  1. Apply filters, You must have a red border that shows filter(s) are selected
  2. Then search for a term in the search box and choose any option from autosuggestion dropdown
  3. After selecting autosuggested options, Filters must be reset to default options.
  4. The red border from the filter icon will be removed

@ankitchauhan-aka ankitchauhan-aka marked this pull request as ready for review April 28, 2024 09:18
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) April 28, 2024 09:18
@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Apr 28, 2024
Copy link
Collaborator

@PikachuEXE PikachuEXE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested with these steps and failed

  • Enter something, enter search result via enter/search button
  • Change filter options
  • Press search button again
  • Search result not updated but filter reset

image

@ankitchauhan-aka
Copy link
Author

ankitchauhan-aka commented Apr 29, 2024

I tested with these steps and failed

  • Enter something, enter search result via enter/search button
  • Change filter options
  • Press search button again
  • Search result not updated but filter reset

image

@PikachuEXE I'm attaching a test video with the mentioned steps and cannot replicate the issue. Please share similar so I can fix it ASAP and the same happens in YouTube (as I feel we're taking references from there). Like even if we hit search for the same query it resets the filter.

Not sure, If we've a different requirement here.

Screen.Recording.2024-04-29.at.10.09.26.AM.mov

@PikachuEXE
Copy link
Collaborator

Screen.Recording.2024-04-29.at.13.33.20.mov

auto-merge was automatically disabled April 29, 2024 14:11

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) April 29, 2024 14:11
@ankitchauhan-aka
Copy link
Author

ankitchauhan-aka commented Apr 29, 2024

@PikachuEXE I've implemented a check, not to reset filter for the same query.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filter not applied when:

  1. Application starts
  2. apply labels
  3. enter query
  4. hit search
VirtualBoxVM_E7hDKoPbOO.mp4

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc added PR: changes requested and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels Apr 29, 2024
auto-merge was automatically disabled April 30, 2024 04:47

Head branch was pushed to by a user without write access

@ankitchauhan-aka ankitchauhan-aka force-pushed the ankitchauhan-aka/reset-filter-after-search branch from f754ae7 to ddeb438 Compare April 30, 2024 04:47
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) April 30, 2024 04:48
@ankitchauhan-aka
Copy link
Author

ankitchauhan-aka commented Apr 30, 2024

Filter not applied when:

  1. Application starts
  2. apply labels
  3. enter query
  4. hit search

VirtualBoxVM_E7hDKoPbOO.mp4

Fixed.

Thanks for the review.

@PikachuEXE
Copy link
Collaborator

It reset filters under strange conditions (e.g. like changing filter below

Screen.Recording.2024-04-30.at.14.24.09.mov

Probably like

  • Search A
  • Enter B
  • Try to set multiple criteria

@efb4f5ff-1298-471a-8973-3d47447115dc

@PikachuEXE this is not a bug but intended behavior. There is how YT also behaves. In your example Time Today resets because you clicked on Type Channel. Time is based on upload date. A channel cant have a upload date.

PikachuEXE
PikachuEXE previously approved these changes Apr 30, 2024
Copy link
Collaborator

@PikachuEXE PikachuEXE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK there are several issue discovered during testing but not introduced by this PR

@efb4f5ff-1298-471a-8973-3d47447115dc

Issue?

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc added PR: waiting for review For PRs that are complete, tested, and ready for review and removed PR: changes requested labels Apr 30, 2024
Copy link
Contributor

github-actions bot commented May 1, 2024

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added PR: merge conflicts / rebase needed and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels May 1, 2024
auto-merge was automatically disabled May 7, 2024 16:31

Head branch was pushed to by a user without write access

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when u just go to another page lets say most popular the filter also clears.

Taken from the linked issue. This also needs to be implemented.

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc added PR: changes requested and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels Jun 10, 2024
auto-merge was automatically disabled June 12, 2024 16:09

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) June 12, 2024 16:09
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

…into ankitchauhan-aka/reset-filter-after-search
auto-merge was automatically disabled June 12, 2024 16:17

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) June 12, 2024 16:17
Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

@ankitchauhan-aka
Copy link
Author

when u just go to another page lets say most popular the filter also clears.

Taken from the linked issue. This also needs to be implemented.

Fixed.

Copy link
Member

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Route is changed, Filters applied correctly but Filter icon isnt active

VirtualBoxVM_WAzjQZgyTo.mp4

@kommunarr
Copy link
Collaborator

kommunarr commented Jun 12, 2024

@efb4f5ff-1298-471a-8973-3d47447115dc Isn't that the expected behavior? See my earlier comment:

Before moving forward with this, I'd also like some discussion on the intended behavior. We're showing the filter as active after a search is made, until the user submits another query. That's not intuitive, as we shouldn't be showing the filter as if it's active if it isn't going to be. The main reason YT has this behavior the way it is is because changing a filter setting automatically re-submits the same search query but with the new filter. If we do want this feature, the filters should show as clear immediately after the search processes.

@efb4f5ff-1298-471a-8973-3d47447115dc

Oof i missed that. Will retest soon.

@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Member

efb4f5ff-1298-471a-8973-3d47447115dc commented Jun 13, 2024

@jasonhenriquez this seems not intuitive to me but please correct me if im wrong. Now the user needs to remember what filter they applied if they want to refine their search more:

  1. Apply filter
  2. Input search query
  3. Hit search
  4. Filters reset
  5. User has to apply the same filter(s) again + they like to add to refine their search results.

User has to remember what filters they applied in their previous search. That seems like a headache to me.

VirtualBoxVM_wY83QlEB86.mp4

@kommunarr
Copy link
Collaborator

kommunarr commented Jun 13, 2024

That's a tradeoff that I don't know if we can mitigate. The whole difficulty of this feature is that you can't make the same search twice with the same filters as easily.

@ankitchauhan-aka
Copy link
Author

@jasonhenriquez so what's next step about this?

@kommunarr
Copy link
Collaborator

Unless there are other potential mitigations that I'm missing, the main options are that we go ahead with the feature or don't. I think there is more upside than not to go ahead with the feature.

@ankitchauhan-aka
Copy link
Author

I think we should keep the filters selected until the user is changing search query.

@kommunarr
Copy link
Collaborator

If I'm understanding correctly, that means showing it as active for the next search, even if it won't be, unless the user then changes the filter to something else, in which case it will be? That seems a bit confusing if so.

@ankitchauhan-aka
Copy link
Author

ankitchauhan-aka commented Jun 15, 2024

What if it clears filter only if user types different search query,
And if he refines filter then type for new search query filters will be applied

@kommunarr
Copy link
Collaborator

If you can get the filter to show as non-active to the user unless they re-open the search filter modal, I'm fine with that. I would also be fine with "have the filters be forgotten unless the user opts to open the modal after a search." I just get the sense that we're trying to emulate YT's behavior here somewhat, which doesn't work exactly, since our filter button is omnipresent, and our current behavior is different.

I'm also wondering if maybe this is getting too complicated / potentially confusing to users, and maybe we should just have a one-click button that removes all active search filters instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Active filter must reset after i search for something else
4 participants