1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2024-12-28 22:51:59 +00:00

feat(web): add keyboard shortcuts to duplicates utility (#10736)

SHIFT + K: Select keep all
SHIFT + T: Select trash all
SHIFT + C: Confirm selection
This commit is contained in:
Harshith Goka 2024-07-02 19:32:53 +09:00 committed by GitHub
parent 9a83038728
commit 7bfa642fa3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,6 +5,7 @@
import DuplicateAsset from '$lib/components/utilities-page/duplicates/duplicate-asset.svelte';
import { assetViewingStore } from '$lib/stores/asset-viewing.store';
import { suggestDuplicateByFileSize } from '$lib/utils';
import { shortcuts } from '$lib/actions/shortcut';
import { type AssetResponseDto } from '@immich/sdk';
import { mdiCheck, mdiTrashCanOutline } from '@mdi/js';
import { onDestroy, onMount } from 'svelte';
@ -61,6 +62,14 @@
};
</script>
<svelte:window
use:shortcuts={[
{ shortcut: { key: 'k', shift: true }, onShortcut: onSelectAll },
{ shortcut: { key: 't', shift: true }, onShortcut: onSelectNone },
{ shortcut: { key: 'c', shift: true }, onShortcut: handleResolve },
]}
/>
<div class="pt-4 rounded-3xl border dark:border-2 border-gray-300 dark:border-gray-700 max-w-[54rem] mx-auto mb-16">
<div class="flex flex-wrap gap-1 place-items-center place-content-center px-4 pt-4">
{#each assets as asset (asset.id)}