From c2b41d72bf9b61e7ecbabf6172853d93f3f40f95 Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Sat, 28 Mar 2026 11:45:53 +0000 Subject: [PATCH] better sort --- .../src/features/editor/components/slash-menu/menu-items.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/client/src/features/editor/components/slash-menu/menu-items.ts b/apps/client/src/features/editor/components/slash-menu/menu-items.ts index 7205874d..73b7cc27 100644 --- a/apps/client/src/features/editor/components/slash-menu/menu-items.ts +++ b/apps/client/src/features/editor/components/slash-menu/menu-items.ts @@ -682,7 +682,11 @@ export const getSuggestionItems = ({ }); if (filteredItems.length) { - filteredGroups[group] = filteredItems; + filteredGroups[group] = filteredItems.sort((a, b) => { + const aTitle = a.title.toLowerCase().includes(search) ? 0 : 1; + const bTitle = b.title.toLowerCase().includes(search) ? 0 : 1; + return aTitle - bTitle; + }); } }