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

Sorting of search results #4003

Merged

Conversation

seelchen
Copy link
Contributor

@seelchen seelchen commented Dec 3, 2023

Description

This PR adds the ability to sort the search results in the SearchView. For this, a button was added to the SearchView which opens a dialog similar to the one for sorting directories.

Additionally, to address issue #3357, this PR adds an option to sort the search results by relevance. This sorting is as described in this comment and is only available for sorting search results and not for directories.

To fully resolve issue #3357, the "old" search has to be embedded in the same search view as the new search view.
However, to avoid bloating this PR, I think it might be better to fix that separately.

Issue tracker

Addresses #3357

Automatic tests

  • Added test cases

Manual tests

  • Done

Device:

  • Pixel 7 emulator running Android 13
  • HTC U11 life running Android 10

Build tasks success

Successfully running following tasks on local:

  • ./gradlew assembledebug
  • ./gradlew spotlessCheck

@seelchen seelchen force-pushed the feature/search-sort-relevance branch from 773a82d to ce70619 Compare December 6, 2023 18:26
@seelchen seelchen force-pushed the feature/search-sort-relevance branch from ce70619 to eece947 Compare December 6, 2023 18:27
@seelchen seelchen marked this pull request as ready for review December 6, 2023 19:09
@seelchen
Copy link
Contributor Author

seelchen commented Dec 6, 2023

This is ready for review!

@VishalNehra
Copy link
Member

Works great! One thing I think can be improved, from my initial test is, say if I have files such as
image (1).jpg
image (2).jpg
Some random image name.jpg
It actually matches the last one in relevance ascending. I feel the percentage of match is more in first 2 than the last one.
Here's an example

Record_2023-12-07-02-19-49.mp4

@seelchen
Copy link
Contributor Author

seelchen commented Dec 6, 2023

Works great! One thing I think can be improved, from my initial test is, say if I have files such as image (1).jpg image (2).jpg Some random image name.jpg It actually matches the last one in relevance ascending. I feel the percentage of match is more in first 2 than the last one.

In my understanding, ascending in sort by relevance should sort them from least to most relevant (since for example ascending in sort by size would be from small to large). I also think it's quite confusing, but logically it should be the correct order. Do you think inverting it would be more intuitive?

@VishalNehra
Copy link
Member

Yea, descending relevance means least relevant at top and vice versa. I didn't notice this wasn't the original intention.

@seelchen
Copy link
Contributor Author

seelchen commented Dec 6, 2023

Alright, then I will invert it 👍 (although I don't quite understand the logic)

@seelchen
Copy link
Contributor Author

seelchen commented Dec 6, 2023

I pushed a commit to reverse the order - but could you maybe explain again why ascending relevance is from most to least relevant? I still don't quite get it.
If we see relevance as a numeric value, in my opinion less relevant items would have a smaller number and more relevant a larger number. Following this logic, since ascending is from small to large, it would be from least to most relevant.

@VishalNehra
Copy link
Member

It's for the UX, just like you said, it'll be confusing for the user. Not all people using the app are technical, they won't see the relevance as a numerical from less to more. Let's try this way, if we get complaints from user that this behaviour is unexpected, we'll revert to your original implementation.

@VishalNehra VishalNehra added this to the v3.9 milestone Dec 7, 2023
@VishalNehra VishalNehra merged commit 9a11e3e into TeamAmaze:release/4.0 Dec 7, 2023
3 checks passed
@seelchen seelchen mentioned this pull request Dec 20, 2023
4 tasks
sorryIMessedup pushed a commit to sorryIMessedup/AmazeFileManager that referenced this pull request Dec 22, 2023
sorryIMessedup added a commit to sorryIMessedup/AmazeFileManager that referenced this pull request Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants