feat(web): tag shortcut (#18711)

* feat(web): tag shortcut

* fix: lint
This commit is contained in:
Daimolean 2025-05-28 22:42:04 +08:00 committed by GitHub
parent 3f08768854
commit e9f8d68f62
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 1 deletions

View File

@ -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">

View File

@ -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}

View File

@ -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') },