feat: timeline performance ()

* Squash - feature complete

* remove need to init assetstore

* More optimizations. No need to init. Fix tests

* lint

* add missing selector for e2e

* e2e selectors again

* Update: fully reactive store, some transitions, bugfixes

* merge fallout

* Test fallout

* safari quirk

* security

* lint

* lint

* Bug fixes

* lint/format

* accidental commit

* lock

* null check, more throttle

* revert long duration

* Fix intersection bounds

* Fix bugs in intersection calculation

* lint, tweak scrubber ui a tiny bit

* bugfix - deselecting asset doesnt work

* fix not loading bucket, scroll off-by-1 error, jsdoc, naming
This commit is contained in:
Min Idzelis 2025-03-18 10:14:46 -04:00 committed by GitHub
parent dd263b010c
commit e96ffd43e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
48 changed files with 2318 additions and 2764 deletions
web/src/lib/components/assets/thumbnail

View file

@ -4,7 +4,6 @@
import Icon from '$lib/components/elements/icon.svelte';
import { TUNABLES } from '$lib/utils/tunables';
import { mdiEyeOffOutline } from '@mdi/js';
import { onMount } from 'svelte';
import { fade } from 'svelte/transition';
interface Props {
@ -37,7 +36,6 @@
circle = false,
hidden = false,
border = false,
preload = true,
hiddenIconClass = 'text-white',
onComplete = undefined,
}: Props = $props();
@ -49,8 +47,6 @@
let loaded = $state(false);
let errored = $state(false);
let img = $state<HTMLImageElement>();
const setLoaded = () => {
loaded = true;
onComplete?.();
@ -59,11 +55,13 @@
errored = true;
onComplete?.();
};
onMount(() => {
if (img?.complete) {
setLoaded();
function mount(elem: HTMLImageElement) {
if (elem.complete) {
loaded = true;
onComplete?.();
}
});
}
let optionalClasses = $derived(
[
@ -82,10 +80,9 @@
<BrokenAsset class={optionalClasses} width={widthStyle} height={heightStyle} />
{:else}
<img
bind:this={img}
use:mount
onload={setLoaded}
onerror={setErrored}
loading={preload ? 'eager' : 'lazy'}
style:width={widthStyle}
style:height={heightStyle}
style:filter={hidden ? 'grayscale(50%)' : 'none'}