TeamAmaze / TeamAmaze/AmazeFileManager

Inconsistent Size Sorting with Mixed File/Folder Results

Open
#4,559 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-UIUX Issue-Bug
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

  1. Perform a search that returns a mix of both folders and files.
  2. Set the sort criteria to Size.
  3. Toggle the sort order to Ascending.
  4. 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:

  1. Group by Type: Group folders and files separately.
  2. Sort Files: Sort the files within their group by size.
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.