diff --git a/core/context/providers/DocsContextProvider.ts b/core/context/providers/DocsContextProvider.ts index 46d563e9f..6e5fd7e5f 100644 --- a/core/context/providers/DocsContextProvider.ts +++ b/core/context/providers/DocsContextProvider.ts @@ -24,7 +24,6 @@ class DocsContextProvider extends BaseContextProvider { extras: ContextProviderExtras, ): Promise { const { retrieveDocs } = await import("../../indexing/docs/db"); - const embeddingsProvider = new TransformersJsEmbeddingsProvider(); const [vector] = await embeddingsProvider.embed([extras.fullInput]); @@ -102,6 +101,23 @@ class DocsContextProvider extends BaseContextProvider { id: config.startUrl, })), ); + + // Sort submenuItems such that the objects with titles which don't occur in configs occur first, and alphabetized + submenuItems.sort((a, b) => { + const aTitleInConfigs = !!configs.find(config => config.title === a.title); + const bTitleInConfigs = !!configs.find(config => config.title === b.title); + + // Primary criterion: Items not in configs come first + if (!aTitleInConfigs && bTitleInConfigs) { + return -1; + } else if (aTitleInConfigs && !bTitleInConfigs) { + return 1; + } else { + // Secondary criterion: Alphabetical order when both items are in the same category + return a.title.localeCompare(b.title); + } + }); + return submenuItems; } } diff --git a/core/indexing/docs/preIndexedDocs.ts b/core/indexing/docs/preIndexedDocs.ts index a09e1e1cf..1a1d9ecbb 100644 --- a/core/indexing/docs/preIndexedDocs.ts +++ b/core/indexing/docs/preIndexedDocs.ts @@ -226,6 +226,11 @@ const configs: SiteIndexingConfig[] = [ startUrl: "https://developer.wordpress.org/reference/", rootUrl: "https://developer.wordpress.org/reference/", }, + { + title: "PySide6", + startUrl: "https://doc.qt.io/qtforpython-6/quickstart.html", + rootUrl: "https://doc.qt.io/qtforpython-6/api.html", + }, ]; export default configs; diff --git a/gui/src/components/mainInput/MentionList.tsx b/gui/src/components/mainInput/MentionList.tsx index ba6e23f3c..3e8a9417e 100644 --- a/gui/src/components/mainInput/MentionList.tsx +++ b/gui/src/components/mainInput/MentionList.tsx @@ -108,6 +108,8 @@ const ItemsDiv = styled.div` 0px 10px 20px rgba(0, 0, 0, 0.1); font-size: 0.9rem; overflow-x: hidden; + overflow-y: auto; + max-height: 330px; padding: 0.2rem; position: relative; diff --git a/gui/src/hooks/useSubmenuContextProviders.tsx b/gui/src/hooks/useSubmenuContextProviders.tsx index 8a21abc4e..cf70b7ea0 100644 --- a/gui/src/hooks/useSubmenuContextProviders.tsx +++ b/gui/src/hooks/useSubmenuContextProviders.tsx @@ -13,7 +13,7 @@ const MINISEARCH_OPTIONS = { fuzzy: 2, }; -const MAX_LENGTH = 10; +const MAX_LENGTH = 70; function useSubmenuContextProviders() { // TODO: Refresh periodically