Skip to content

Conversation

PhilLab
Copy link
Contributor

@PhilLab PhilLab commented Sep 21, 2025

  • Tests written, or not not needed

Fixes #15636.

  1. The patch added in Finish PreviewImageActivity After Image Deletion #14782 prevented that the callback onRemoteOperationFinish() was ever called.
    The changes were removed. I was not able to reproduce the end-to-end encryption issue, so this seems fine.
    • @alperozturk96 if you could try yourself, as you had originally worked on that issue?
  2. the manual update of adapter and pager is only needed if user is not present. When user is present, the initViewPager() takes care of everything.
  3. The next image was inconsistent between user present yes/no

Copy link

github-actions bot commented Oct 6, 2025

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@alperozturk96 alperozturk96 force-pushed the fix_15636_deleting_from_slideshow branch from 94917e8 to 3143bb7 Compare October 6, 2025 07:26
alperozturk96

This comment was marked as resolved.

@PhilLab PhilLab force-pushed the fix_15636_deleting_from_slideshow branch 2 times, most recently from a93ea4d to dd711d0 Compare October 13, 2025 17:31
The patch added in nextcloud#14782 prevented that the callback
onRemoteOperationFinish() was ever called.

Secondly, the manual update of adapter and pager is only needed if user
is not present. When user is present, the initViewPager() takes care
of everything.

Signed-off-by: Philipp Hasper <[email protected]>
In that case, deleting the currently viewed file had the following issues:
1. When deleting the first image, the UI just stayed with it.
2. When deleting another image, the UI switched to the previous image,
   instead of the next one, which is inconsistent to the behavior when
   user is available
3. When switching to the next image, the title shown at the top did
   not correctly update

Signed-off-by: Philipp Hasper <[email protected]>
@PhilLab PhilLab force-pushed the fix_15636_deleting_from_slideshow branch 2 times, most recently from e04c528 to 806900a Compare October 17, 2025 08:06
@PhilLab PhilLab requested a review from alperozturk96 October 17, 2025 08:06

if (user.isPresent) {
// Re-init the view pager, which will advance to the next image
initViewPager(user.get())
Copy link
Collaborator

@alperozturk96 alperozturk96 Oct 17, 2025

Choose a reason for hiding this comment

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

@PhilLab

After an image is deleted from the preview, the first condition is matched, and we end up re-initializing the ViewPager, but updateViewPagerAfterDeletionAndAdvanceForward isn’t triggered. I was thinking, since this logic is already inside the if (operation is RemoveFileOperation) block, could we consider calling only updateViewPagerAfterDeletionAndAdvanceForward when the result is successful instead of re-initializing the ViewPager entirely or any other reason to have user.present check and initViewPager ?

e.g.

if (result.isSuccess) {
     updateViewPagerAfterDeletionAndAdvanceForward()
}

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alperozturk96 yes, good idea. Though the if (user.isPresent) { initViewPager has been added deliberately here and been kept ever since.

So I am wondering what this would break.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@tobiasKaminsky What do you think?

@alperozturk96
Copy link
Collaborator

You can fix Check / check (spotlessKotlinCheck via following commands.

./gradlew spotlessApply
./gradlew detekt                                
./gradlew spotlessCheck
./gradlew spotlessKotlinCheck

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.

Slideshow is left when deleting file

3 participants