Skip to content

Preserve Conversation List position #5049

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
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rapterjet2004
Copy link
Contributor

@rapterjet2004 rapterjet2004 commented Jun 9, 2025

Conversation List jumps to position of clicked conversation item when back pressed

ToDO

  • fix scroll offset, it's a bit confusing. Perhaps track x,y and use scrollBy after scrolling to position.

🖼️ Screenshots

Screen_recording_20250609_124059.webm

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔖 Capability is checked or not needed
  • 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

@rapterjet2004 rapterjet2004 self-assigned this Jun 9, 2025
@rapterjet2004 rapterjet2004 changed the title Conversation List jumps to position of clicked conversation item when… Preserve Conversation List position Jun 9, 2025
@rapterjet2004 rapterjet2004 requested a review from mahibi June 10, 2025 17:00
@rapterjet2004 rapterjet2004 added the 3. to review Waiting for reviews label Jun 10, 2025
Copy link
Collaborator

@mahibi mahibi left a comment

Choose a reason for hiding this comment

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

This will always place the last opened conversation at the top when coming back. This is not expected but people expect the exact scroll position as when the chat was opened.

It should be solved with
scrollToPositionWithOffset
which gets the scroll position and the offset from when the chat was opened.

@rapterjet2004 rapterjet2004 force-pushed the issue-5041-jump-to-coversation branch from 6278b2f to 4792f17 Compare June 16, 2025 15:00
Copy link
Contributor

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/5049-talk.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud Talk app.

@rapterjet2004 rapterjet2004 requested a review from mahibi June 16, 2025 15:29
Copy link
Collaborator

@mahibi mahibi left a comment

Choose a reason for hiding this comment

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

I have the feeling this can be solved in a simpler way.

Right now the position is passed to ChatActivity and back to ConversationList. This should not be necessary at all but ConversationList should handle this itself.
For example this does not work when the app just goes to background and coming back.

Also, i guess that findFirstVisibleItemPosition is something that should not be necessary. It will "just" scroll to an item instead to the exact position.

Can you have a look if there are simpler ways to achieve this?
Like just using the scroll position on the recyclerview itself and just using lifecycle methods to save/restore the scroll postion, eg. from the viewmodel..?

Copy link
Contributor

Codacy

Lint

TypemasterPR
Warnings10097
Errors100

SpotBugs

CategoryBaseNew
Bad practice66
Correctness1616
Dodgy code6767
Internationalization33
Malicious code vulnerability33
Performance44
Security11
Total100100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Jump to the top after press back button
2 participants