2022-09-04 08:34:39 -05:00
|
|
|
<script lang="ts">
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
import { afterNavigate, beforeNavigate, goto } from '$app/navigation';
|
2025-05-09 19:24:36 +02:00
|
|
|
import { page } from '$app/stores';
|
|
|
|
|
import { resizeObserver, type OnResizeCallback } from '$lib/actions/resize-observer';
|
2024-07-31 18:25:38 +02:00
|
|
|
import { shortcuts, type ShortcutOptions } from '$lib/actions/shortcut';
|
|
|
|
|
import type { Action } from '$lib/components/asset-viewer/actions/action';
|
2025-05-28 09:55:14 -04:00
|
|
|
import {
|
|
|
|
|
setFocusToAsset as setFocusAssetInit,
|
|
|
|
|
setFocusTo as setFocusToInit,
|
|
|
|
|
} from '$lib/components/photos-page/actions/focus-actions';
|
2025-05-09 19:24:36 +02:00
|
|
|
import Skeleton from '$lib/components/photos-page/skeleton.svelte';
|
2025-05-28 09:55:14 -04:00
|
|
|
import ChangeDate from '$lib/components/shared-components/change-date.svelte';
|
2025-05-13 16:10:05 +02:00
|
|
|
import Scrubber from '$lib/components/shared-components/scrubber/scrubber.svelte';
|
2023-08-11 12:00:51 -04:00
|
|
|
import { AppRoute, AssetAction } from '$lib/constants';
|
2025-05-09 19:24:36 +02:00
|
|
|
import { albumMapViewManager } from '$lib/managers/album-view-map.manager.svelte';
|
2025-05-17 22:57:08 -04:00
|
|
|
import { authManager } from '$lib/managers/auth-manager.svelte';
|
2025-05-09 19:24:36 +02:00
|
|
|
import { modalManager } from '$lib/managers/modal-manager.svelte';
|
2025-06-10 10:30:13 -04:00
|
|
|
import type { MonthGroup } from '$lib/managers/timeline-manager/month-group.svelte';
|
|
|
|
|
import { TimelineManager } from '$lib/managers/timeline-manager/timeline-manager.svelte';
|
|
|
|
|
import type { TimelineAsset } from '$lib/managers/timeline-manager/types';
|
|
|
|
|
import { assetsSnapshot } from '$lib/managers/timeline-manager/utils.svelte';
|
2025-05-09 19:24:36 +02:00
|
|
|
import ShortcutsModal from '$lib/modals/ShortcutsModal.svelte';
|
|
|
|
|
import type { AssetInteraction } from '$lib/stores/asset-interaction.svelte';
|
2023-08-01 04:27:56 +03:00
|
|
|
import { assetViewingStore } from '$lib/stores/asset-viewing.store';
|
2025-06-04 22:27:54 -04:00
|
|
|
import { isSelectingAllAssets } from '$lib/stores/assets-store.svelte';
|
2025-05-09 19:24:36 +02:00
|
|
|
import { mobileDevice } from '$lib/stores/mobile-device.svelte';
|
2025-03-18 10:14:46 -04:00
|
|
|
import { showDeleteModal } from '$lib/stores/preferences.store';
|
2025-04-10 16:34:45 -04:00
|
|
|
import { searchStore } from '$lib/stores/search.svelte';
|
2024-02-14 06:38:57 -08:00
|
|
|
import { featureFlags } from '$lib/stores/server-config.store';
|
2024-07-31 18:25:38 +02:00
|
|
|
import { handlePromiseError } from '$lib/utils';
|
2025-03-21 12:42:36 -05:00
|
|
|
import { deleteAssets, updateStackedAssetInTimeline, updateUnstackedAssetInTimeline } from '$lib/utils/actions';
|
2024-10-21 02:11:00 +08:00
|
|
|
import { archiveAssets, cancelMultiselect, selectAllAssets, stackAssets } from '$lib/utils/asset-utils';
|
2024-07-31 18:25:38 +02:00
|
|
|
import { navigate } from '$lib/utils/navigation';
|
2025-06-08 22:35:41 -04:00
|
|
|
import { toTimelineAsset, type ScrubberListener, type TimelinePlainYearMonth } from '$lib/utils/timeline-util';
|
2025-05-17 22:57:08 -04:00
|
|
|
import { AssetVisibility, getAssetInfo, type AlbumResponseDto, type PersonResponseDto } from '@immich/sdk';
|
2025-05-28 09:55:14 -04:00
|
|
|
import { DateTime } from 'luxon';
|
2025-03-18 10:14:46 -04:00
|
|
|
import { onMount, type Snippet } from 'svelte';
|
2025-05-09 19:24:36 +02:00
|
|
|
import type { UpdatePayload } from 'vite';
|
2023-07-01 00:50:47 -04:00
|
|
|
import Portal from '../shared-components/portal/portal.svelte';
|
2023-08-11 12:00:51 -04:00
|
|
|
import AssetDateGroup from './asset-date-group.svelte';
|
2024-01-17 20:18:04 +01:00
|
|
|
import DeleteAssetDialog from './delete-asset-dialog.svelte';
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
|
2024-11-14 08:43:25 -06:00
|
|
|
interface Props {
|
|
|
|
|
isSelectionMode?: boolean;
|
|
|
|
|
singleSelect?: boolean;
|
|
|
|
|
/** `true` if this asset grid is responds to navigation events; if `true`, then look at the
|
2025-03-12 02:18:14 +11:00
|
|
|
`AssetViewingStore.gridScrollTarget` and load and scroll to the asset specified, and
|
|
|
|
|
additionally, update the page location/url with the asset as the asset-grid is scrolled */
|
2024-11-14 08:43:25 -06:00
|
|
|
enableRouting: boolean;
|
2025-06-10 10:30:13 -04:00
|
|
|
timelineManager: TimelineManager;
|
2024-12-14 19:30:33 +01:00
|
|
|
assetInteraction: AssetInteraction;
|
2025-05-15 09:35:21 -06:00
|
|
|
removeAction?:
|
|
|
|
|
| AssetAction.UNARCHIVE
|
|
|
|
|
| AssetAction.ARCHIVE
|
|
|
|
|
| AssetAction.FAVORITE
|
|
|
|
|
| AssetAction.UNFAVORITE
|
|
|
|
|
| AssetAction.SET_VISIBILITY_TIMELINE
|
|
|
|
|
| null;
|
2024-11-14 08:43:25 -06:00
|
|
|
withStacked?: boolean;
|
|
|
|
|
showArchiveIcon?: boolean;
|
|
|
|
|
isShared?: boolean;
|
|
|
|
|
album?: AlbumResponseDto | null;
|
2024-12-23 19:26:53 +01:00
|
|
|
person?: PersonResponseDto | null;
|
2024-11-14 08:43:25 -06:00
|
|
|
isShowDeleteConfirmation?: boolean;
|
2025-05-17 22:57:08 -04:00
|
|
|
onSelect?: (asset: TimelineAsset) => void;
|
2024-11-14 08:43:25 -06:00
|
|
|
onEscape?: () => void;
|
|
|
|
|
children?: Snippet;
|
|
|
|
|
empty?: Snippet;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let {
|
|
|
|
|
isSelectionMode = false,
|
|
|
|
|
singleSelect = false,
|
|
|
|
|
enableRouting,
|
2025-06-10 10:30:13 -04:00
|
|
|
timelineManager = $bindable(),
|
2024-12-14 19:30:33 +01:00
|
|
|
assetInteraction,
|
2024-11-14 08:43:25 -06:00
|
|
|
removeAction = null,
|
|
|
|
|
withStacked = false,
|
|
|
|
|
showArchiveIcon = false,
|
|
|
|
|
isShared = false,
|
|
|
|
|
album = null,
|
2024-12-23 19:26:53 +01:00
|
|
|
person = null,
|
2024-11-14 08:43:25 -06:00
|
|
|
isShowDeleteConfirmation = $bindable(false),
|
|
|
|
|
onSelect = () => {},
|
|
|
|
|
onEscape = () => {},
|
|
|
|
|
children,
|
|
|
|
|
empty,
|
|
|
|
|
}: Props = $props();
|
2023-10-18 11:54:20 -04:00
|
|
|
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
let { isViewing: showAssetViewer, asset: viewingAsset, preloadAssets, gridScrollTarget } = assetViewingStore;
|
|
|
|
|
|
2024-11-14 08:43:25 -06:00
|
|
|
let element: HTMLElement | undefined = $state();
|
2025-03-18 10:14:46 -04:00
|
|
|
|
2024-11-14 08:43:25 -06:00
|
|
|
let timelineElement: HTMLElement | undefined = $state();
|
|
|
|
|
let showSkeleton = $state(true);
|
2025-05-28 09:55:14 -04:00
|
|
|
let isShowSelectDate = $state(false);
|
2025-06-10 10:30:13 -04:00
|
|
|
let scrubberMonthPercent = $state(0);
|
|
|
|
|
let scrubberMonth: { year: number; month: number } | undefined = $state(undefined);
|
2024-11-14 08:43:25 -06:00
|
|
|
let scrubOverallPercent: number = $state(0);
|
2025-04-14 12:56:40 -04:00
|
|
|
let scrubberWidth = $state(0);
|
2025-03-18 10:14:46 -04:00
|
|
|
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
// 60 is the bottom spacer element at 60px
|
|
|
|
|
let bottomSectionHeight = 60;
|
2024-11-14 08:43:25 -06:00
|
|
|
let leadout = $state(false);
|
2023-07-01 00:50:47 -04:00
|
|
|
|
2025-04-14 12:56:40 -04:00
|
|
|
const maxMd = $derived(mobileDevice.maxMd);
|
2025-03-27 10:43:56 -05:00
|
|
|
const usingMobileDevice = $derived(mobileDevice.pointerCoarse);
|
2025-03-21 14:00:24 -04:00
|
|
|
|
2025-04-14 12:56:40 -04:00
|
|
|
$effect(() => {
|
2025-04-29 13:59:06 -04:00
|
|
|
const layoutOptions = maxMd
|
|
|
|
|
? {
|
|
|
|
|
rowHeight: 100,
|
|
|
|
|
headerHeight: 32,
|
|
|
|
|
}
|
|
|
|
|
: {
|
|
|
|
|
rowHeight: 235,
|
|
|
|
|
headerHeight: 48,
|
|
|
|
|
};
|
2025-06-10 10:30:13 -04:00
|
|
|
timelineManager.setLayoutOptions(layoutOptions);
|
2025-04-14 12:56:40 -04:00
|
|
|
});
|
|
|
|
|
|
2025-03-21 08:40:57 -05:00
|
|
|
const scrollTo = (top: number) => {
|
2025-05-28 09:55:14 -04:00
|
|
|
if (element) {
|
|
|
|
|
element.scrollTo({ top });
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
const scrollTop = (top: number) => {
|
|
|
|
|
if (element) {
|
|
|
|
|
element.scrollTop = top;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
const scrollBy = (y: number) => {
|
|
|
|
|
if (element) {
|
|
|
|
|
element.scrollBy(0, y);
|
|
|
|
|
}
|
2025-03-21 08:40:57 -05:00
|
|
|
};
|
|
|
|
|
const scrollToTop = () => {
|
|
|
|
|
scrollTo(0);
|
|
|
|
|
};
|
|
|
|
|
|
2025-06-10 10:30:13 -04:00
|
|
|
const getAssetHeight = (assetId: string, monthGroup: MonthGroup) => {
|
2025-05-28 09:55:14 -04:00
|
|
|
// the following method may trigger any layouts, so need to
|
|
|
|
|
// handle any scroll compensation that may have been set
|
2025-06-10 10:30:13 -04:00
|
|
|
const height = monthGroup!.findAssetAbsolutePosition(assetId);
|
2025-05-28 09:55:14 -04:00
|
|
|
|
2025-06-10 10:30:13 -04:00
|
|
|
while (timelineManager.scrollCompensation.monthGroup) {
|
|
|
|
|
handleScrollCompensation(timelineManager.scrollCompensation);
|
|
|
|
|
timelineManager.clearScrollCompensation();
|
2025-05-28 09:55:14 -04:00
|
|
|
}
|
|
|
|
|
return height;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const scrollToAssetId = async (assetId: string) => {
|
2025-06-10 10:30:13 -04:00
|
|
|
const monthGroup = await timelineManager.findMonthGroupForAsset(assetId);
|
|
|
|
|
if (!monthGroup) {
|
2025-05-28 09:55:14 -04:00
|
|
|
return false;
|
2025-05-23 08:21:37 -05:00
|
|
|
}
|
2025-06-10 10:30:13 -04:00
|
|
|
const height = getAssetHeight(assetId, monthGroup);
|
2025-05-28 09:55:14 -04:00
|
|
|
scrollTo(height);
|
|
|
|
|
updateSlidingWindow();
|
|
|
|
|
return true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const scrollToAsset = (asset: TimelineAsset) => {
|
2025-06-10 10:30:13 -04:00
|
|
|
const monthGroup = timelineManager.getMonthGroupByAssetId(asset.id);
|
|
|
|
|
if (!monthGroup) {
|
2025-05-28 09:55:14 -04:00
|
|
|
return false;
|
|
|
|
|
}
|
2025-06-10 10:30:13 -04:00
|
|
|
const height = getAssetHeight(asset.id, monthGroup);
|
2025-05-28 09:55:14 -04:00
|
|
|
scrollTo(height);
|
|
|
|
|
updateSlidingWindow();
|
|
|
|
|
return true;
|
2025-05-23 08:21:37 -05:00
|
|
|
};
|
|
|
|
|
|
2025-03-18 10:14:46 -04:00
|
|
|
const completeNav = async () => {
|
2025-03-21 08:40:57 -05:00
|
|
|
const scrollTarget = $gridScrollTarget?.at;
|
2025-05-23 08:21:37 -05:00
|
|
|
let scrolled = false;
|
2025-03-21 08:40:57 -05:00
|
|
|
if (scrollTarget) {
|
2025-05-28 09:55:14 -04:00
|
|
|
scrolled = await scrollToAssetId(scrollTarget);
|
2025-05-23 08:21:37 -05:00
|
|
|
}
|
|
|
|
|
if (!scrolled) {
|
|
|
|
|
// if the asset is not found, scroll to the top
|
|
|
|
|
scrollToTop();
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
}
|
2025-05-28 09:55:14 -04:00
|
|
|
showSkeleton = false;
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
};
|
2025-05-23 08:21:37 -05:00
|
|
|
|
2025-06-10 10:30:13 -04:00
|
|
|
beforeNavigate(() => (timelineManager.suspendTransitions = true));
|
2025-05-23 08:21:37 -05:00
|
|
|
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
afterNavigate((nav) => {
|
2025-04-09 14:47:29 +00:00
|
|
|
const { complete } = nav;
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
complete.then(completeNav, completeNav);
|
2023-07-01 00:50:47 -04:00
|
|
|
});
|
|
|
|
|
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
const hmrSupport = () => {
|
|
|
|
|
// when hmr happens, skeleton is initialized to true by default
|
|
|
|
|
// normally, loading asset-grid is part of a navigation event, and the completion of
|
|
|
|
|
// that event triggers a scroll-to-asset, if necessary, when then clears the skeleton.
|
|
|
|
|
// this handler will run the navigation/scroll-to-asset handler when hmr is performed,
|
|
|
|
|
// preventing skeleton from showing after hmr
|
|
|
|
|
if (import.meta && import.meta.hot) {
|
|
|
|
|
const afterApdate = (payload: UpdatePayload) => {
|
|
|
|
|
const assetGridUpdate = payload.updates.some(
|
|
|
|
|
(update) => update.path.endsWith('asset-grid.svelte') || update.path.endsWith('assets-store.ts'),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (assetGridUpdate) {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
const asset = $page.url.searchParams.get('at');
|
|
|
|
|
if (asset) {
|
|
|
|
|
$gridScrollTarget = { at: asset };
|
|
|
|
|
void navigate(
|
|
|
|
|
{ targetRoute: 'current', assetId: null, assetGridRouteSearchParams: $gridScrollTarget },
|
|
|
|
|
{ replaceState: true, forceNavigate: true },
|
|
|
|
|
);
|
|
|
|
|
} else {
|
2025-03-21 08:40:57 -05:00
|
|
|
scrollToTop();
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
}
|
2025-05-28 09:55:14 -04:00
|
|
|
showSkeleton = false;
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
}, 500);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
import.meta.hot?.on('vite:afterUpdate', afterApdate);
|
|
|
|
|
import.meta.hot?.on('vite:beforeUpdate', (payload) => {
|
|
|
|
|
const assetGridUpdate = payload.updates.some((update) => update.path.endsWith('asset-grid.svelte'));
|
|
|
|
|
if (assetGridUpdate) {
|
2025-06-10 10:30:13 -04:00
|
|
|
timelineManager.destroy();
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return () => import.meta.hot?.off('vite:afterUpdate', afterApdate);
|
|
|
|
|
}
|
|
|
|
|
return () => void 0;
|
|
|
|
|
};
|
|
|
|
|
|
2025-06-10 10:30:13 -04:00
|
|
|
const updateIsScrolling = () => (timelineManager.scrolling = true);
|
2025-03-18 10:14:46 -04:00
|
|
|
// note: don't throttle, debounch, or otherwise do this function async - it causes flicker
|
2025-06-10 10:30:13 -04:00
|
|
|
const updateSlidingWindow = () => timelineManager.updateSlidingWindow(element?.scrollTop || 0);
|
2025-05-28 09:55:14 -04:00
|
|
|
|
|
|
|
|
const handleScrollCompensation = ({ heightDelta, scrollTop }: { heightDelta?: number; scrollTop?: number }) => {
|
|
|
|
|
if (heightDelta !== undefined) {
|
|
|
|
|
scrollBy(heightDelta);
|
|
|
|
|
} else if (scrollTop !== undefined) {
|
|
|
|
|
scrollTo(scrollTop);
|
2025-04-14 12:56:40 -04:00
|
|
|
}
|
2025-05-28 09:55:14 -04:00
|
|
|
// Yes, updateSlideWindow() is called by the onScroll event triggered as a result of
|
|
|
|
|
// the above calls. However, this delay is enough time to set the intersecting property
|
2025-06-10 10:30:13 -04:00
|
|
|
// of the monthGroup to false, then true, which causes the DOM nodes to be recreated,
|
2025-05-28 09:55:14 -04:00
|
|
|
// causing bad perf, and also, disrupting focus of those elements.
|
|
|
|
|
updateSlidingWindow();
|
2025-04-14 12:56:40 -04:00
|
|
|
};
|
2025-05-28 09:55:14 -04:00
|
|
|
|
2025-06-10 10:30:13 -04:00
|
|
|
const topSectionResizeObserver: OnResizeCallback = ({ height }) => (timelineManager.topSectionHeight = height);
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
|
|
|
|
|
onMount(() => {
|
|
|
|
|
if (!enableRouting) {
|
|
|
|
|
showSkeleton = false;
|
|
|
|
|
}
|
2025-03-18 10:14:46 -04:00
|
|
|
const disposeHmr = hmrSupport();
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
return () => {
|
2025-03-18 10:14:46 -04:00
|
|
|
disposeHmr();
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
};
|
2023-07-01 00:50:47 -04:00
|
|
|
});
|
|
|
|
|
|
2025-03-18 10:14:46 -04:00
|
|
|
const getMaxScrollPercent = () => {
|
2025-06-10 10:30:13 -04:00
|
|
|
const totalHeight = timelineManager.timelineHeight + bottomSectionHeight + timelineManager.topSectionHeight;
|
|
|
|
|
return (totalHeight - timelineManager.viewportHeight) / totalHeight;
|
2025-03-18 10:14:46 -04:00
|
|
|
};
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
|
2024-11-14 08:43:25 -06:00
|
|
|
const getMaxScroll = () => {
|
|
|
|
|
if (!element || !timelineElement) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2025-06-10 10:30:13 -04:00
|
|
|
return (
|
|
|
|
|
timelineManager.topSectionHeight + bottomSectionHeight + (timelineElement.clientHeight - element.clientHeight)
|
|
|
|
|
);
|
2024-11-14 08:43:25 -06:00
|
|
|
};
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
|
2025-06-10 10:30:13 -04:00
|
|
|
const scrollToMonthGroupAndOffset = (monthGroup: MonthGroup, monthGroupScrollPercent: number) => {
|
|
|
|
|
const topOffset = monthGroup.top;
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
const maxScrollPercent = getMaxScrollPercent();
|
2025-06-10 10:30:13 -04:00
|
|
|
const delta = monthGroup.height * monthGroupScrollPercent;
|
2025-05-28 09:55:14 -04:00
|
|
|
const scrollToTop = (topOffset + delta) * maxScrollPercent;
|
2024-11-14 08:43:25 -06:00
|
|
|
|
2025-05-28 09:55:14 -04:00
|
|
|
scrollTop(scrollToTop);
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
};
|
|
|
|
|
|
2025-03-18 10:14:46 -04:00
|
|
|
// note: don't throttle, debounch, or otherwise make this function async - it causes flicker
|
|
|
|
|
const onScrub: ScrubberListener = (
|
2025-06-10 10:30:13 -04:00
|
|
|
scrubMonth: { year: number; month: number },
|
|
|
|
|
overallScrollPercent: number,
|
|
|
|
|
scrubberMonthScrollPercent: number,
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
) => {
|
2025-06-10 10:30:13 -04:00
|
|
|
if (!scrubMonth || timelineManager.timelineHeight < timelineManager.viewportHeight * 2) {
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
// edge case - scroll limited due to size of content, must adjust - use use the overall percent instead
|
|
|
|
|
const maxScroll = getMaxScroll();
|
2025-06-10 10:30:13 -04:00
|
|
|
const offset = maxScroll * overallScrollPercent;
|
2025-05-28 09:55:14 -04:00
|
|
|
scrollTop(offset);
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
} else {
|
2025-06-10 10:30:13 -04:00
|
|
|
const monthGroup = timelineManager.months.find(
|
|
|
|
|
({ yearMonth: { year, month } }) => year === scrubMonth.year && month === scrubMonth.month,
|
2025-05-28 09:55:14 -04:00
|
|
|
);
|
2025-06-10 10:30:13 -04:00
|
|
|
if (!monthGroup) {
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
return;
|
|
|
|
|
}
|
2025-06-10 10:30:13 -04:00
|
|
|
scrollToMonthGroupAndOffset(monthGroup, scrubberMonthScrollPercent);
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
}
|
|
|
|
|
};
|
2024-10-30 09:38:35 -05:00
|
|
|
|
2025-03-18 10:14:46 -04:00
|
|
|
// note: don't throttle, debounch, or otherwise make this function async - it causes flicker
|
|
|
|
|
const handleTimelineScroll = () => {
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
leadout = false;
|
2024-11-14 08:43:25 -06:00
|
|
|
|
|
|
|
|
if (!element) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-10 10:30:13 -04:00
|
|
|
if (timelineManager.timelineHeight < timelineManager.viewportHeight * 2) {
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
// edge case - scroll limited due to size of content, must adjust - use the overall percent instead
|
|
|
|
|
const maxScroll = getMaxScroll();
|
|
|
|
|
scrubOverallPercent = Math.min(1, element.scrollTop / maxScroll);
|
|
|
|
|
|
2025-06-10 10:30:13 -04:00
|
|
|
scrubberMonth = undefined;
|
|
|
|
|
scrubberMonthPercent = 0;
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
} else {
|
2025-03-18 10:14:46 -04:00
|
|
|
let top = element.scrollTop;
|
2025-06-10 10:30:13 -04:00
|
|
|
if (top < timelineManager.topSectionHeight) {
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
// in the lead-in area
|
2025-06-10 10:30:13 -04:00
|
|
|
scrubberMonth = undefined;
|
|
|
|
|
scrubberMonthPercent = 0;
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
const maxScroll = getMaxScroll();
|
|
|
|
|
|
|
|
|
|
scrubOverallPercent = Math.min(1, element.scrollTop / maxScroll);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let maxScrollPercent = getMaxScrollPercent();
|
|
|
|
|
let found = false;
|
|
|
|
|
|
2025-06-10 10:30:13 -04:00
|
|
|
const monthsLength = timelineManager.months.length;
|
|
|
|
|
for (let i = -1; i < monthsLength + 1; i++) {
|
|
|
|
|
let monthGroup: TimelinePlainYearMonth | undefined;
|
|
|
|
|
let monthGroupHeight = 0;
|
2025-03-18 10:14:46 -04:00
|
|
|
if (i === -1) {
|
|
|
|
|
// lead-in
|
2025-06-10 10:30:13 -04:00
|
|
|
monthGroupHeight = timelineManager.topSectionHeight;
|
|
|
|
|
} else if (i === monthsLength) {
|
2025-03-18 10:14:46 -04:00
|
|
|
// lead-out
|
2025-06-10 10:30:13 -04:00
|
|
|
monthGroupHeight = bottomSectionHeight;
|
2025-03-18 10:14:46 -04:00
|
|
|
} else {
|
2025-06-10 10:30:13 -04:00
|
|
|
monthGroup = timelineManager.months[i].yearMonth;
|
|
|
|
|
monthGroupHeight = timelineManager.months[i].height;
|
2025-03-18 10:14:46 -04:00
|
|
|
}
|
2025-04-14 12:56:40 -04:00
|
|
|
|
2025-06-10 10:30:13 -04:00
|
|
|
let next = top - monthGroupHeight * maxScrollPercent;
|
2025-04-14 12:56:40 -04:00
|
|
|
// instead of checking for < 0, add a little wiggle room for subpixel resolution
|
2025-06-10 10:30:13 -04:00
|
|
|
if (next < -1 && monthGroup) {
|
|
|
|
|
scrubberMonth = monthGroup;
|
2025-04-14 12:56:40 -04:00
|
|
|
|
|
|
|
|
// allowing next to be at least 1 may cause percent to go negative, so ensure positive percentage
|
2025-06-10 10:30:13 -04:00
|
|
|
scrubberMonthPercent = Math.max(0, top / (monthGroupHeight * maxScrollPercent));
|
2025-04-14 12:56:40 -04:00
|
|
|
|
2025-05-09 09:10:34 -04:00
|
|
|
// compensate for lost precision/rounding errors advance to the next bucket, if present
|
2025-06-10 10:30:13 -04:00
|
|
|
if (scrubberMonthPercent > 0.9999 && i + 1 < monthsLength - 1) {
|
|
|
|
|
scrubberMonth = timelineManager.months[i + 1].yearMonth;
|
|
|
|
|
scrubberMonthPercent = 0;
|
2025-04-14 12:56:40 -04:00
|
|
|
}
|
|
|
|
|
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
found = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
top = next;
|
|
|
|
|
}
|
|
|
|
|
if (!found) {
|
|
|
|
|
leadout = true;
|
2025-06-10 10:30:13 -04:00
|
|
|
scrubberMonth = undefined;
|
|
|
|
|
scrubberMonthPercent = 0;
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
scrubOverallPercent = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2024-02-27 08:37:37 -08:00
|
|
|
const trashOrDelete = async (force: boolean = false) => {
|
2024-01-17 20:18:04 +01:00
|
|
|
isShowDeleteConfirmation = false;
|
2025-06-04 11:46:07 -04:00
|
|
|
await deleteAssets(
|
|
|
|
|
!(isTrashEnabled && !force),
|
2025-06-10 10:30:13 -04:00
|
|
|
(assetIds) => timelineManager.removeAssets(assetIds),
|
2025-06-04 11:46:07 -04:00
|
|
|
assetInteraction.selectedAssets,
|
2025-06-10 10:30:13 -04:00
|
|
|
!isTrashEnabled || force ? undefined : (assets) => timelineManager.addAssets(assets),
|
2025-06-04 11:46:07 -04:00
|
|
|
);
|
2024-12-14 19:30:33 +01:00
|
|
|
assetInteraction.clearMultiselect();
|
2024-01-17 20:18:04 +01:00
|
|
|
};
|
|
|
|
|
|
2024-03-15 00:16:55 +01:00
|
|
|
const onDelete = () => {
|
2025-03-19 11:55:50 -04:00
|
|
|
const hasTrashedAsset = assetInteraction.selectedAssets.some((asset) => asset.isTrashed);
|
2024-04-15 22:21:54 +02:00
|
|
|
|
|
|
|
|
if ($showDeleteModal && (!isTrashEnabled || hasTrashedAsset)) {
|
2024-03-15 00:16:55 +01:00
|
|
|
isShowDeleteConfirmation = true;
|
2023-07-19 11:03:23 -05:00
|
|
|
return;
|
|
|
|
|
}
|
2024-04-15 22:21:54 +02:00
|
|
|
handlePromiseError(trashOrDelete(hasTrashedAsset));
|
2024-03-15 00:16:55 +01:00
|
|
|
};
|
2023-07-19 11:03:23 -05:00
|
|
|
|
2024-03-15 00:16:55 +01:00
|
|
|
const onForceDelete = () => {
|
|
|
|
|
if ($showDeleteModal) {
|
|
|
|
|
isShowDeleteConfirmation = true;
|
|
|
|
|
return;
|
2023-07-17 05:16:14 +02:00
|
|
|
}
|
2024-03-15 00:16:55 +01:00
|
|
|
handlePromiseError(trashOrDelete(true));
|
2023-07-17 05:16:14 +02:00
|
|
|
};
|
|
|
|
|
|
2024-04-02 09:04:52 -06:00
|
|
|
const onStackAssets = async () => {
|
2025-03-21 12:42:36 -05:00
|
|
|
const result = await stackAssets(assetInteraction.selectedAssets);
|
|
|
|
|
|
2025-06-10 10:30:13 -04:00
|
|
|
updateStackedAssetInTimeline(timelineManager, result);
|
2025-03-21 12:42:36 -05:00
|
|
|
|
|
|
|
|
onEscape();
|
2024-04-02 09:04:52 -06:00
|
|
|
};
|
|
|
|
|
|
2024-06-06 18:23:49 -05:00
|
|
|
const toggleArchive = async () => {
|
2025-06-10 10:30:13 -04:00
|
|
|
const visibility = assetInteraction.isAllArchived ? AssetVisibility.Timeline : AssetVisibility.Archive;
|
|
|
|
|
const ids = await archiveAssets(assetInteraction.selectedAssets, visibility);
|
|
|
|
|
timelineManager.updateAssetOperation(ids, (asset) => {
|
|
|
|
|
asset.visibility = visibility;
|
|
|
|
|
return { remove: false };
|
|
|
|
|
});
|
2025-03-18 10:14:46 -04:00
|
|
|
deselectAllAssets();
|
2024-06-06 18:23:49 -05:00
|
|
|
};
|
|
|
|
|
|
2025-05-17 22:57:08 -04:00
|
|
|
const handleSelectAsset = (asset: TimelineAsset) => {
|
2025-06-10 10:30:13 -04:00
|
|
|
if (!timelineManager.albumAssets.has(asset.id)) {
|
2024-12-14 19:30:33 +01:00
|
|
|
assetInteraction.selectAsset(asset);
|
2023-08-11 12:00:51 -04:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2023-08-04 23:26:28 -04:00
|
|
|
const handlePrevious = async () => {
|
2025-06-10 10:30:13 -04:00
|
|
|
const laterAsset = await timelineManager.getLaterAsset($viewingAsset);
|
2024-03-14 17:12:32 -04:00
|
|
|
|
2025-05-28 09:55:14 -04:00
|
|
|
if (laterAsset) {
|
2025-06-10 10:30:13 -04:00
|
|
|
const preloadAsset = await timelineManager.getLaterAsset(laterAsset);
|
2025-05-28 09:55:14 -04:00
|
|
|
const asset = await getAssetInfo({ id: laterAsset.id, key: authManager.key });
|
2025-05-17 22:57:08 -04:00
|
|
|
assetViewingStore.setAsset(asset, preloadAsset ? [preloadAsset] : []);
|
2025-05-28 09:55:14 -04:00
|
|
|
await navigate({ targetRoute: 'current', assetId: laterAsset.id });
|
2023-08-01 04:27:56 +03:00
|
|
|
}
|
2023-08-04 23:26:28 -04:00
|
|
|
|
2025-05-28 09:55:14 -04:00
|
|
|
return !!laterAsset;
|
2023-07-01 00:50:47 -04:00
|
|
|
};
|
|
|
|
|
|
2023-08-04 23:26:28 -04:00
|
|
|
const handleNext = async () => {
|
2025-06-10 10:30:13 -04:00
|
|
|
const earlierAsset = await timelineManager.getEarlierAsset($viewingAsset);
|
2025-05-28 09:55:14 -04:00
|
|
|
if (earlierAsset) {
|
2025-06-10 10:30:13 -04:00
|
|
|
const preloadAsset = await timelineManager.getEarlierAsset(earlierAsset);
|
2025-05-28 09:55:14 -04:00
|
|
|
const asset = await getAssetInfo({ id: earlierAsset.id, key: authManager.key });
|
2025-05-17 22:57:08 -04:00
|
|
|
assetViewingStore.setAsset(asset, preloadAsset ? [preloadAsset] : []);
|
2025-05-28 09:55:14 -04:00
|
|
|
await navigate({ targetRoute: 'current', assetId: earlierAsset.id });
|
2023-08-01 04:27:56 +03:00
|
|
|
}
|
2023-08-04 23:26:28 -04:00
|
|
|
|
2025-05-28 09:55:14 -04:00
|
|
|
return !!earlierAsset;
|
2023-08-04 23:26:28 -04:00
|
|
|
};
|
|
|
|
|
|
2025-01-14 15:24:58 +01:00
|
|
|
const handleRandom = async () => {
|
2025-06-10 10:30:13 -04:00
|
|
|
const randomAsset = await timelineManager.getRandomAsset();
|
2025-01-14 15:24:58 +01:00
|
|
|
|
|
|
|
|
if (randomAsset) {
|
2025-05-17 22:57:08 -04:00
|
|
|
const asset = await getAssetInfo({ id: randomAsset.id, key: authManager.key });
|
2025-05-28 09:55:14 -04:00
|
|
|
assetViewingStore.setAsset(asset);
|
2025-01-14 15:24:58 +01:00
|
|
|
await navigate({ targetRoute: 'current', assetId: randomAsset.id });
|
2025-05-17 22:57:08 -04:00
|
|
|
return asset;
|
2025-01-14 15:24:58 +01:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2025-05-17 22:57:08 -04:00
|
|
|
const handleClose = async (asset: { id: string }) => {
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
assetViewingStore.showAssetViewer(false);
|
|
|
|
|
showSkeleton = true;
|
|
|
|
|
$gridScrollTarget = { at: asset.id };
|
|
|
|
|
await navigate({ targetRoute: 'current', assetId: null, assetGridRouteSearchParams: $gridScrollTarget });
|
|
|
|
|
};
|
2023-08-04 23:26:28 -04:00
|
|
|
|
2025-03-03 19:24:37 +01:00
|
|
|
const handlePreAction = async (action: Action) => {
|
2024-07-31 18:25:38 +02:00
|
|
|
switch (action.type) {
|
2023-12-04 19:18:28 -05:00
|
|
|
case removeAction:
|
|
|
|
|
case AssetAction.TRASH:
|
2024-04-19 19:19:50 -06:00
|
|
|
case AssetAction.RESTORE:
|
2025-03-20 22:30:27 -05:00
|
|
|
case AssetAction.DELETE:
|
2025-05-15 09:35:21 -06:00
|
|
|
case AssetAction.ARCHIVE:
|
|
|
|
|
case AssetAction.SET_VISIBILITY_LOCKED:
|
|
|
|
|
case AssetAction.SET_VISIBILITY_TIMELINE: {
|
2023-12-04 19:18:28 -05:00
|
|
|
// find the next asset to show or close the viewer
|
2024-08-05 19:13:00 +00:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
2025-05-17 22:57:08 -04:00
|
|
|
(await handleNext()) || (await handlePrevious()) || (await handleClose(action.asset));
|
2023-12-04 19:18:28 -05:00
|
|
|
|
|
|
|
|
// delete after find the next one
|
2025-06-10 10:30:13 -04:00
|
|
|
timelineManager.removeAssets([action.asset.id]);
|
2023-12-04 19:18:28 -05:00
|
|
|
break;
|
2024-02-02 04:18:00 +01:00
|
|
|
}
|
2025-03-03 19:24:37 +01:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
const handleAction = (action: Action) => {
|
|
|
|
|
switch (action.type) {
|
2023-12-04 19:18:28 -05:00
|
|
|
case AssetAction.ARCHIVE:
|
|
|
|
|
case AssetAction.UNARCHIVE:
|
|
|
|
|
case AssetAction.FAVORITE:
|
2024-02-02 04:18:00 +01:00
|
|
|
case AssetAction.UNFAVORITE: {
|
2025-06-10 10:30:13 -04:00
|
|
|
timelineManager.updateAssets([action.asset]);
|
2023-12-04 19:18:28 -05:00
|
|
|
break;
|
2024-02-02 04:18:00 +01:00
|
|
|
}
|
2023-12-04 19:18:28 -05:00
|
|
|
|
2024-02-02 04:18:00 +01:00
|
|
|
case AssetAction.ADD: {
|
2025-06-10 10:30:13 -04:00
|
|
|
timelineManager.addAssets([action.asset]);
|
2023-12-04 19:18:28 -05:00
|
|
|
break;
|
2024-02-02 04:18:00 +01:00
|
|
|
}
|
2024-07-31 18:25:38 +02:00
|
|
|
|
|
|
|
|
case AssetAction.UNSTACK: {
|
2025-06-10 10:30:13 -04:00
|
|
|
updateUnstackedAssetInTimeline(timelineManager, action.assets);
|
2025-05-15 09:35:21 -06:00
|
|
|
break;
|
2024-07-31 18:25:38 +02:00
|
|
|
}
|
2025-06-08 22:35:41 -04:00
|
|
|
case AssetAction.SET_STACK_PRIMARY_ASSET: {
|
|
|
|
|
//Have to unstack then restack assets in timeline in order for the currently removed new primary asset to be made visible.
|
|
|
|
|
updateUnstackedAssetInTimeline(
|
2025-06-10 10:30:13 -04:00
|
|
|
timelineManager,
|
2025-06-08 22:35:41 -04:00
|
|
|
action.stack.assets.map((asset) => toTimelineAsset(asset)),
|
|
|
|
|
);
|
2025-06-10 10:30:13 -04:00
|
|
|
updateStackedAssetInTimeline(timelineManager, {
|
2025-06-08 22:35:41 -04:00
|
|
|
stack: action.stack,
|
|
|
|
|
toDeleteIds: action.stack.assets
|
|
|
|
|
.filter((asset) => asset.id !== action.stack.primaryAssetId)
|
|
|
|
|
.map((asset) => asset.id),
|
|
|
|
|
});
|
|
|
|
|
break;
|
|
|
|
|
}
|
2023-08-04 23:26:28 -04:00
|
|
|
}
|
2023-07-01 00:50:47 -04:00
|
|
|
};
|
|
|
|
|
|
2025-05-17 22:57:08 -04:00
|
|
|
let lastAssetMouseEvent: TimelineAsset | null = $state(null);
|
2023-07-03 10:56:58 +01:00
|
|
|
|
2024-11-14 08:43:25 -06:00
|
|
|
let shiftKeyIsDown = $state(false);
|
2023-07-03 10:56:58 +01:00
|
|
|
|
2024-03-21 13:14:13 +01:00
|
|
|
const deselectAllAssets = () => {
|
2024-12-14 19:30:33 +01:00
|
|
|
cancelMultiselect(assetInteraction);
|
2024-03-21 13:14:13 +01:00
|
|
|
};
|
|
|
|
|
|
2024-03-15 17:01:35 +01:00
|
|
|
const onKeyDown = (event: KeyboardEvent) => {
|
2025-04-10 16:34:45 -04:00
|
|
|
if (searchStore.isSearchEnabled) {
|
2023-07-19 11:03:23 -05:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-21 13:14:13 +01:00
|
|
|
if (event.key === 'Shift') {
|
2024-03-15 17:01:35 +01:00
|
|
|
event.preventDefault();
|
2023-07-03 10:56:58 +01:00
|
|
|
shiftKeyIsDown = true;
|
|
|
|
|
}
|
|
|
|
|
};
|
2023-07-19 21:15:22 -05:00
|
|
|
|
2024-03-15 17:01:35 +01:00
|
|
|
const onKeyUp = (event: KeyboardEvent) => {
|
2025-04-10 16:34:45 -04:00
|
|
|
if (searchStore.isSearchEnabled) {
|
2023-07-19 11:03:23 -05:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-21 13:14:13 +01:00
|
|
|
if (event.key === 'Shift') {
|
2024-03-15 17:01:35 +01:00
|
|
|
event.preventDefault();
|
2023-07-03 10:56:58 +01:00
|
|
|
shiftKeyIsDown = false;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2025-05-17 22:57:08 -04:00
|
|
|
const handleSelectAssetCandidates = (asset: TimelineAsset | null) => {
|
2023-07-03 10:56:58 +01:00
|
|
|
if (asset) {
|
2025-05-28 09:55:14 -04:00
|
|
|
void selectAssetCandidates(asset);
|
2023-07-03 10:56:58 +01:00
|
|
|
}
|
|
|
|
|
lastAssetMouseEvent = asset;
|
|
|
|
|
};
|
|
|
|
|
|
2025-06-10 10:30:13 -04:00
|
|
|
const handleGroupSelect = (timelineManager: TimelineManager, group: string, assets: TimelineAsset[]) => {
|
2024-12-14 19:30:33 +01:00
|
|
|
if (assetInteraction.selectedGroup.has(group)) {
|
|
|
|
|
assetInteraction.removeGroupFromMultiselectGroup(group);
|
2023-08-11 12:00:51 -04:00
|
|
|
for (const asset of assets) {
|
2025-03-19 11:55:50 -04:00
|
|
|
assetInteraction.removeAssetFromMultiselectGroup(asset.id);
|
2023-08-11 12:00:51 -04:00
|
|
|
}
|
|
|
|
|
} else {
|
2024-12-14 19:30:33 +01:00
|
|
|
assetInteraction.addGroupToMultiselectGroup(group);
|
2023-08-11 12:00:51 -04:00
|
|
|
for (const asset of assets) {
|
|
|
|
|
handleSelectAsset(asset);
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-04-02 03:00:48 +08:00
|
|
|
|
2025-06-10 10:30:13 -04:00
|
|
|
if (timelineManager.assetCount == assetInteraction.selectedAssets.length) {
|
2025-04-02 03:00:48 +08:00
|
|
|
isSelectingAllAssets.set(true);
|
|
|
|
|
} else {
|
|
|
|
|
isSelectingAllAssets.set(false);
|
|
|
|
|
}
|
2023-08-11 12:00:51 -04:00
|
|
|
};
|
|
|
|
|
|
2025-05-17 22:57:08 -04:00
|
|
|
const handleSelectAssets = async (asset: TimelineAsset) => {
|
2023-07-12 05:12:19 +03:00
|
|
|
if (!asset) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2024-09-20 23:02:58 +02:00
|
|
|
onSelect(asset);
|
2023-08-05 09:58:52 -04:00
|
|
|
|
2025-05-28 09:55:14 -04:00
|
|
|
if (singleSelect) {
|
|
|
|
|
scrollTop(0);
|
2023-08-11 12:00:51 -04:00
|
|
|
return;
|
2023-08-05 09:58:52 -04:00
|
|
|
}
|
|
|
|
|
|
2025-03-19 11:55:50 -04:00
|
|
|
const rangeSelection = assetInteraction.assetSelectionCandidates.length > 0;
|
2025-03-18 10:14:46 -04:00
|
|
|
const deselect = assetInteraction.hasSelectedAsset(asset.id);
|
2023-07-12 05:12:19 +03:00
|
|
|
|
|
|
|
|
// Select/deselect already loaded assets
|
|
|
|
|
if (deselect) {
|
2024-12-14 19:30:33 +01:00
|
|
|
for (const candidate of assetInteraction.assetSelectionCandidates) {
|
2025-03-19 11:55:50 -04:00
|
|
|
assetInteraction.removeAssetFromMultiselectGroup(candidate.id);
|
2023-07-12 05:12:19 +03:00
|
|
|
}
|
2025-03-19 11:55:50 -04:00
|
|
|
assetInteraction.removeAssetFromMultiselectGroup(asset.id);
|
2023-07-12 05:12:19 +03:00
|
|
|
} else {
|
2024-12-14 19:30:33 +01:00
|
|
|
for (const candidate of assetInteraction.assetSelectionCandidates) {
|
2023-08-11 12:00:51 -04:00
|
|
|
handleSelectAsset(candidate);
|
2023-07-12 05:12:19 +03:00
|
|
|
}
|
2023-08-11 12:00:51 -04:00
|
|
|
handleSelectAsset(asset);
|
2023-07-12 05:12:19 +03:00
|
|
|
}
|
|
|
|
|
|
2024-12-14 19:30:33 +01:00
|
|
|
assetInteraction.clearAssetSelectionCandidates();
|
2023-07-12 05:12:19 +03:00
|
|
|
|
2024-12-14 19:30:33 +01:00
|
|
|
if (assetInteraction.assetSelectionStart && rangeSelection) {
|
2025-06-10 10:30:13 -04:00
|
|
|
let startBucket = timelineManager.getMonthGroupByAssetId(assetInteraction.assetSelectionStart.id);
|
|
|
|
|
let endBucket = timelineManager.getMonthGroupByAssetId(asset.id);
|
2023-08-02 21:57:11 -04:00
|
|
|
|
2025-03-18 10:14:46 -04:00
|
|
|
if (startBucket === null || endBucket === null) {
|
2023-08-02 21:57:11 -04:00
|
|
|
return;
|
|
|
|
|
}
|
2023-07-12 05:12:19 +03:00
|
|
|
|
2025-05-23 04:17:34 +08:00
|
|
|
// Select/deselect assets in range (start,end)
|
2025-03-18 10:14:46 -04:00
|
|
|
let started = false;
|
2025-06-10 10:30:13 -04:00
|
|
|
for (const monthGroup of timelineManager.months) {
|
|
|
|
|
if (monthGroup === endBucket) {
|
2025-03-18 10:14:46 -04:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (started) {
|
2025-06-10 10:30:13 -04:00
|
|
|
await timelineManager.loadMonthGroup(monthGroup.yearMonth);
|
|
|
|
|
for (const asset of monthGroup.assetsIterator()) {
|
2025-03-18 10:14:46 -04:00
|
|
|
if (deselect) {
|
2025-03-19 11:55:50 -04:00
|
|
|
assetInteraction.removeAssetFromMultiselectGroup(asset.id);
|
2025-03-18 10:14:46 -04:00
|
|
|
} else {
|
|
|
|
|
handleSelectAsset(asset);
|
|
|
|
|
}
|
2023-07-12 05:12:19 +03:00
|
|
|
}
|
|
|
|
|
}
|
2025-06-10 10:30:13 -04:00
|
|
|
if (monthGroup === startBucket) {
|
2025-05-23 04:17:34 +08:00
|
|
|
started = true;
|
|
|
|
|
}
|
2023-07-12 05:12:19 +03:00
|
|
|
}
|
|
|
|
|
|
2025-05-23 04:17:34 +08:00
|
|
|
// Update date group selection in range [start,end]
|
2025-03-18 10:14:46 -04:00
|
|
|
started = false;
|
2025-06-10 10:30:13 -04:00
|
|
|
for (const monthGroup of timelineManager.months) {
|
|
|
|
|
if (monthGroup === startBucket) {
|
2025-03-18 10:14:46 -04:00
|
|
|
started = true;
|
|
|
|
|
}
|
2025-05-23 04:17:34 +08:00
|
|
|
if (started) {
|
2025-06-10 10:30:13 -04:00
|
|
|
// Split month group into day groups and check each group
|
|
|
|
|
for (const dayGroup of monthGroup.dayGroups) {
|
|
|
|
|
const dayGroupTitle = dayGroup.groupTitle;
|
|
|
|
|
if (dayGroup.getAssets().every((a) => assetInteraction.hasSelectedAsset(a.id))) {
|
|
|
|
|
assetInteraction.addGroupToMultiselectGroup(dayGroupTitle);
|
2025-05-23 04:17:34 +08:00
|
|
|
} else {
|
2025-06-10 10:30:13 -04:00
|
|
|
assetInteraction.removeGroupFromMultiselectGroup(dayGroupTitle);
|
2025-05-23 04:17:34 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-06-10 10:30:13 -04:00
|
|
|
if (monthGroup === endBucket) {
|
2025-03-18 10:14:46 -04:00
|
|
|
break;
|
|
|
|
|
}
|
2023-07-12 05:12:19 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-14 19:30:33 +01:00
|
|
|
assetInteraction.setAssetSelectionStart(deselect ? null : asset);
|
2023-07-12 05:12:19 +03:00
|
|
|
};
|
|
|
|
|
|
2025-05-28 09:55:14 -04:00
|
|
|
const selectAssetCandidates = async (endAsset: TimelineAsset) => {
|
2023-07-03 10:56:58 +01:00
|
|
|
if (!shiftKeyIsDown) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-14 19:30:33 +01:00
|
|
|
const startAsset = assetInteraction.assetSelectionStart;
|
2024-11-14 08:43:25 -06:00
|
|
|
if (!startAsset) {
|
2023-07-03 10:56:58 +01:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-10 10:30:13 -04:00
|
|
|
const assets = assetsSnapshot(await timelineManager.retrieveRange(startAsset, endAsset));
|
2025-05-28 09:55:14 -04:00
|
|
|
assetInteraction.setAssetSelectionCandidates(assets);
|
2023-07-03 10:56:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const onSelectStart = (e: Event) => {
|
2024-12-14 19:30:33 +01:00
|
|
|
if (assetInteraction.selectionActive && shiftKeyIsDown) {
|
2023-07-03 10:56:58 +01:00
|
|
|
e.preventDefault();
|
|
|
|
|
}
|
|
|
|
|
};
|
2025-03-12 02:18:14 +11:00
|
|
|
|
2024-11-14 08:43:25 -06:00
|
|
|
let isTrashEnabled = $derived($featureFlags.loaded && $featureFlags.trash);
|
2025-06-10 10:30:13 -04:00
|
|
|
let isEmpty = $derived(timelineManager.isInitialized && timelineManager.months.length === 0);
|
2025-03-19 11:55:50 -04:00
|
|
|
let idsSelectedAssets = $derived(assetInteraction.selectedAssets.map(({ id }) => id));
|
2025-05-09 19:24:36 +02:00
|
|
|
let isShortcutModalOpen = false;
|
|
|
|
|
|
|
|
|
|
const handleOpenShortcutModal = async () => {
|
|
|
|
|
if (isShortcutModalOpen) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
isShortcutModalOpen = true;
|
2025-06-12 00:32:49 +02:00
|
|
|
await modalManager.show(ShortcutsModal);
|
2025-05-09 19:24:36 +02:00
|
|
|
isShortcutModalOpen = false;
|
|
|
|
|
};
|
2024-11-14 08:43:25 -06:00
|
|
|
|
|
|
|
|
$effect(() => {
|
|
|
|
|
if (isEmpty) {
|
2024-12-14 19:30:33 +01:00
|
|
|
assetInteraction.clearMultiselect();
|
2024-11-14 08:43:25 -06:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2025-06-10 10:30:13 -04:00
|
|
|
const setFocusTo = setFocusToInit.bind(undefined, scrollToAsset, timelineManager);
|
2025-05-28 09:55:14 -04:00
|
|
|
const setFocusAsset = setFocusAssetInit.bind(undefined, scrollToAsset);
|
|
|
|
|
|
2024-11-14 08:43:25 -06:00
|
|
|
let shortcutList = $derived(
|
|
|
|
|
(() => {
|
2025-04-10 16:34:45 -04:00
|
|
|
if (searchStore.isSearchEnabled || $showAssetViewer) {
|
2024-11-14 08:43:25 -06:00
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const shortcuts: ShortcutOptions[] = [
|
|
|
|
|
{ shortcut: { key: 'Escape' }, onShortcut: onEscape },
|
2025-05-09 19:24:36 +02:00
|
|
|
{ shortcut: { key: '?', shift: true }, onShortcut: handleOpenShortcutModal },
|
2024-11-14 08:43:25 -06:00
|
|
|
{ shortcut: { key: '/' }, onShortcut: () => goto(AppRoute.EXPLORE) },
|
2025-06-10 10:30:13 -04:00
|
|
|
{ shortcut: { key: 'A', ctrl: true }, onShortcut: () => selectAllAssets(timelineManager, assetInteraction) },
|
2025-05-28 09:55:14 -04:00
|
|
|
{ shortcut: { key: 'ArrowRight' }, onShortcut: () => setFocusTo('earlier', 'asset') },
|
|
|
|
|
{ shortcut: { key: 'ArrowLeft' }, onShortcut: () => setFocusTo('later', 'asset') },
|
|
|
|
|
{ shortcut: { key: 'D' }, onShortcut: () => setFocusTo('earlier', 'day') },
|
|
|
|
|
{ shortcut: { key: 'D', shift: true }, onShortcut: () => setFocusTo('later', 'day') },
|
|
|
|
|
{ shortcut: { key: 'M' }, onShortcut: () => setFocusTo('earlier', 'month') },
|
|
|
|
|
{ shortcut: { key: 'M', shift: true }, onShortcut: () => setFocusTo('later', 'month') },
|
|
|
|
|
{ shortcut: { key: 'Y' }, onShortcut: () => setFocusTo('earlier', 'year') },
|
|
|
|
|
{ shortcut: { key: 'Y', shift: true }, onShortcut: () => setFocusTo('later', 'year') },
|
|
|
|
|
{ shortcut: { key: 'G' }, onShortcut: () => (isShowSelectDate = true) },
|
2024-11-14 08:43:25 -06:00
|
|
|
];
|
|
|
|
|
|
2024-12-14 19:30:33 +01:00
|
|
|
if (assetInteraction.selectionActive) {
|
2024-11-14 08:43:25 -06:00
|
|
|
shortcuts.push(
|
|
|
|
|
{ shortcut: { key: 'Delete' }, onShortcut: onDelete },
|
|
|
|
|
{ shortcut: { key: 'Delete', shift: true }, onShortcut: onForceDelete },
|
|
|
|
|
{ shortcut: { key: 'D', ctrl: true }, onShortcut: () => deselectAllAssets() },
|
|
|
|
|
{ shortcut: { key: 's' }, onShortcut: () => onStackAssets() },
|
|
|
|
|
{ shortcut: { key: 'a', shift: true }, onShortcut: toggleArchive },
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return shortcuts;
|
|
|
|
|
})(),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$effect(() => {
|
|
|
|
|
if (!lastAssetMouseEvent) {
|
2024-12-14 19:30:33 +01:00
|
|
|
assetInteraction.clearAssetSelectionCandidates();
|
2024-11-14 08:43:25 -06:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$effect(() => {
|
|
|
|
|
if (!shiftKeyIsDown) {
|
2024-12-14 19:30:33 +01:00
|
|
|
assetInteraction.clearAssetSelectionCandidates();
|
2024-11-14 08:43:25 -06:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$effect(() => {
|
|
|
|
|
if (shiftKeyIsDown && lastAssetMouseEvent) {
|
2025-05-28 09:55:14 -04:00
|
|
|
void selectAssetCandidates(lastAssetMouseEvent);
|
2024-11-14 08:43:25 -06:00
|
|
|
}
|
|
|
|
|
});
|
2022-09-04 08:34:39 -05:00
|
|
|
</script>
|
|
|
|
|
|
2025-05-21 18:12:00 +02:00
|
|
|
<svelte:document onkeydown={onKeyDown} onkeyup={onKeyUp} onselectstart={onSelectStart} use:shortcuts={shortcutList} />
|
2023-07-03 10:56:58 +01:00
|
|
|
|
2024-01-17 20:18:04 +01:00
|
|
|
{#if isShowDeleteConfirmation}
|
|
|
|
|
<DeleteAssetDialog
|
|
|
|
|
size={idsSelectedAssets.length}
|
2024-09-20 23:02:58 +02:00
|
|
|
onCancel={() => (isShowDeleteConfirmation = false)}
|
|
|
|
|
onConfirm={() => handlePromiseError(trashOrDelete(true))}
|
2024-01-17 20:18:04 +01:00
|
|
|
/>
|
|
|
|
|
{/if}
|
|
|
|
|
|
2025-05-28 09:55:14 -04:00
|
|
|
{#if isShowSelectDate}
|
|
|
|
|
<ChangeDate
|
|
|
|
|
title="Navigate to Time"
|
|
|
|
|
initialDate={DateTime.now()}
|
|
|
|
|
timezoneInput={false}
|
|
|
|
|
onConfirm={async (dateString: string) => {
|
|
|
|
|
isShowSelectDate = false;
|
2025-06-10 10:30:13 -04:00
|
|
|
const asset = await timelineManager.getClosestAssetToDate(
|
|
|
|
|
(DateTime.fromISO(dateString) as DateTime<true>).toObject(),
|
|
|
|
|
);
|
2025-05-28 09:55:14 -04:00
|
|
|
if (asset) {
|
|
|
|
|
setFocusAsset(asset);
|
|
|
|
|
}
|
|
|
|
|
}}
|
|
|
|
|
onCancel={() => (isShowSelectDate = false)}
|
|
|
|
|
/>
|
|
|
|
|
{/if}
|
|
|
|
|
|
2025-06-10 10:30:13 -04:00
|
|
|
{#if timelineManager.months.length > 0}
|
2024-09-02 21:43:36 +02:00
|
|
|
<Scrubber
|
2025-06-10 10:30:13 -04:00
|
|
|
{timelineManager}
|
|
|
|
|
height={timelineManager.viewportHeight}
|
|
|
|
|
timelineTopOffset={timelineManager.topSectionHeight}
|
2024-09-02 21:43:36 +02:00
|
|
|
timelineBottomOffset={bottomSectionHeight}
|
|
|
|
|
{leadout}
|
|
|
|
|
{scrubOverallPercent}
|
2025-06-10 10:30:13 -04:00
|
|
|
{scrubberMonthPercent}
|
|
|
|
|
{scrubberMonth}
|
2024-09-02 21:43:36 +02:00
|
|
|
{onScrub}
|
2025-04-14 12:56:40 -04:00
|
|
|
bind:scrubberWidth
|
2025-03-18 10:14:46 -04:00
|
|
|
onScrubKeyDown={(evt) => {
|
|
|
|
|
evt.preventDefault();
|
|
|
|
|
let amount = 50;
|
|
|
|
|
if (shiftKeyIsDown) {
|
|
|
|
|
amount = 500;
|
|
|
|
|
}
|
|
|
|
|
if (evt.key === 'ArrowUp') {
|
|
|
|
|
amount = -amount;
|
|
|
|
|
if (shiftKeyIsDown) {
|
|
|
|
|
element?.scrollBy({ top: amount, behavior: 'smooth' });
|
|
|
|
|
}
|
|
|
|
|
} else if (evt.key === 'ArrowDown') {
|
|
|
|
|
element?.scrollBy({ top: amount, behavior: 'smooth' });
|
|
|
|
|
}
|
|
|
|
|
}}
|
2024-09-02 21:43:36 +02:00
|
|
|
/>
|
|
|
|
|
{/if}
|
2022-09-09 15:55:20 -05:00
|
|
|
|
2025-06-10 10:30:13 -04:00
|
|
|
<!-- Right margin MUST be equal to the width of scrubber -->
|
2022-09-04 08:34:39 -05:00
|
|
|
<section
|
2023-07-01 00:50:47 -04:00
|
|
|
id="asset-grid"
|
2025-04-28 09:53:53 -04:00
|
|
|
class={['scrollbar-hidden h-full overflow-y-auto outline-none', { 'm-0': isEmpty }, { 'ms-0': !isEmpty }]}
|
2025-04-14 12:56:40 -04:00
|
|
|
style:margin-right={(usingMobileDevice ? 0 : scrubberWidth) + 'px'}
|
2024-05-24 15:11:55 -05:00
|
|
|
tabindex="-1"
|
2025-06-10 10:30:13 -04:00
|
|
|
bind:clientHeight={timelineManager.viewportHeight}
|
|
|
|
|
bind:clientWidth={null, (v) => ((timelineManager.viewportWidth = v), updateSlidingWindow())}
|
2023-08-03 14:20:41 -04:00
|
|
|
bind:this={element}
|
2025-03-18 10:14:46 -04:00
|
|
|
onscroll={() => (handleTimelineScroll(), updateSlidingWindow(), updateIsScrolling())}
|
2022-09-04 08:34:39 -05:00
|
|
|
>
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
<section
|
|
|
|
|
bind:this={timelineElement}
|
|
|
|
|
id="virtual-timeline"
|
|
|
|
|
class:invisible={showSkeleton}
|
2025-06-10 10:30:13 -04:00
|
|
|
style:height={timelineManager.timelineHeight + 'px'}
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
>
|
2025-03-18 10:14:46 -04:00
|
|
|
<section
|
|
|
|
|
use:resizeObserver={topSectionResizeObserver}
|
|
|
|
|
class:invisible={showSkeleton}
|
|
|
|
|
style:position="absolute"
|
|
|
|
|
style:left="0"
|
|
|
|
|
style:right="0"
|
|
|
|
|
>
|
|
|
|
|
{@render children?.()}
|
|
|
|
|
{#if isEmpty}
|
|
|
|
|
<!-- (optional) empty placeholder -->
|
|
|
|
|
{@render empty?.()}
|
|
|
|
|
{/if}
|
|
|
|
|
</section>
|
|
|
|
|
|
2025-06-10 10:30:13 -04:00
|
|
|
{#each timelineManager.months as monthGroup (monthGroup.viewId)}
|
|
|
|
|
{@const display = monthGroup.intersecting}
|
|
|
|
|
{@const absoluteHeight = monthGroup.top}
|
2025-03-18 10:14:46 -04:00
|
|
|
|
2025-06-10 10:30:13 -04:00
|
|
|
{#if !monthGroup.isLoaded}
|
2025-03-18 10:14:46 -04:00
|
|
|
<div
|
2025-06-10 10:30:13 -04:00
|
|
|
style:height={monthGroup.height + 'px'}
|
2025-03-18 10:14:46 -04:00
|
|
|
style:position="absolute"
|
|
|
|
|
style:transform={`translate3d(0,${absoluteHeight}px,0)`}
|
|
|
|
|
style:width="100%"
|
|
|
|
|
>
|
2025-06-10 10:30:13 -04:00
|
|
|
<Skeleton
|
|
|
|
|
height={monthGroup.height - monthGroup.timelineManager.headerHeight}
|
|
|
|
|
title={monthGroup.monthGroupTitle}
|
|
|
|
|
/>
|
2025-03-18 10:14:46 -04:00
|
|
|
</div>
|
|
|
|
|
{:else if display}
|
|
|
|
|
<div
|
2025-06-10 10:30:13 -04:00
|
|
|
class="month-group"
|
|
|
|
|
style:height={monthGroup.height + 'px'}
|
2025-03-18 10:14:46 -04:00
|
|
|
style:position="absolute"
|
|
|
|
|
style:transform={`translate3d(0,${absoluteHeight}px,0)`}
|
|
|
|
|
style:width="100%"
|
|
|
|
|
>
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
<AssetDateGroup
|
|
|
|
|
{withStacked}
|
|
|
|
|
{showArchiveIcon}
|
2024-12-14 19:30:33 +01:00
|
|
|
{assetInteraction}
|
2025-06-10 10:30:13 -04:00
|
|
|
{timelineManager}
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
{isSelectionMode}
|
|
|
|
|
{singleSelect}
|
2025-06-10 10:30:13 -04:00
|
|
|
{monthGroup}
|
|
|
|
|
onSelect={({ title, assets }) => handleGroupSelect(timelineManager, title, assets)}
|
2024-09-20 23:02:58 +02:00
|
|
|
onSelectAssetCandidates={handleSelectAssetCandidates}
|
|
|
|
|
onSelectAssets={handleSelectAssets}
|
2025-05-28 09:55:14 -04:00
|
|
|
onScrollCompensation={handleScrollCompensation}
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
/>
|
2025-03-18 10:14:46 -04:00
|
|
|
</div>
|
|
|
|
|
{/if}
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
{/each}
|
2025-04-14 12:56:40 -04:00
|
|
|
<!-- spacer for leadout -->
|
|
|
|
|
<div
|
|
|
|
|
class="h-[60px]"
|
|
|
|
|
style:position="absolute"
|
|
|
|
|
style:left="0"
|
|
|
|
|
style:right="0"
|
2025-06-10 10:30:13 -04:00
|
|
|
style:transform={`translate3d(0,${timelineManager.timelineHeight}px,0)`}
|
2025-04-14 12:56:40 -04:00
|
|
|
></div>
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
</section>
|
2022-09-04 08:34:39 -05:00
|
|
|
</section>
|
|
|
|
|
|
2025-05-05 04:58:44 +02:00
|
|
|
{#if !albumMapViewManager.isInMapView}
|
|
|
|
|
<Portal target="body">
|
|
|
|
|
{#if $showAssetViewer}
|
|
|
|
|
{#await import('../asset-viewer/asset-viewer.svelte') then { default: AssetViewer }}
|
|
|
|
|
<AssetViewer
|
|
|
|
|
{withStacked}
|
|
|
|
|
asset={$viewingAsset}
|
|
|
|
|
preloadAssets={$preloadAssets}
|
|
|
|
|
{isShared}
|
|
|
|
|
{album}
|
|
|
|
|
{person}
|
|
|
|
|
preAction={handlePreAction}
|
|
|
|
|
onAction={handleAction}
|
|
|
|
|
onPrevious={handlePrevious}
|
|
|
|
|
onNext={handleNext}
|
|
|
|
|
onRandom={handleRandom}
|
|
|
|
|
onClose={handleClose}
|
|
|
|
|
/>
|
|
|
|
|
{/await}
|
|
|
|
|
{/if}
|
|
|
|
|
</Portal>
|
|
|
|
|
{/if}
|
2022-09-04 08:34:39 -05:00
|
|
|
|
|
|
|
|
<style>
|
2023-07-01 00:50:47 -04:00
|
|
|
#asset-grid {
|
feat(web): Scroll to asset in gridview; increase gridview perf; reduce memory; scrollbar ticks in fixed position (#10646)
* Squashed
* Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation
* Reduce jank on scroll, delay DOM updates until after scroll
* css opt, log measure time
* Trickle out queue while scrolling, flush when stopped
* yay
* Cleanup cleanup...
* everybody...
* everywhere...
* Clean up cleanup!
* Everybody do their share
* CLEANUP!
* package-lock ?
* dynamic measure, todo
* Fix web test
* type lint
* fix e2e
* e2e test
* Better scrollbar
* Tuning, and more tunables
* Tunable tweaks, more tunables
* Scrollbar dots and viewport events
* lint
* Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes
* New tunables, and don't update url by default
* Bug fixes
* Bug fix, with debug
* Fix flickr, fix graybox bug, reduced debug
* Refactor/cleanup
* Fix
* naming
* Final cleanup
* review comment
* Forgot to update this after naming change
* scrubber works, with debug
* cleanup
* Rename scrollbar to scrubber
* rename to
* left over rename and change to previous album bar
* bugfix addassets, comments
* missing destroy(), cleanup
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
2024-08-21 22:15:21 -04:00
|
|
|
contain: strict;
|
2023-07-01 00:50:47 -04:00
|
|
|
scrollbar-width: none;
|
|
|
|
|
}
|
2024-11-19 11:30:07 -06:00
|
|
|
|
2025-06-10 10:30:13 -04:00
|
|
|
.month-group {
|
2025-03-18 10:14:46 -04:00
|
|
|
contain: layout size paint;
|
|
|
|
|
transform-style: flat;
|
|
|
|
|
backface-visibility: hidden;
|
|
|
|
|
transform-origin: center center;
|
2024-11-19 11:30:07 -06:00
|
|
|
}
|
2022-09-04 08:34:39 -05:00
|
|
|
</style>
|