High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
feat(web): tag shortcut (#18711)
Daimoleane9f8d68f6201
diff --git a/web/src/lib/components/asset-viewer/detail-panel-tags.svelte b/web/src/lib/components/asset-viewer/detail-panel-tags.svelteindex 5da6324528..8cef6c88fd 100644--- a/web/src/lib/components/asset-viewer/detail-panel-tags.svelte+++ b/web/src/lib/components/asset-viewer/detail-panel-tags.svelte@@ -1,4 +1,5 @@<script lang="ts">+ import { shortcut } from '$lib/actions/shortcut';import Icon from '$lib/components/elements/icon.svelte';import TagAssetForm from '$lib/components/forms/tag-asset-form.svelte';import Portal from '$lib/components/shared-components/portal/portal.svelte';@@ -41,6 +42,8 @@};</script>+<svelte:document use:shortcut={{ shortcut: { key: 't' }, onShortcut: () => (isOpen = true) }} />+{#if isOwner && !authManager.key}<section class="px-4 mt-4"><div class="flex h-10 w-full items-center justify-between text-sm">diff --git a/web/src/lib/components/photos-page/actions/tag-action.svelte b/web/src/lib/components/photos-page/actions/tag-action.svelteindex 32cdaec16a..7d511a67f9 100644--- a/web/src/lib/components/photos-page/actions/tag-action.svelte+++ b/web/src/lib/components/photos-page/actions/tag-action.svelte@@ -1,11 +1,12 @@<script lang="ts">+ import { shortcut } from '$lib/actions/shortcut';import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';+ import TagAssetForm from '$lib/components/forms/tag-asset-form.svelte';import { tagAssets } from '$lib/utils/asset-utils';import { mdiTagMultipleOutline, mdiTimerSand } from '@mdi/js';import { t } from 'svelte-i18n';import MenuOption from '../../shared-components/context-menu/menu-option.svelte';import { getAssetControlContext } from '../asset-select-control-bar.svelte';- import TagAssetForm from '$lib/components/forms/tag-asset-form.svelte';interface Props {menuItem?: boolean;@@ -34,6 +35,8 @@};</script>+<svelte:document use:shortcut={{ shortcut: { key: 't' }, onShortcut: () => (isOpen = true) }} />+{#if menuItem}<MenuOption {text} {icon} onClick={handleOpen} />{/if}diff --git a/web/src/lib/modals/ShortcutsModal.svelte b/web/src/lib/modals/ShortcutsModal.svelteindex dc355d42f1..c13d245107 100644--- a/web/src/lib/modals/ShortcutsModal.svelte+++ b/web/src/lib/modals/ShortcutsModal.svelte@@ -38,6 +38,7 @@{ key: ['i'], action: $t('show_or_hide_info') },{ key: ['s'], action: $t('stack_selected_photos') },{ key: ['l'], action: $t('add_to_album') },+ { key: ['t'], action: $t('tag_assets') },{ key: ['⇧', 'l'], action: $t('add_to_shared_album') },{ key: ['⇧', 'a'], action: $t('archive_or_unarchive_photo') },{ key: ['⇧', 'd'], action: $t('download') },