diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 7d5659479..b20857dd0 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -36,7 +36,8 @@ chatTitle, showArtifacts, tools, - toolServers + toolServers, + showChatSearch } from '$lib/stores'; import { convertMessagesToHistory, @@ -89,6 +90,7 @@ import Placeholder from './Placeholder.svelte'; import NotificationToast from '../NotificationToast.svelte'; import Spinner from '../common/Spinner.svelte'; + import ChatSearch from './ChatSearch.svelte'; import { fade } from 'svelte/transition'; export let chatIdProp = ''; @@ -2231,4 +2233,12 @@ {/if} + + + { + showChatSearch.set(false); + }} + /> diff --git a/src/lib/components/chat/ChatSearch.svelte b/src/lib/components/chat/ChatSearch.svelte new file mode 100644 index 000000000..bc83a85ab --- /dev/null +++ b/src/lib/components/chat/ChatSearch.svelte @@ -0,0 +1,149 @@ + + +{#if show} + + +{/if} + + \ No newline at end of file diff --git a/src/lib/stores/index.ts b/src/lib/stores/index.ts index 38905dd6d..a555a3726 100644 --- a/src/lib/stores/index.ts +++ b/src/lib/stores/index.ts @@ -66,6 +66,7 @@ export const settings: Writable = writable({}); export const showSidebar = writable(false); export const showSearch = writable(false); +export const showChatSearch = writable(false); export const showSettings = writable(false); export const showArchivedChats = writable(false); export const showChangelog = writable(false); diff --git a/src/routes/(app)/+layout.svelte b/src/routes/(app)/+layout.svelte index 786c6a987..10a08dfd0 100644 --- a/src/routes/(app)/+layout.svelte +++ b/src/routes/(app)/+layout.svelte @@ -37,7 +37,8 @@ showChangelog, temporaryChatEnabled, toolServers, - showSearch + showSearch, + showChatSearch } from '$lib/stores'; import Sidebar from '$lib/components/layout/Sidebar.svelte'; @@ -129,6 +130,16 @@ showSearch.set(!$showSearch); } + // Check if Ctrl + F is pressed (Chat Search) + if (isCtrlPressed && event.key.toLowerCase() === 'f') { + // Only trigger in chat pages, not globally + if (window.location.pathname.startsWith('/c/') || window.location.pathname === '/') { + event.preventDefault(); + console.log('chatSearch'); + showChatSearch.set(!$showChatSearch); + } + } + // Check if Ctrl + Shift + O is pressed if (isCtrlPressed && isShiftPressed && event.key.toLowerCase() === 'o') { event.preventDefault();