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

BugFix - Filter Root #13599

Merged
merged 19 commits into from
Oct 8, 2024
Merged

BugFix - Filter Root #13599

merged 19 commits into from
Oct 8, 2024

Conversation

alperozturk96
Copy link
Collaborator

@alperozturk96 alperozturk96 commented Sep 23, 2024

  • Tests written, or not not needed

Problem?

When users navigate to the Shared or Favorite files, the back button action does not display the correct file list.

What does this PR?

  • Filters OCFileListAdapter according to the selected drawer menu item

How to Test?

  1. Mark some files as Favorite or share some files.
  2. Select Favorites or Shared Files from the drawer menu.
  3. Navigate to a subdirectory.
  4. Press the back button.

@tobiasKaminsky
Copy link
Member

Hm. This looks for me like a strange workaround/fix.
If you are back at root folder, then Favorite/Shared search should be applied, so that no manual filtering will be done.

Favorites is searching across all folders, so e.g. those are favorited

  • /test
  • /a/1.pdf

If you first go to "favorites" you will see both.
But if with this PR, you go "back" from "test", you would only see "test" folder, but not file "1.pdf".

@alperozturk96 alperozturk96 marked this pull request as draft September 26, 2024 12:15
@alperozturk96
Copy link
Collaborator Author

Hm. This looks for me like a strange workaround/fix. If you are back at root folder, then Favorite/Shared search should be applied, so that no manual filtering will be done.

Favorites is searching across all folders, so e.g. those are favorited

  • /test
  • /a/1.pdf

If you first go to "favorites" you will see both. But if with this PR, you go "back" from "test", you would only see "test" folder, but not file "1.pdf".

I guess this is fixing the problem you described?

fix_filter.mp4

@alperozturk96 alperozturk96 marked this pull request as ready for review September 26, 2024 15:34
@tobiasKaminsky
Copy link
Member

This works now ✔

Can you check this:

  • have a folder /a/b, where "b" is favorited
  • delete database (adb shell pm clear com.nextcloud.client)
  • start app
  • go to favorites
  • click on "b"
    --> endless loading for me

But when I click back, I can directly see content of "/a"

* <p>
* return Count of folder levels browsed up.
*/
public int onBrowseUp() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Previously, onBrowseUp() was running on the main thread, which caused lag. This PR adds more I/O operations to the function due to previous file changes based on the filter type. Therefore, we need to run onBrowseUp() on the I/O thread and update the UI on the main thread.

Note: The endless loading issue is not part of this PR. It can also occasionally be observed on the stable or master branch. During my tests, I encountered it only once.

@tobiasKaminsky

Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Copy link

github-actions bot commented Oct 8, 2024

Codacy

Lint

TypemasterPR
Warnings5959
Errors33

SpotBugs

CategoryBaseNew
Bad practice6465
Correctness6362
Dodgy code296296
Experimental11
Internationalization77
Malicious code vulnerability11
Multithreaded correctness66
Performance5353
Security1818
Total509509

@tobiasKaminsky tobiasKaminsky merged commit 8fdba73 into master Oct 8, 2024
18 of 21 checks passed
@tobiasKaminsky tobiasKaminsky deleted the bugfix/filter-root branch October 8, 2024 12:13
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.

2 participants