diff --git a/web/src/lib/components/photos-page/asset-grid.svelte b/web/src/lib/components/photos-page/asset-grid.svelte index 5b48f0494f..ba021b8ad1 100644 --- a/web/src/lib/components/photos-page/asset-grid.svelte +++ b/web/src/lib/components/photos-page/asset-grid.svelte @@ -1,33 +1,34 @@ - - -
- {#if shortcuts.general.length > 0} -
-

{$t('general')}

-
- {#each shortcuts.general as shortcut (shortcut.key.join('-'))} -
-
- {#each shortcut.key as key (key)} -

- {key} -

- {/each} -
-

{shortcut.action}

-
- {/each} -
-
- {/if} - {#if shortcuts.actions.length > 0} -
-

{$t('actions')}

-
- {#each shortcuts.actions as shortcut (shortcut.key.join('-'))} -
-
- {#each shortcut.key as key (key)} -

- {key} -

- {/each} -
-
-

{shortcut.action}

- {#if shortcut.info} - - {/if} -
-
- {/each} -
-
- {/if} -
-
diff --git a/web/src/lib/modals/ShortcutsModal.svelte b/web/src/lib/modals/ShortcutsModal.svelte new file mode 100644 index 0000000000..2f16eaa817 --- /dev/null +++ b/web/src/lib/modals/ShortcutsModal.svelte @@ -0,0 +1,100 @@ + + + + +
+ {#if shortcuts.general.length > 0} +
+

{$t('general')}

+
+ {#each shortcuts.general as shortcut (shortcut.key.join('-'))} +
+
+ {#each shortcut.key as key (key)} +

+ {key} +

+ {/each} +
+

{shortcut.action}

+
+ {/each} +
+
+ {/if} + {#if shortcuts.actions.length > 0} +
+

{$t('actions')}

+
+ {#each shortcuts.actions as shortcut (shortcut.key.join('-'))} +
+
+ {#each shortcut.key as key (key)} +

+ {key} +

+ {/each} +
+
+

{shortcut.action}

+ {#if shortcut.info} + + {/if} +
+
+ {/each} +
+
+ {/if} +
+
+
diff --git a/web/src/routes/(user)/user-settings/+page.svelte b/web/src/routes/(user)/user-settings/+page.svelte index 54d54f5b40..028941cdd6 100644 --- a/web/src/routes/(user)/user-settings/+page.svelte +++ b/web/src/routes/(user)/user-settings/+page.svelte @@ -1,19 +1,18 @@ @@ -21,7 +20,7 @@ (isShowKeyboardShortcut = !isShowKeyboardShortcut)} + onclick={() => modalManager.show(ShortcutsModal, {})} /> {/snippet}
@@ -30,7 +29,3 @@
- -{#if isShowKeyboardShortcut} - (isShowKeyboardShortcut = false)} /> -{/if} diff --git a/web/src/routes/(user)/utilities/duplicates/[[photos=photos]]/[[assetId=id]]/+page.svelte b/web/src/routes/(user)/utilities/duplicates/[[photos=photos]]/[[assetId=id]]/+page.svelte index 6c21260f99..14b1420110 100644 --- a/web/src/routes/(user)/utilities/duplicates/[[photos=photos]]/[[assetId=id]]/+page.svelte +++ b/web/src/routes/(user)/utilities/duplicates/[[photos=photos]]/[[assetId=id]]/+page.svelte @@ -7,8 +7,9 @@ NotificationType, notificationController, } from '$lib/components/shared-components/notification/notification'; - import ShowShortcuts from '$lib/components/shared-components/show-shortcuts.svelte'; import DuplicatesCompareControl from '$lib/components/utilities-page/duplicates/duplicates-compare-control.svelte'; + import { modalManager } from '$lib/managers/modal-manager.svelte'; + import ShortcutsModal from '$lib/modals/ShortcutsModal.svelte'; import { locale } from '$lib/stores/preferences.store'; import { featureFlags } from '$lib/stores/server-config.store'; import { stackAssets } from '$lib/utils/asset-utils'; @@ -27,7 +28,6 @@ let { data = $bindable() }: Props = $props(); - let isShowKeyboardShortcut = $state(false); let isShowDuplicateInfo = $state(false); interface Shortcuts { @@ -185,7 +185,7 @@ color="secondary" icon={mdiKeyboard} title={$t('show_keyboard_shortcuts')} - onclick={() => (isShowKeyboardShortcut = !isShowKeyboardShortcut)} + onclick={() => modalManager.show(ShortcutsModal, { shortcuts: duplicateShortcuts })} aria-label={$t('show_keyboard_shortcuts')} /> @@ -222,9 +222,6 @@ -{#if isShowKeyboardShortcut} - (isShowKeyboardShortcut = false)} /> -{/if} {#if isShowDuplicateInfo} (isShowDuplicateInfo = false)} /> {/if}