mirror of
https://github.com/immich-app/immich.git
synced 2025-07-03 21:40:00 +02:00
feat: timeline performance (#16446)
* 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:
parent
dd263b010c
commit
e96ffd43e7
48 changed files with 2318 additions and 2764 deletions
web/src/lib/components/assets/thumbnail
|
@ -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'}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue