[PR #16305] [MERGED] fix(web): fix lost scrollpos on deep link to timeline asset, scrub stop #14835

Closed
opened 2026-02-05 15:38:42 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/immich-app/immich/pull/16305
Author: @midzelis
Created: 2/25/2025
Status: Merged
Merged: 3/5/2025
Merged by: @alextran1502

Base: mainHead: asset-store-to-state


📝 Commits (10+)

  • 6b51015 Work in progress - super quick asset store->state
  • ee0af32 bugfix: deep linking to timeline, on scrub stop
  • f2dce7f format, remove stale
  • dc023b7 disable test, todo: fix test
  • 2e6ffe6 merge main
  • 12d5568 remove unused import
  • e40652c Merge remote-tracking branch 'origin/main' into asset-store-to-state
  • 2ba9e87 Fix merge
  • 2a7a376 lint
  • c3c8cca lint

📊 Changes

36 files changed (+363 additions, -306 deletions)

View changed files

📝 web/src/lib/components/album-page/album-viewer.svelte (+1 -1)
📝 web/src/lib/components/asset-viewer/photo-viewer.svelte (+1 -1)
📝 web/src/lib/components/assets/thumbnail/thumbnail.svelte (+1 -1)
📝 web/src/lib/components/assets/thumbnail/video-thumbnail.svelte (+1 -1)
📝 web/src/lib/components/faces-page/assign-face-side-panel.svelte (+1 -1)
📝 web/src/lib/components/faces-page/person-side-panel.svelte (+1 -1)
📝 web/src/lib/components/memory-page/memory-viewer.svelte (+1 -1)
📝 web/src/lib/components/photos-page/actions/archive-action.svelte (+2 -2)
📝 web/src/lib/components/photos-page/actions/favorite-action.svelte (+2 -2)
📝 web/src/lib/components/photos-page/actions/select-all-assets.svelte (+1 -1)
📝 web/src/lib/components/photos-page/asset-date-group.svelte (+27 -22)
📝 web/src/lib/components/photos-page/asset-grid.svelte (+71 -87)
📝 web/src/lib/components/photos-page/measure-date-group.svelte (+6 -6)
📝 web/src/lib/components/share-page/individual-shared-viewer.svelte (+1 -1)
📝 web/src/lib/components/shared-components/control-app-bar.svelte (+1 -1)
📝 web/src/lib/components/shared-components/gallery-viewer/gallery-viewer.svelte (+1 -1)
📝 web/src/lib/components/shared-components/scrubber/scrubber.svelte (+4 -4)
📝 web/src/lib/stores/assets-store.spec.ts (+3 -2)
📝 web/src/lib/stores/assets-store.svelte.ts (+96 -114)
📝 web/src/lib/utils/asset-store-task-manager.ts (+1 -1)

...and 16 more files

📄 Description

Description

This fixes the problems in maintaining scroll position (i.e. to a given deep-linked bucket) as the buckets above the current bucket as loaded and change height. The same problem also happened when clicking on the scrub bar on an unloaded part of the timeline (towards the bottom).

The root causes:

  1. the id='bucket' was changed to a bucket class instead, causing _updateLastIntersectedBucketDate to fail
  2. _updateLastIntersectedBucketDate was not working properly anyways, since on scrub, the scrubbar creates an invisible overlay over the entire #asset-grid causing getElementAtPoint to fail.
  3. The above was replaced with an alternative method to find the last 'intersected' bucket in the asset-grid by using an intersection observer.
  4. Bucket-height event was not sent on initial layout of bucket
  5. use the measuring component as a skeleton (in later PR drop skeleton component completely)

Other changes

  • Asset-store isn't a store anymore - needed to rename asset.store.ts to asset-store.svelte.ts - the store.svelte.ts pattern caused problems with the compiler, so using hyphen instead. Using .svelete.ts so that you can use $state in non-components.

How Has This Been Tested?

  • Existing tests pass, needed to disable one due to wasm layout
  • Manual testing

🔄 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/16305 **Author:** [@midzelis](https://github.com/midzelis) **Created:** 2/25/2025 **Status:** ✅ Merged **Merged:** 3/5/2025 **Merged by:** [@alextran1502](https://github.com/alextran1502) **Base:** `main` ← **Head:** `asset-store-to-state` --- ### 📝 Commits (10+) - [`6b51015`](https://github.com/immich-app/immich/commit/6b5101548170b7ab3946bc2708fac351dc62e053) Work in progress - super quick asset store->state - [`ee0af32`](https://github.com/immich-app/immich/commit/ee0af32b40d3d18be26c57aee821ab71c6cb50ca) bugfix: deep linking to timeline, on scrub stop - [`f2dce7f`](https://github.com/immich-app/immich/commit/f2dce7fedda137bc71f29ef63a2e350c32790202) format, remove stale - [`dc023b7`](https://github.com/immich-app/immich/commit/dc023b7355dfa94ffbbe5379434087e1e9f367e1) disable test, todo: fix test - [`2e6ffe6`](https://github.com/immich-app/immich/commit/2e6ffe66ff60d8decad70ef706b8345fab92c91b) merge main - [`12d5568`](https://github.com/immich-app/immich/commit/12d556834ce1cd77730d1bc0213ef9004b213a5a) remove unused import - [`e40652c`](https://github.com/immich-app/immich/commit/e40652c7eaa5112463ac3357648beb687aafc21c) Merge remote-tracking branch 'origin/main' into asset-store-to-state - [`2ba9e87`](https://github.com/immich-app/immich/commit/2ba9e87ac87246d6fad1e787d04feb07ee7cc138) Fix merge - [`2a7a376`](https://github.com/immich-app/immich/commit/2a7a3762d33ac49025fcef905b7d71f2d5c1f4dc) lint - [`c3c8cca`](https://github.com/immich-app/immich/commit/c3c8cca0de48ac6967e94723fa73588d90be5830) lint ### 📊 Changes **36 files changed** (+363 additions, -306 deletions) <details> <summary>View changed files</summary> 📝 `web/src/lib/components/album-page/album-viewer.svelte` (+1 -1) 📝 `web/src/lib/components/asset-viewer/photo-viewer.svelte` (+1 -1) 📝 `web/src/lib/components/assets/thumbnail/thumbnail.svelte` (+1 -1) 📝 `web/src/lib/components/assets/thumbnail/video-thumbnail.svelte` (+1 -1) 📝 `web/src/lib/components/faces-page/assign-face-side-panel.svelte` (+1 -1) 📝 `web/src/lib/components/faces-page/person-side-panel.svelte` (+1 -1) 📝 `web/src/lib/components/memory-page/memory-viewer.svelte` (+1 -1) 📝 `web/src/lib/components/photos-page/actions/archive-action.svelte` (+2 -2) 📝 `web/src/lib/components/photos-page/actions/favorite-action.svelte` (+2 -2) 📝 `web/src/lib/components/photos-page/actions/select-all-assets.svelte` (+1 -1) 📝 `web/src/lib/components/photos-page/asset-date-group.svelte` (+27 -22) 📝 `web/src/lib/components/photos-page/asset-grid.svelte` (+71 -87) 📝 `web/src/lib/components/photos-page/measure-date-group.svelte` (+6 -6) 📝 `web/src/lib/components/share-page/individual-shared-viewer.svelte` (+1 -1) 📝 `web/src/lib/components/shared-components/control-app-bar.svelte` (+1 -1) 📝 `web/src/lib/components/shared-components/gallery-viewer/gallery-viewer.svelte` (+1 -1) 📝 `web/src/lib/components/shared-components/scrubber/scrubber.svelte` (+4 -4) 📝 `web/src/lib/stores/assets-store.spec.ts` (+3 -2) 📝 `web/src/lib/stores/assets-store.svelte.ts` (+96 -114) 📝 `web/src/lib/utils/asset-store-task-manager.ts` (+1 -1) _...and 16 more files_ </details> ### 📄 Description ## Description This fixes the problems in maintaining scroll position (i.e. to a given deep-linked bucket) as the buckets above the current bucket as loaded and change height. The same problem also happened when clicking on the scrub bar on an unloaded part of the timeline (towards the bottom). The root causes: 1. the `id='bucket'` was changed to a bucket class instead, causing `_updateLastIntersectedBucketDate` to fail 2. `_updateLastIntersectedBucketDate` was not working properly anyways, since on scrub, the scrubbar creates an invisible overlay over the entire `#asset-grid` causing getElementAtPoint to fail. 3. The above was replaced with an alternative method to find the last 'intersected' bucket in the asset-grid by using an intersection observer. 4. Bucket-height event was not sent on initial layout of bucket 5. use the measuring component as a skeleton (in later PR drop skeleton component completely) Other changes * Asset-store isn't a store anymore - needed to rename asset.store.ts to asset-store.svelte.ts - the store.svelte.ts pattern caused problems with the compiler, so using hyphen instead. Using .svelete.ts so that you can use $state in non-components. ## How Has This Been Tested? <!-- Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration --> - [x] Existing tests pass, needed to disable one due to wasm layout - [x] Manual testing --- <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 15:38:42 +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#14835