mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat(web): add keyboard shortcut to stack selected photos (#5983)
* feat(web): add keyboard shortcut to stack selected photos * refactor(web): deduplicate logic to stack assets * Fix linting errors * fix(web): incorrect count of stacked photos * chore: cleanup --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
parent
7cc19b50fc
commit
28e8e539f6
4 changed files with 53 additions and 43 deletions
|
|
@ -18,6 +18,7 @@
|
|||
import Scrollbar from '../shared-components/scrollbar/scrollbar.svelte';
|
||||
import ShowShortcuts from '../shared-components/show-shortcuts.svelte';
|
||||
import AssetDateGroup from './asset-date-group.svelte';
|
||||
import { stackAssets } from '$lib/utils/asset-utils';
|
||||
import DeleteAssetDialog from './delete-asset-dialog.svelte';
|
||||
import { handlePromiseError } from '$lib/utils';
|
||||
import { selectAllAssets } from '$lib/utils/asset-utils';
|
||||
|
|
@ -85,6 +86,13 @@
|
|||
handlePromiseError(trashOrDelete(true));
|
||||
};
|
||||
|
||||
const onStackAssets = async () => {
|
||||
await stackAssets(Array.from($selectedAssets), (ids) => {
|
||||
assetStore.removeAssets(ids);
|
||||
dispatch('escape');
|
||||
});
|
||||
};
|
||||
|
||||
$: shortcutList = (() => {
|
||||
if ($isSearchEnabled || $showAssetViewer) {
|
||||
return [];
|
||||
|
|
@ -102,6 +110,7 @@
|
|||
{ shortcut: { key: 'Delete' }, onShortcut: onDelete },
|
||||
{ shortcut: { key: 'Delete', shift: true }, onShortcut: onForceDelete },
|
||||
{ shortcut: { key: 'D', ctrl: true }, onShortcut: () => deselectAllAssets() },
|
||||
{ shortcut: { key: 's' }, onShortcut: () => onStackAssets() },
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue