+
+
{#if shortcut.tooltip}
-
- {$i18n.t(shortcut.name)} *
+
+ {$i18n.t(shortcut.name)}
+ *
{:else}
- {$i18n.t(shortcut.name)}
+ {$i18n.t(shortcut.name)}
{/if}
-
- {#each shortcut.keys.filter((key) => !(key.toLowerCase() === 'delete' && shortcut.keys.includes('Backspace'))) as key}
-
- {formatKey(key)}
-
- {/each}
-
+
+ {formatKeys(shortcut.keys)}
+
diff --git a/src/lib/components/chat/ShortcutsModal.svelte b/src/lib/components/chat/ShortcutsModal.svelte
deleted file mode 100644
index f2193728e9..0000000000
--- a/src/lib/components/chat/ShortcutsModal.svelte
+++ /dev/null
@@ -1,135 +0,0 @@
-
-
-
-
-
-
{$i18n.t('Keyboard Shortcuts')}
-
-
-
- {#each Object.entries(categorizedShortcuts) as [category, items], categoryIndex}
- {#if categoryIndex > 0}
-
- {/if}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {#each items as shortcut}
-
-
-
- {/each}
-
-
-
- {/each}
-
-
-
-
diff --git a/src/lib/components/layout/Sidebar/UserMenu.svelte b/src/lib/components/layout/Sidebar/UserMenu.svelte
index 3297d917ba..ad43d01faf 100644
--- a/src/lib/components/layout/Sidebar/UserMenu.svelte
+++ b/src/lib/components/layout/Sidebar/UserMenu.svelte
@@ -7,15 +7,7 @@
import { getUsage } from '$lib/apis';
import { getSessionUser, userSignOut } from '$lib/apis/auths';
- import {
- showSettings,
- mobile,
- showSidebar,
- showShortcuts,
- user,
- config,
- settings
- } from '$lib/stores';
+ import { showSettings, mobile, showSidebar, user, config, settings } from '$lib/stores';
import { WEBUI_API_BASE_URL } from '$lib/constants';
@@ -25,7 +17,6 @@
import QuestionMarkCircle from '$lib/components/icons/QuestionMarkCircle.svelte';
import Map from '$lib/components/icons/Map.svelte';
import Keyboard from '$lib/components/icons/Keyboard.svelte';
- import ShortcutsModal from '$lib/components/chat/ShortcutsModal.svelte';
import Settings from '$lib/components/icons/Settings.svelte';
import Code from '$lib/components/icons/Code.svelte';
import UserGroup from '$lib/components/icons/UserGroup.svelte';
@@ -109,7 +100,6 @@
}}
/>
-
{
@@ -546,7 +536,7 @@
id="chat-share-button"
on:click={async () => {
show = false;
- showShortcuts.set(!$showShortcuts);
+ showSettings.set('shortcuts');
if ($mobile) {
await tick();
diff --git a/src/lib/stores/index.ts b/src/lib/stores/index.ts
index 7ba3fd54b5..76b43ff224 100644
--- a/src/lib/stores/index.ts
+++ b/src/lib/stores/index.ts
@@ -92,7 +92,6 @@ export const sidebarWidth = writable(245);
export const showSidebar = writable(false);
export const showSearch = writable(false);
export const showSettings: Writable = writable(false);
-export const showShortcuts = writable(false);
export const showChangelog = writable(false);
export const showControls = writable(false);
diff --git a/src/routes/(app)/+layout.svelte b/src/routes/(app)/+layout.svelte
index e3509ba96e..5fe727196a 100644
--- a/src/routes/(app)/+layout.svelte
+++ b/src/routes/(app)/+layout.svelte
@@ -30,7 +30,6 @@
tags,
banners,
showSettings,
- showShortcuts,
showChangelog,
temporaryChatEnabled,
toolServers,
@@ -281,12 +280,11 @@
} else if (isShortcutMatch(event, shortcuts[Shortcut.SHOW_SHORTCUTS])) {
console.log('Shortcut triggered: SHOW_SHORTCUTS');
event.preventDefault();
- showShortcuts.set(!$showShortcuts);
+ showSettings.set('shortcuts');
} else if (isShortcutMatch(event, shortcuts[Shortcut.CLOSE_MODAL])) {
console.log('Shortcut triggered: CLOSE_MODAL');
event.preventDefault();
showSettings.set(false);
- showShortcuts.set(false);
} else if (isShortcutMatch(event, shortcuts[Shortcut.OPEN_MODEL_SELECTOR])) {
console.log('Shortcut triggered: OPEN_MODEL_SELECTOR');
event.preventDefault();