mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
refactor(web): extract VirtualScrollManager base class
Extract a reusable VirtualScrollManager base class from TimelineManager
to enable code reuse for virtual scrolling behavior.
Changes:
- Add VirtualScrollManager base class with common scrolling logic
- Add ScrollSegment base class for month/segment abstraction
- Migrate TimelineMonth to extend ScrollSegment
- Migrate TimelineManager to extend VirtualScrollManager
- Move intersection/layout/load logic from internal/ to base classes
- Update components to work with new architecture
- Delete timeline-manager/internal/{intersection,layout,load}-support.ts
No functional changes - pure refactoring.
This commit is contained in:
@@ -14,6 +14,7 @@ import { getByteUnitString } from '$lib/utils/byte-units';
|
||||
import { getFormatter } from '$lib/utils/i18n';
|
||||
import { navigate } from '$lib/utils/navigation';
|
||||
import { asQueryString } from '$lib/utils/shared-links';
|
||||
import { getSegmentIdentifier } from '$lib/utils/timeline-util';
|
||||
import {
|
||||
addAssetsToAlbum as addAssets,
|
||||
addAssetsToAlbums as addToAlbums,
|
||||
@@ -490,8 +491,8 @@ export const selectAllAssets = async (timelineManager: TimelineManager, assetInt
|
||||
isSelectingAllAssets.set(true);
|
||||
|
||||
try {
|
||||
for (const month of timelineManager.months) {
|
||||
await timelineManager.loadMonth(month.yearMonth);
|
||||
for (const month of timelineManager.segments) {
|
||||
await timelineManager.loadSegment(getSegmentIdentifier(month.yearMonth));
|
||||
|
||||
if (!get(isSelectingAllAssets)) {
|
||||
assetInteraction.clearMultiselect();
|
||||
@@ -499,8 +500,8 @@ export const selectAllAssets = async (timelineManager: TimelineManager, assetInt
|
||||
}
|
||||
assetInteraction.selectAssets(assetsSnapshot([...month.assetsIterator()]));
|
||||
|
||||
for (const dateGroup of month.days) {
|
||||
assetInteraction.addGroupToMultiselectGroup(dateGroup.dayTitle);
|
||||
for (const day of month.days) {
|
||||
assetInteraction.addGroupToMultiselectGroup(day.dayTitle);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user