Skip to content

Do not filter out category that exactly matches the search #5285

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

Closed
nicolas-raoul opened this issue Sep 8, 2023 · 8 comments · Fixed by #5328
Closed

Do not filter out category that exactly matches the search #5285

nicolas-raoul opened this issue Sep 8, 2023 · 8 comments · Fixed by #5328

Comments

@nicolas-raoul
Copy link
Member

nicolas-raoul commented Sep 8, 2023

Context

In the categories selection dialog, when searching for "2021 in Japan", I get No categories found despite the existence of https://commons.wikimedia.org/wiki/Category:2021_in_Japan

This is because we filter out old year-based categories, which is a good thing (see https://github.com/commons-app/apps-android-commons/pull/1134/files #1134)

However, when sorting old pictures, such a category is still useful to people who know exactly what they are looking for.

Task

If a category is an exact match for the search string entered, do not filter it out.
Example 1: When "2021 in Japan" is entered, do not filter out the element related to https://commons.wikimedia.org/wiki/Category:2021_in_Japan
Example 2: When "2021 Japan" is entered, the current filtering should run as usual (meaning the element related to https://commons.wikimedia.org/wiki/Category:2021_in_Japan is not shown) because "2021 Japan" does not match ""2021 in Japan" exactly.

@nicolas-raoul
Copy link
Member Author

Screenshot_20230908-175450~2.png

@iligeoili
Copy link

Hey as a new coder i would be glad to dive into this issue. Please assign it to me,

@nicolas-raoul
Copy link
Member Author

@iligeoili: Please start on it after you have sent a pull request for #5279, thanks a lot! :-)

@Deanstirrat
Copy link
Contributor

I think I can do this is @iligeoili is okay with it.

@nicolas-raoul
Copy link
Member Author

@Deanstirrat It is yours, thanks! Please let us know about your progress every week or so. 🙂

@Deanstirrat
Copy link
Contributor

@nicolas-raoul Will do thanks!

@Deanstirrat
Copy link
Contributor

Made the changes I think will fix the issue but cannot run tests until #5208 is resolved

@nicolas-raoul
Copy link
Member Author

Wonderful! In order for us to test and approve your changes, please do not hesitate to send a pull request based on #5208 (then we will merge it once we merge #5208, which should hopefully be very soon).

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