TeamAmaze / TeamAmaze/AmazeFileManager
Inconsistent Size Sorting with Mixed File/Folder Results
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 6.4k
- Forks
- 1.7k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 1
Description
Description
The "Sort by Size" function does not behave consistently when search results contain a mix of files and folders. Switching between ascending and descending order does not produce a perfect reversal of the list, leading to a confusing user experience.
Steps to Reproduce
- Perform a search that returns a mix of both folders and files.
- Set the sort criteria to Size.
- Toggle the sort order to Ascending.
- Toggle the sort order to Descending.
Current Behavior
The folders interleave with the files in an unpredictable manner rather than being grouped or moved to the end. For example:
- file1
- file2
- folder1
- folder2
- file3
- folder3
Because folders often do not have a calculated "size" in the search view, the list does not properly reverse when toggling between ascending and descending orders (i.e.,ascending_results != reversed(descending_results)).
Expected Behavior
The results should be consistent and predictable. To improve the user experience, I suggest the following logic:
- Group by Type: Group folders and files separately.
- Sort Files: Sort the files within their group by size.
- Consistent Reversal: Ensure that toggling between ascending and descending order perfectly reverses the list order.
Screenshots
https://github.com/user-attachments/assets/fc49ee9c-374b-4281-81da-d476bbdce3a7
Smartphone (please complete the following information):
- Device: Google Pixel 9
- OS: Android 16
- Rooted: No
- Version: 3.11.2
Additional context
Add any other context about the problem here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the search-results sorting entry point and the comparator used for Size when results mix files and folders. Reproduce the ascending and descending toggles with mixed results, then add or update coverage for the ordering. Done means files and folders have predictable grouping and toggling produces the exact reverse order.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile, search
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100