android icon indicating copy to clipboard operation
android copied to clipboard

[FEATURE REQUEST] Maintain scroll position in file list

Open suterma opened this issue 11 months ago • 5 comments

Is your feature request related to a problem? Please describe. When drilling down larger file hierarchies, e.g. in my large music library, and then backing up a level, the scroll position is lost. E.g. I would go to Zap Mama/Seven/mp3/01-Jogging in Tombouctu.mp3, then back up (using the android back button or the app's own back button) to the Artist level (Zap Mama), the view starts with the first entry on top again, e.g. Aaron Nevile. It would take quite some time to scroll back down to a later artist, e.g. Züri West.

Describe the solution you'd like The scroll position should be kept for each folder/directory level separately.

Describe alternatives you've considered I always need to scroll, or I would make a deliberately steeper hierarchy, which is really just a workaround.

Additional context Try for yourself with a large, flat hierarchy, the problem is obvious. This has never altered for years, so it's not really a (regressing) bug, but it heavily hampers the user experience for power users.

TASKS

  • [ ] Research (if needed)
  • [ ] Create branch feature/feature_name
  • [ ] Development tasks
    • [ ] Implement whatever
    • [ ] ...
    • [ ] Implement unit tests (if needed)
  • [ ] Code review and apply changes requested
  • [ ] Design test plan
  • [ ] QA
  • [ ] Merge branch feature/feature_name into master

suterma avatar Jan 08 '25 19:01 suterma

Thanks for opening!! it sounds like an interesting improvement, we will take a look and also we'll encourage community to take part

jesmrec avatar Jan 09 '25 07:01 jesmrec

@jesmrec @JuancaG05 Will be picking this up, however I need some demo server URL to test, I tried using the below but it fails to load the page or gives me an network exception

https://ocis.ocis.master.owncloud.works user: einstein, password: relativity

I tried creating my own server using docker but but that too somehow is not working today. if there is an testing URL, would be really helpful. Thanks

goonerDroid avatar Apr 10 '25 13:04 goonerDroid

@goonerDroid try with:

demo.owncloud.com (katherine/gemini)

jesmrec avatar Apr 10 '25 15:04 jesmrec

@JuancaG05 I was able to reproduce this issue and have implemented a working solution. The approach involves saving the lastVisibleItemPosition of the RecyclerView in MainFileListFragment just before fileListAdapter.updateFileList() is called. After the adapter is updated, I restore the scroll position using scrollToPos(). This ensures that the scroll position is preserved even when navigating into deeper file hierarchies.

I have one quick question — what would be the appropriate naming convention for this branch? Should it be prefixed with feature, fix, or improvement?

goonerDroid avatar Apr 10 '25 18:04 goonerDroid

Hi @goonerDroid! Thanks a lot for willing to take part of the product with your valuable contributions! 💯

You can open a PR with your proposed solution and I will take a deeper look there 😃. About the naming convention for the branch, I would call it feature/..., since this is a new functionality we are adding 👍.

JuancaG05 avatar Apr 11 '25 11:04 JuancaG05