From 91a874152ee5c835f79d3a9addea684c34ee5131 Mon Sep 17 00:00:00 2001 From: wendrul <53628737+wendrul@users.noreply.github.com> Date: Fri, 4 Jul 2025 20:13:58 +0900 Subject: [PATCH] fix: ctrl k not showing navigation items + improve ai button by making it an item in the menu (#6132) * Fix missing navigation after migration to svelte 5 of ctrl k search .includes doesn't work anymore because the items inside the array are treated as state, and thus svelte wraps them with a Proxy thing * Change ask ai to be a menu item * Remove comment --- .../search/GlobalSearchModal.svelte | 46 +++++++++++-------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/frontend/src/lib/components/search/GlobalSearchModal.svelte b/frontend/src/lib/components/search/GlobalSearchModal.svelte index 422d3ba7e1..2a36576dfd 100644 --- a/frontend/src/lib/components/search/GlobalSearchModal.svelte +++ b/frontend/src/lib/components/search/GlobalSearchModal.svelte @@ -25,7 +25,8 @@ Route, Search, SearchCode, - Unplug + Unplug, + WandSparkles } from 'lucide-svelte' import Portal from '$lib/components/Portal.svelte' @@ -293,8 +294,7 @@ } if (tab === 'default') { - if (searchTerm === '') - itemMap['default'] = fuzzyFilter(searchTerm, defaultMenuItems, defaultMenuItemLabels) + if (searchTerm === '') itemMap['default'] = defaultMenuItems else itemMap['default'] = fuzzyFilter( searchTerm, @@ -372,9 +372,6 @@ } } } - if ((itemMap[tab] ?? []).length === 0 && searchTerm.length > 0 && event.key === 'Enter') { - askAiButton?.onClick() - } } } @@ -653,10 +650,14 @@