diff --git a/core/config/load.ts b/core/config/load.ts index 4e21a7c60..37e707bd4 100644 --- a/core/config/load.ts +++ b/core/config/load.ts @@ -113,7 +113,7 @@ function loadSerializedConfig( ideSettings: IdeSettings, ideType: IdeType, overrideConfigJson: SerializedContinueConfig | undefined, - ide: IDE + ide: IDE, ): ConfigResult { const configPath = getConfigJsonPath(ideType); let config: SerializedContinueConfig = overrideConfigJson!; @@ -135,10 +135,6 @@ function loadSerializedConfig( }; } - if (config.allowAnonymousTelemetry === undefined) { - config.allowAnonymousTelemetry = true; - } - if (config.ui?.getChatTitles === undefined) { config.ui = { ...config.ui, @@ -773,7 +769,7 @@ async function loadFullConfigNode( ideSettings, ideType, overrideConfigJson, - ide + ide, ); if (!serialized || configLoadInterrupted) { diff --git a/core/config/util.ts b/core/config/util.ts index 100773f4b..a118fd001 100644 --- a/core/config/util.ts +++ b/core/config/util.ts @@ -102,8 +102,15 @@ export function getModelByRole( return matchingModel; } -// https://github.com/continuedev/continue/issues/940 -export async function isSupportedLanceDbCpuTarget(ide: IDE) { +/** + * This check is to determine if the user is on an unsupported CPU + * target for our Lance DB binaries. + * + * See here for details: https://github.com/continuedev/continue/issues/940 + */ +export function isSupportedLanceDbCpuTarget(ide: IDE) { + const CPU_FEATURES_TO_CHECK = ["avx", "fma"] as const; + const globalContext = new GlobalContext(); const globalContextVal = globalContext.get("isSupportedLanceDbCpuTarget"); @@ -115,15 +122,14 @@ export async function isSupportedLanceDbCpuTarget(ide: IDE) { const arch = os.arch(); const platform = os.platform(); + // This check only applies to x64 //https://github.com/lancedb/lance/issues/2195#issuecomment-2057841311 - // Only applies to x64 if (arch !== "x64") { + globalContext.update("isSupportedLanceDbCpuTarget", true); return true; } try { - const CPU_FEATURES_TO_CHECK = ["avx", "fma"] as const; - const cpuFlags = (() => { switch (platform) { case "darwin": @@ -141,24 +147,16 @@ export async function isSupportedLanceDbCpuTarget(ide: IDE) { } })(); - // TODO: Remvoe ! const isSupportedLanceDbCpuTarget = cpuFlags - ? !CPU_FEATURES_TO_CHECK.every((feature) => cpuFlags.includes(feature)) + ? CPU_FEATURES_TO_CHECK.every((feature) => cpuFlags.includes(feature)) : true; // If it's not a supported CPU target, and it's the first time we are checking, // show a toast to inform the user that we are going to disable indexing. if (!isSupportedLanceDbCpuTarget) { - const shouldOpenLink = await ide.showToast( - "warning", - "Cdoebase indexing is disabled due to CPU incompatibility", - "View details", - ); - - if (shouldOpenLink) { - // TODO - void ide.openUrl("https://continue.dev"); - } + // We offload our async toast to `showUnsupportedCpuToast` to prevent making + // our config loading async upstream of `isSupportedLanceDbCpuTarget` + void showUnsupportedCpuToast(ide); } globalContext.update( @@ -172,3 +170,15 @@ export async function isSupportedLanceDbCpuTarget(ide: IDE) { return true; } } + +async function showUnsupportedCpuToast(ide: IDE) { + const shouldOpenLink = await ide.showToast( + "warning", + "Codebase indexing is disabled due to CPU incompatibility", + "Learn more", + ); + + if (shouldOpenLink) { + void ide.openUrl("https://github.com/continuedev/continue/pull/3551"); + } +} diff --git a/gui/src/components/indexing/DocsIndexingStatus.tsx b/gui/src/components/indexing/DocsIndexingStatus.tsx index 12627dff5..b1b0f1df7 100644 --- a/gui/src/components/indexing/DocsIndexingStatus.tsx +++ b/gui/src/components/indexing/DocsIndexingStatus.tsx @@ -78,10 +78,11 @@ function DocsIndexingStatus({ docConfig }: IndexingStatusViewerProps) { if (!status) { return 0; } - return Math.min(100, Math.max(0, status.progress * 100)); + return Math.min(100, Math.max(0, status.progress * 100)).toFixed(0); }, [status?.progress]); const Icon = STATUS_TO_ICON[status?.status]; + const showProgressPercentage = progressPercentage !== "100"; if (hasDeleted) return null; @@ -115,7 +116,15 @@ function DocsIndexingStatus({ docConfig }: IndexingStatusViewerProps) {
Pending...
) : (
- {progressPercentage.toFixed(0)}% + {showProgressPercentage && ( + {progressPercentage}% + )} + {status?.status !== "indexing" ? ( + + ) : null} {Icon ? ( ) : null} - {status?.status !== "indexing" ? ( - - ) : null}
)} diff --git a/gui/src/components/indexing/DocsIndexingStatuses.tsx b/gui/src/components/indexing/DocsIndexingStatuses.tsx index 445c4db93..dabbe0032 100644 --- a/gui/src/components/indexing/DocsIndexingStatuses.tsx +++ b/gui/src/components/indexing/DocsIndexingStatuses.tsx @@ -13,10 +13,10 @@ function DocsIndexingStatuses() { return (
-

@docs indexes

+

@docs indexes

{configDocs.length ? ( { dispatch(setShowDialog(true)); dispatch(setDialogMessage()); diff --git a/gui/src/pages/More/IndexingProgress/IndexingProgress.tsx b/gui/src/pages/More/IndexingProgress/IndexingProgress.tsx index 6f39c84cd..7b80f7dde 100644 --- a/gui/src/pages/More/IndexingProgress/IndexingProgress.tsx +++ b/gui/src/pages/More/IndexingProgress/IndexingProgress.tsx @@ -107,7 +107,7 @@ function IndexingProgress() { } return ( -
+
{update.status !== "loading" && ( diff --git a/gui/src/pages/More/IndexingProgress/IndexingProgressIndicator.tsx b/gui/src/pages/More/IndexingProgress/IndexingProgressIndicator.tsx index 83abeed11..2b271c837 100644 --- a/gui/src/pages/More/IndexingProgress/IndexingProgressIndicator.tsx +++ b/gui/src/pages/More/IndexingProgress/IndexingProgressIndicator.tsx @@ -21,16 +21,15 @@ const STATUS_TO_ICON: Record = { }; function IndexingProgressIndicator({ update }: IndexingProgressIndicatorProps) { - const progressPercentage = getProgressPercentage(update.progress); + const progressPercentage = getProgressPercentage(update.progress).toFixed(0); const Icon = STATUS_TO_ICON[update.status]; const animateIcon = update.status === "indexing"; - const showProgress = update.status !== "disabled"; + const showProgress = + update.status !== "disabled" && progressPercentage !== "100"; return (
- {showProgress && ( - {progressPercentage.toFixed(0)}% - )} + {showProgress && {progressPercentage}%} {Icon && (
diff --git a/gui/src/pages/More/More.tsx b/gui/src/pages/More/More.tsx index cc399a3fd..b543353b7 100644 --- a/gui/src/pages/More/More.tsx +++ b/gui/src/pages/More/More.tsx @@ -13,7 +13,7 @@ import MoreHelpRow from "./MoreHelpRow"; import IndexingProgress from "./IndexingProgress"; import DocsIndexingStatuses from "../../components/indexing/DocsIndexingStatuses"; import PageHeader from "../../components/PageHeader"; -import { useAppDispatch } from "../../redux/hooks"; +import { useAppDispatch, useAppSelector } from "../../redux/hooks"; import { saveCurrentSession } from "../../redux/thunks/session"; function MorePage() { @@ -21,6 +21,9 @@ function MorePage() { const dispatch = useAppDispatch(); const navigate = useNavigate(); const ideMessenger = useContext(IdeMessengerContext); + const disableIndexing = useAppSelector( + (state) => state.config.config.disableIndexing, + ); return (
@@ -34,8 +37,15 @@ function MorePage() { Local embeddings of your codebase
- + {disableIndexing ? ( +
+ Indexing is disabled +
+ ) : ( + + )}
+