[PR #25563] fix(mobile): Update preview and PageController position when the asset count decreases while the last item is selected #18285

Open
opened 2026-02-05 16:35:49 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/immich-app/immich/pull/25563
Author: @PeterOmbodi
Created: 1/27/2026
Status: 🔄 Open

Base: mainHead: fix/update_preview_index


📝 Commits (4)

  • 249bfb0 fix(mobile): fix wrong index, update pageController
  • cda0202 Merge remote-tracking branch 'origin/main' into fix/update_preview_index
  • 3d8720f fix(mobile): refactor code
  • f7ff4e5 Merge remote-tracking branch 'origin/main' into fix/update_preview_index

📊 Changes

1 file changed (+5 additions, -1 deletions)

View changed files

📝 mobile/lib/presentation/widgets/asset_viewer/asset_viewer.page.dart (+5 -1)

📄 Description

Description

If user actions on the preview of the last asset in the timeline cause the total number of assets in the timeline list to decrease, subsequent navigation via the PageController may result in an infinite loading spinner being shown in place of the last item.

Fixes # (issue)
Force the PageController to navigate to the actual last asset and refresh the state accordingly.

How Has This Been Tested?

Open the preview of the last asset and delete it.

  • Before the fix: the deleted asset may still remain visible on the screen. After swiping right and then back left, an infinite loader can appear in place of the deleted asset.

  • After the fix: once the asset is deleted, the previous asset is shown. Swiping left provides a “end of list” feedback, indicating to the user that the end of the timeline has been reached.

Screenshots

before fix with fix

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services/ uses repositories implementations for database calls, filesystem operations, etc.
  • All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services/)

...


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/immich-app/immich/pull/25563 **Author:** [@PeterOmbodi](https://github.com/PeterOmbodi) **Created:** 1/27/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/update_preview_index` --- ### 📝 Commits (4) - [`249bfb0`](https://github.com/immich-app/immich/commit/249bfb06f16965d645a9a916b8bab06eaa1c5b2a) fix(mobile): fix wrong index, update pageController - [`cda0202`](https://github.com/immich-app/immich/commit/cda02028ae9a98794e3038ca3fd0bcaa6bc9300d) Merge remote-tracking branch 'origin/main' into fix/update_preview_index - [`3d8720f`](https://github.com/immich-app/immich/commit/3d8720f8768b6d26a769762a57278b7a507b8be2) fix(mobile): refactor code - [`f7ff4e5`](https://github.com/immich-app/immich/commit/f7ff4e5fd2cae70a60f5977948694bc7260069f3) Merge remote-tracking branch 'origin/main' into fix/update_preview_index ### 📊 Changes **1 file changed** (+5 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `mobile/lib/presentation/widgets/asset_viewer/asset_viewer.page.dart` (+5 -1) </details> ### 📄 Description ## Description If user actions on the preview of the last asset in the timeline cause the total number of assets in the timeline list to decrease, subsequent navigation via the PageController may result in an infinite loading spinner being shown in place of the last item. Fixes # (issue) Force the PageController to navigate to the actual last asset and refresh the state accordingly. ## How Has This Been Tested? Open the preview of the last asset and delete it. - Before the fix: the deleted asset may still remain visible on the screen. After swiping right and then back left, an infinite loader can appear in place of the deleted asset. - After the fix: once the asset is deleted, the previous asset is shown. Swiping left provides a “end of list” feedback, indicating to the user that the end of the timeline has been reached. <details> <summary><h2>Screenshots</h2></summary> <table> <tr> <th>before fix</th> <th>with fix</th> </tr> <tr> <td> <video src="https://github.com/user-attachments/assets/398d2ea1-9775-4ef5-b0da-79ae6cb53652" width="270" controls> </video> </td> <td> <video src="https://github.com/user-attachments/assets/e28044fb-ac55-40d3-b39e-4b44e6ef299e" width="270" controls> </video> </td> </tr> </table> </details> ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have made corresponding changes to the documentation if applicable - [x] I have no unrelated changes in the PR. - [x] I have confirmed that any new dependencies are strictly necessary. - [ ] I have written tests for new code (if applicable) - [x] I have followed naming conventions/patterns in the surrounding code - [x] All code in `src/services/` uses repositories implementations for database calls, filesystem operations, etc. - [x] All code in `src/repositories/` is pretty basic/simple and does not have any immich specific logic (that belongs in `src/services/`) ... --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 16:35:49 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#18285