Skip to content

[FEATURE REQUEST] Maintain scroll position in file list #4528

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

Open
10 tasks
suterma opened this issue Jan 8, 2025 · 5 comments · May be fixed by #4570
Open
10 tasks

[FEATURE REQUEST] Maintain scroll position in file list #4528

suterma opened this issue Jan 8, 2025 · 5 comments · May be fixed by #4570

Comments

@suterma
Copy link

suterma commented Jan 8, 2025

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
@jesmrec
Copy link
Collaborator

jesmrec commented Jan 9, 2025

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

@goonerDroid
Copy link
Contributor

goonerDroid commented Apr 10, 2025

@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

@jesmrec
Copy link
Collaborator

jesmrec commented Apr 10, 2025

@goonerDroid try with:

demo.owncloud.com (katherine/gemini)

@goonerDroid
Copy link
Contributor

@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?

@JuancaG05
Copy link
Collaborator

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 👍.

@goonerDroid goonerDroid linked a pull request Apr 11, 2025 that will close this issue
1 task
@JuancaG05 JuancaG05 changed the title [FEATURE REQUEST] When going back up a level, after drilling down a file hierarchy, the view looses it's scroll position. [FEATURE REQUEST] Maintain scroll position in file list Apr 14, 2025
@JuancaG05 JuancaG05 linked a pull request Apr 14, 2025 that will close this issue
1 task
@JuancaG05 JuancaG05 self-assigned this Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants