diff --git a/binary/build.js b/binary/build.js index adc461396..99a5d0e12 100644 --- a/binary/build.js +++ b/binary/build.js @@ -243,7 +243,7 @@ async function installNodeModuleInTempDirAndCopyToCurrent(packageName, toCopy) { fs.mkdirSync(targetDir, { recursive: true }); console.log(`[info] Building ${target}...`); execCmdSync( - `npx pkg --no-bytecode --public-packages "*" --public pkgJson/${target} --out-path ${targetDir}`, + `npx pkg --no-bytecode --public-packages "*" --public --compress GZip pkgJson/${target} --out-path ${targetDir}`, ); // Download and unzip prebuilt sqlite3 binary for the target diff --git a/core/config/ConfigHandler.ts b/core/config/ConfigHandler.ts index 7db61161a..3a3c81fab 100644 --- a/core/config/ConfigHandler.ts +++ b/core/config/ConfigHandler.ts @@ -199,8 +199,8 @@ export class ConfigHandler { this.ide, this.ideSettingsPromise, this.writeLog, - this.reloadConfig.bind(this), assistant.rawYaml, + selectedOrgId, ); return new ProfileLifecycleManager(profileLoader, this.ide); diff --git a/core/config/profile/ControlPlaneProfileLoader.ts b/core/config/profile/ControlPlaneProfileLoader.ts index 09a1846a4..85130676b 100644 --- a/core/config/profile/ControlPlaneProfileLoader.ts +++ b/core/config/profile/ControlPlaneProfileLoader.ts @@ -71,6 +71,7 @@ export default class ControlPlaneProfileLoader implements IProfileLoader { undefined, this.workspaceId, undefined, + null, ); } diff --git a/core/config/profile/LocalProfileLoader.ts b/core/config/profile/LocalProfileLoader.ts index 46245a7f0..464d16804 100644 --- a/core/config/profile/LocalProfileLoader.ts +++ b/core/config/profile/LocalProfileLoader.ts @@ -65,6 +65,7 @@ export default class LocalProfileLoader implements IProfileLoader { undefined, this.description.id, this.overrideAssistantFile?.path, + null, ); this.description.errors = result.errors; diff --git a/core/config/profile/PlatformProfileLoader.ts b/core/config/profile/PlatformProfileLoader.ts index 1eddedb6a..468d3511a 100644 --- a/core/config/profile/PlatformProfileLoader.ts +++ b/core/config/profile/PlatformProfileLoader.ts @@ -31,8 +31,8 @@ export default class PlatformProfileLoader implements IProfileLoader { private readonly ide: IDE, private ideSettingsPromise: Promise, private writeLog: (message: string) => Promise, - private readonly onReload: () => void, readonly description: ProfileDescription, + private readonly orgScopeId: string | null, ) {} static async create( @@ -45,8 +45,8 @@ export default class PlatformProfileLoader implements IProfileLoader { ide: IDE, ideSettingsPromise: Promise, writeLog: (message: string) => Promise, - onReload: () => void, rawYaml: string, + orgScopeId: string | null, ): Promise { const controlPlaneEnv = await getControlPlaneEnv(ideSettingsPromise); @@ -75,8 +75,8 @@ export default class PlatformProfileLoader implements IProfileLoader { ide, ideSettingsPromise, writeLog, - onReload, description, + orgScopeId, ); } @@ -102,6 +102,7 @@ export default class PlatformProfileLoader implements IProfileLoader { }, this.description.id, undefined, + this.orgScopeId, ); return { diff --git a/core/config/profile/doLoadConfig.ts b/core/config/profile/doLoadConfig.ts index 28371a220..5380cc408 100644 --- a/core/config/profile/doLoadConfig.ts +++ b/core/config/profile/doLoadConfig.ts @@ -45,6 +45,7 @@ export default async function doLoadConfig( platformConfigMetadata: PlatformConfigMetadata | undefined, profileId: string, overrideConfigYamlByPath: string | undefined, + orgScopeId: string | null, ): Promise> { const workspaceConfigs = await getWorkspaceConfigs(ide); const ideInfo = await ide.getIdeInfo(); @@ -70,7 +71,6 @@ export default async function doLoadConfig( if (overrideConfigYaml || fs.existsSync(configYamlPath)) { const result = await loadContinueConfigFromYaml( ide, - workspaceConfigs.map((c) => JSON.stringify(c)), ideSettings, ideInfo, uniqueId, @@ -80,6 +80,7 @@ export default async function doLoadConfig( platformConfigMetadata, controlPlaneClient, configYamlPath, + orgScopeId, ); newConfig = result.config; errors = result.errors; diff --git a/core/config/yaml/loadYaml.ts b/core/config/yaml/loadYaml.ts index 1ca54337b..f2fefbb39 100644 --- a/core/config/yaml/loadYaml.ts +++ b/core/config/yaml/loadYaml.ts @@ -41,22 +41,31 @@ import { getSystemPromptDotFile } from "../getSystemPromptDotFile"; import { PlatformConfigMetadata } from "../profile/PlatformProfileLoader"; import { modifyAnyConfigWithSharedConfig } from "../sharedConfig"; +import { getControlPlaneEnvSync } from "../../control-plane/env"; import { llmsFromModelConfig } from "./models"; export class LocalPlatformClient implements PlatformClient { + constructor( + private orgScopeId: string | null, + private readonly client: ControlPlaneClient, + ) {} + async resolveFQSNs(fqsns: FQSN[]): Promise<(SecretResult | undefined)[]> { - return fqsns.map((fqsn) => { - return undefined; - }); + if (fqsns.length === 0) { + return []; + } + + const response = await this.client.resolveFQSNs(fqsns, this.orgScopeId); + return response; } } async function loadConfigYaml( - workspaceConfigs: string[], rawYaml: string, overrideConfigYaml: AssistantUnrolled | undefined, - ide: IDE, controlPlaneClient: ControlPlaneClient, + orgScopeId: string | null, + ideSettings: IdeSettings, ): Promise> { let config = overrideConfigYaml ?? @@ -68,12 +77,18 @@ async function loadConfigYaml( versionSlug: "", }, rawYaml, - new RegistryClient(), + new RegistryClient( + await controlPlaneClient.getAccessToken(), + getControlPlaneEnvSync( + ideSettings.continueTestEnvironment, + ideSettings.enableControlServerBeta, + ).CONTROL_PLANE_URL, + ), { currentUserSlug: "", onPremProxyUrl: null, - orgScopeId: null, - platformClient: new LocalPlatformClient(), + orgScopeId, + platformClient: new LocalPlatformClient(orgScopeId, controlPlaneClient), renderSecrets: true, }, )); @@ -206,7 +221,6 @@ async function configYamlToContinueConfig( continueConfig.systemMessage, ); - // if (modelsArrayRoles.some((role) => model.roles?.includes(role))) { continueConfig.models.push(...llms); } @@ -244,7 +258,10 @@ async function configYamlToContinueConfig( } else { continueConfig.modelsByRole.embed.push( new embeddingsProviderClass( - options, + { + ...options, + title: options.name, + }, (url: string | URL, init: any) => fetchwithRequestOptions(url, init, { ...options.requestOptions, @@ -265,10 +282,15 @@ async function configYamlToContinueConfig( const rerankerClass = AllRerankers[provider]; if (rerankerClass) { continueConfig.modelsByRole.rerank.push( - new rerankerClass(options, (url: string | URL, init: any) => - fetchwithRequestOptions(url, init, { - ...options.requestOptions, - }), + new rerankerClass( + { + ...options, + title: options.name, + }, + (url: string | URL, init: any) => + fetchwithRequestOptions(url, init, { + ...options.requestOptions, + }), ), ); } else { @@ -387,7 +409,6 @@ async function configYamlToContinueConfig( export async function loadContinueConfigFromYaml( ide: IDE, - workspaceConfigs: string[], ideSettings: IdeSettings, ideInfo: IdeInfo, uniqueId: string, @@ -397,6 +418,7 @@ export async function loadContinueConfigFromYaml( platformConfigMetadata: PlatformConfigMetadata | undefined, controlPlaneClient: ControlPlaneClient, configYamlPath: string | undefined, + orgScopeId: string | null, ): Promise> { const rawYaml = overrideConfigYaml === undefined @@ -407,11 +429,11 @@ export async function loadContinueConfigFromYaml( : ""; const configYamlResult = await loadConfigYaml( - workspaceConfigs, rawYaml, overrideConfigYaml, - ide, controlPlaneClient, + orgScopeId, + ideSettings, ); if (!configYamlResult.config || configYamlResult.configLoadInterrupted) { diff --git a/core/control-plane/client.ts b/core/control-plane/client.ts index dee4d7ef4..77a3dc108 100644 --- a/core/control-plane/client.ts +++ b/core/control-plane/client.ts @@ -5,6 +5,7 @@ import { FQSN, FullSlug, SecretResult, + SecretType, } from "@continuedev/config-yaml"; import fetch, { RequestInit, Response } from "node-fetch"; @@ -46,7 +47,14 @@ export class ControlPlaneClient { ): Promise<(SecretResult | undefined)[]> { const userId = await this.userId; if (!userId) { - throw new Error("No user id"); + return fqsns.map((fqsn) => ({ + found: false, + fqsn, + secretLocation: { + secretName: fqsn.secretName, + secretType: SecretType.NotFound, + }, + })); } const resp = await this.request("ide/sync-secrets", { diff --git a/core/llm/llms/TransformersJsEmbeddingsProvider.ts b/core/llm/llms/TransformersJsEmbeddingsProvider.ts index d17c9e0f1..7bd7b78ec 100644 --- a/core/llm/llms/TransformersJsEmbeddingsProvider.ts +++ b/core/llm/llms/TransformersJsEmbeddingsProvider.ts @@ -43,14 +43,16 @@ export class TransformersJsEmbeddingsProvider extends BaseLLM { static maxGroupSize: number = 1; static model: string = "all-MiniLM-L6-v2"; static mockVector: number[] = Array.from({ length: 384 }).fill(2) as number[]; - static title: string = "Transformers.js (Built-In)"; static defaultOptions: Partial | undefined = { model: TransformersJsEmbeddingsProvider.model, }; constructor() { - super({ model: TransformersJsEmbeddingsProvider.model }); + super({ + model: TransformersJsEmbeddingsProvider.model, + title: "Transformers.js (Built-In)", + }); } async embed(chunks: string[]) { diff --git a/core/llm/llms/stubs/ContinueProxy.ts b/core/llm/llms/stubs/ContinueProxy.ts index 01f62cd00..181db2abd 100644 --- a/core/llm/llms/stubs/ContinueProxy.ts +++ b/core/llm/llms/stubs/ContinueProxy.ts @@ -11,7 +11,7 @@ class ContinueProxy extends OpenAI { this.apiKey = value.workOsAccessToken; if (!this.onPremProxyUrl) { this.apiBase = new URL( - "openai/v1/", + "model-proxy/v1/", value.controlPlaneProxyUrl, ).toString(); } @@ -29,7 +29,7 @@ class ContinueProxy extends OpenAI { this.orgScopeId = options.orgScopeId; this.onPremProxyUrl = options.onPremProxyUrl; if (this.onPremProxyUrl) { - this.apiBase = new URL("openai/v1/", this.onPremProxyUrl).toString(); + this.apiBase = new URL("model-proxy/v1/", this.onPremProxyUrl).toString(); } } diff --git a/core/package-lock.json b/core/package-lock.json index 765c3541e..4637becf6 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -13,7 +13,7 @@ "@aws-sdk/client-sagemaker-runtime": "^3.758.0", "@aws-sdk/credential-providers": "^3.758.0", "@continuedev/config-types": "^1.0.13", - "@continuedev/config-yaml": "^1.0.63", + "@continuedev/config-yaml": "^1.0.67", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.18", @@ -100,7 +100,8 @@ "myers-diff": "^2.1.0", "onnxruntime-common": "1.14.0", "onnxruntime-web": "1.14.0", - "ts-jest": "^29.1.1" + "ts-jest": "^29.1.1", + "typescript": "^5.6.3" }, "engines": { "node": ">=20.11.0" @@ -2973,9 +2974,9 @@ } }, "node_modules/@continuedev/config-yaml": { - "version": "1.0.63", - "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.63.tgz", - "integrity": "sha512-KBfyOUU/mWOXeNf6v+4IfMkbvfEEe/YP6n/g/reJBhrpApchG2A/P11JviH87N2To1SrhZxnW//0g5FIGupDFw==", + "version": "1.0.67", + "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.67.tgz", + "integrity": "sha512-RbJXSH2Z9XmaN1h9Dm0Qfru7UeAdCAEWMiEgJ9A2FGHysR9oxbQDqptk1Y61oDSpYeX+lWsxkz/SFIc2PjNnKg==", "dependencies": { "@continuedev/config-types": "^1.0.14", "yaml": "^2.6.1", @@ -15449,7 +15450,6 @@ "version": "5.7.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/core/package.json b/core/package.json index a60eda4ad..5acd99675 100644 --- a/core/package.json +++ b/core/package.json @@ -39,14 +39,15 @@ "myers-diff": "^2.1.0", "onnxruntime-common": "1.14.0", "onnxruntime-web": "1.14.0", - "ts-jest": "^29.1.1" + "ts-jest": "^29.1.1", + "typescript": "^5.6.3" }, "dependencies": { "@aws-sdk/client-bedrock-runtime": "^3.758.0", "@aws-sdk/client-sagemaker-runtime": "^3.758.0", "@aws-sdk/credential-providers": "^3.758.0", "@continuedev/config-types": "^1.0.13", - "@continuedev/config-yaml": "^1.0.63", + "@continuedev/config-yaml": "^1.0.67", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.18", diff --git a/extensions/intellij/gradle.properties b/extensions/intellij/gradle.properties index 0d846c3d2..96711d384 100644 --- a/extensions/intellij/gradle.properties +++ b/extensions/intellij/gradle.properties @@ -3,7 +3,7 @@ pluginGroup=com.github.continuedev.continueintellijextension pluginName=continue-intellij-extension pluginRepositoryUrl=https://github.com/continuedev/continue # SemVer format -> https://semver.org -pluginVersion=1.0.5 +pluginVersion=1.0.6 # Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html pluginSinceBuild=223 # IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index f1b847bfa..00ae46772 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "1.1.14", + "version": "1.1.15", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "1.1.14", + "version": "1.1.15", "license": "Apache-2.0", "dependencies": { "@continuedev/fetch": "^1.0.3", @@ -87,7 +87,7 @@ "mocha": "^10.4.0", "ovsx": "^0.8.3", "rimraf": "^5.0.5", - "typescript": "^5.3.3", + "typescript": "^5.6.3", "vite": "^4.3.9", "vsce": "^2.15.0", "vscode-extension-tester": "^8.10.0" @@ -106,7 +106,7 @@ "@aws-sdk/client-sagemaker-runtime": "^3.758.0", "@aws-sdk/credential-providers": "^3.758.0", "@continuedev/config-types": "^1.0.13", - "@continuedev/config-yaml": "^1.0.63", + "@continuedev/config-yaml": "^1.0.67", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.18", @@ -193,7 +193,8 @@ "myers-diff": "^2.1.0", "onnxruntime-common": "1.14.0", "onnxruntime-web": "1.14.0", - "ts-jest": "^29.1.1" + "ts-jest": "^29.1.1", + "typescript": "^5.6.3" }, "engines": { "node": ">=20.11.0" diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index c96eee528..27f9a98fc 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -2,7 +2,7 @@ "name": "continue", "icon": "media/icon.png", "author": "Continue Dev, Inc", - "version": "1.1.14", + "version": "1.1.15", "repository": { "type": "git", "url": "https://github.com/continuedev/continue" @@ -624,7 +624,7 @@ "mocha": "^10.4.0", "ovsx": "^0.8.3", "rimraf": "^5.0.5", - "typescript": "^5.3.3", + "typescript": "^5.6.3", "vite": "^4.3.9", "vsce": "^2.15.0", "vscode-extension-tester": "^8.10.0" diff --git a/extensions/vscode/src/extension/ConfigYamlDocumentLinkProvider.ts b/extensions/vscode/src/extension/ConfigYamlDocumentLinkProvider.ts new file mode 100644 index 000000000..1c0a76251 --- /dev/null +++ b/extensions/vscode/src/extension/ConfigYamlDocumentLinkProvider.ts @@ -0,0 +1,43 @@ +import * as vscode from "vscode"; + +export class ConfigYamlDocumentLinkProvider + implements vscode.DocumentLinkProvider +{ + private usesPattern = /^\s*#?\s*-\s*uses:\s*(.+)$/; + provideDocumentLinks( + document: vscode.TextDocument, + token: vscode.CancellationToken, + ): vscode.ProviderResult { + const links: vscode.DocumentLink[] = []; + + for (let lineIndex = 0; lineIndex < document.lineCount; lineIndex++) { + const line = document.lineAt(lineIndex); + const match = this.usesPattern.exec(line.text); + + if (match) { + const slug = match[1].trim(); + const startPos = line.text.indexOf(slug); + const range = new vscode.Range( + lineIndex, + startPos, + lineIndex, + startPos + slug.length, + ); + + const link = new vscode.DocumentLink( + range, + vscode.Uri.parse(`https://hub.continue.dev/${slug}`), + ); + links.push(link); + } + } + + return links; + } + resolveDocumentLink( + link: vscode.DocumentLink, + token: vscode.CancellationToken, + ): vscode.ProviderResult { + return link; + } +} diff --git a/extensions/vscode/src/extension/VsCodeExtension.ts b/extensions/vscode/src/extension/VsCodeExtension.ts index a4a90afd3..9441d70cd 100644 --- a/extensions/vscode/src/extension/VsCodeExtension.ts +++ b/extensions/vscode/src/extension/VsCodeExtension.ts @@ -37,6 +37,7 @@ import { Battery } from "../util/battery"; import { FileSearch } from "../util/FileSearch"; import { VsCodeIde } from "../VsCodeIde"; +import { ConfigYamlDocumentLinkProvider } from "./ConfigYamlDocumentLinkProvider"; import { VsCodeMessenger } from "./VsCodeMessenger"; import type { VsCodeWebviewProtocol } from "../webviewProtocol"; @@ -401,6 +402,12 @@ export class VsCodeExtension { ), ); + const linkProvider = vscode.languages.registerDocumentLinkProvider( + { language: "yaml" }, + new ConfigYamlDocumentLinkProvider(), + ); + context.subscriptions.push(linkProvider); + this.ide.onDidChangeActiveTextEditor((filepath) => { void this.core.invoke("didChangeActiveTextEditor", { filepath }); }); diff --git a/gui/package-lock.json b/gui/package-lock.json index b0918360d..a5de2c9e8 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -7,8 +7,8 @@ "name": "gui", "license": "Apache-2.0", "dependencies": { - "@continuedev/config-yaml": "^1.0.63", - "@headlessui/react": "^1.7.17", + "@continuedev/config-yaml": "^1.0.67", + "@headlessui/react": "^2.2.0", "@heroicons/react": "^2.0.18", "@reduxjs/toolkit": "^2.3.0", "@tiptap/core": "^2.3.2", @@ -26,6 +26,7 @@ "@tiptap/suggestion": "^2.1.13", "@types/uuid": "^10.0.0", "@types/vscode-webview": "^1.57.1", + "clsx": "^2.1.1", "core": "file:../core", "dompurify": "^3.0.6", "downshift": "^7.6.0", @@ -59,6 +60,7 @@ "socket.io-client": "^4.7.2", "styled-components": "^5.3.6", "table": "^6.8.1", + "tailwind-merge": "^3.0.2", "tippy.js": "^6.3.7", "unist-util-visit": "^5.0.0", "uuid": "^9.0.1", @@ -91,7 +93,7 @@ "jsdom": "^25.0.1", "postcss": "^8.4.21", "tailwindcss": "^3.2.7", - "typescript": "^4.9.3", + "typescript": "^5.6.3", "typescript-eslint": "^8.16.0", "vite": "^4.1.0", "vitest": "^2.1.3" @@ -109,7 +111,7 @@ "@aws-sdk/client-sagemaker-runtime": "^3.758.0", "@aws-sdk/credential-providers": "^3.758.0", "@continuedev/config-types": "^1.0.13", - "@continuedev/config-yaml": "^1.0.63", + "@continuedev/config-yaml": "^1.0.67", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.18", @@ -196,7 +198,8 @@ "myers-diff": "^2.1.0", "onnxruntime-common": "1.14.0", "onnxruntime-web": "1.14.0", - "ts-jest": "^29.1.1" + "ts-jest": "^29.1.1", + "typescript": "^5.6.3" }, "engines": { "node": ">=20.11.0" @@ -551,9 +554,9 @@ } }, "node_modules/@continuedev/config-yaml": { - "version": "1.0.63", - "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.63.tgz", - "integrity": "sha512-KBfyOUU/mWOXeNf6v+4IfMkbvfEEe/YP6n/g/reJBhrpApchG2A/P11JviH87N2To1SrhZxnW//0g5FIGupDFw==", + "version": "1.0.67", + "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.67.tgz", + "integrity": "sha512-RbJXSH2Z9XmaN1h9Dm0Qfru7UeAdCAEWMiEgJ9A2FGHysR9oxbQDqptk1Y61oDSpYeX+lWsxkz/SFIc2PjNnKg==", "dependencies": { "@continuedev/config-types": "^1.0.14", "yaml": "^2.6.1", @@ -1098,25 +1101,53 @@ "@floating-ui/utils": "^0.2.8" } }, + "node_modules/@floating-ui/react": { + "version": "0.26.28", + "resolved": "https://registry.npmjs.org/@floating-ui/react/-/react-0.26.28.tgz", + "integrity": "sha512-yORQuuAtVpiRjpMhdc0wJj06b9JFjrYF4qp96j++v2NBpbi6SEGF7donUJ3TMieerQ6qVkAv1tgr7L4r5roTqw==", + "dependencies": { + "@floating-ui/react-dom": "^2.1.2", + "@floating-ui/utils": "^0.2.8", + "tabbable": "^6.0.0" + }, + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, + "node_modules/@floating-ui/react-dom": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.2.tgz", + "integrity": "sha512-06okr5cgPzMNBy+Ycse2A6udMi4bqwW/zgBF/rwjcNqWkyr82Mcg8b0vjX8OJpZFy/FKjJmw6wV7t44kK6kW7A==", + "dependencies": { + "@floating-ui/dom": "^1.0.0" + }, + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, "node_modules/@floating-ui/utils": { "version": "0.2.8", "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.8.tgz", "integrity": "sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig==" }, "node_modules/@headlessui/react": { - "version": "1.7.19", - "resolved": "https://registry.npmjs.org/@headlessui/react/-/react-1.7.19.tgz", - "integrity": "sha512-Ll+8q3OlMJfJbAKM/+/Y2q6PPYbryqNTXDbryx7SXLIDamkF6iQFbriYHga0dY44PvDhvvBWCx1Xj4U5+G4hOw==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@headlessui/react/-/react-2.2.0.tgz", + "integrity": "sha512-RzCEg+LXsuI7mHiSomsu/gBJSjpupm6A1qIZ5sWjd7JhARNlMiSA4kKfJpCKwU9tE+zMRterhhrP74PvfJrpXQ==", "dependencies": { - "@tanstack/react-virtual": "^3.0.0-beta.60", - "client-only": "^0.0.1" + "@floating-ui/react": "^0.26.16", + "@react-aria/focus": "^3.17.1", + "@react-aria/interactions": "^3.21.3", + "@tanstack/react-virtual": "^3.8.1" }, "engines": { "node": ">=10" }, "peerDependencies": { - "react": "^16 || ^17 || ^18", - "react-dom": "^16 || ^17 || ^18" + "react": "^18 || ^19 || ^19.0.0-rc", + "react-dom": "^18 || ^19 || ^19.0.0-rc" } }, "node_modules/@heroicons/react": { @@ -1702,6 +1733,96 @@ "url": "https://opencollective.com/popperjs" } }, + "node_modules/@react-aria/focus": { + "version": "3.20.1", + "resolved": "https://registry.npmjs.org/@react-aria/focus/-/focus-3.20.1.tgz", + "integrity": "sha512-lgYs+sQ1TtBrAXnAdRBQrBo0/7o5H6IrfDxec1j+VRpcXL0xyk0xPq+m3lZp8typzIghqDgpnKkJ5Jf4OrzPIw==", + "dependencies": { + "@react-aria/interactions": "^3.24.1", + "@react-aria/utils": "^3.28.1", + "@react-types/shared": "^3.28.0", + "@swc/helpers": "^0.5.0", + "clsx": "^2.0.0" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1", + "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" + } + }, + "node_modules/@react-aria/interactions": { + "version": "3.24.1", + "resolved": "https://registry.npmjs.org/@react-aria/interactions/-/interactions-3.24.1.tgz", + "integrity": "sha512-OWEcIC6UQfWq4Td5Ptuh4PZQ4LHLJr/JL2jGYvuNL6EgL3bWvzPrRYIF/R64YbfVxIC7FeZpPSkS07sZ93/NoA==", + "dependencies": { + "@react-aria/ssr": "^3.9.7", + "@react-aria/utils": "^3.28.1", + "@react-stately/flags": "^3.1.0", + "@react-types/shared": "^3.28.0", + "@swc/helpers": "^0.5.0" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1", + "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" + } + }, + "node_modules/@react-aria/ssr": { + "version": "3.9.7", + "resolved": "https://registry.npmjs.org/@react-aria/ssr/-/ssr-3.9.7.tgz", + "integrity": "sha512-GQygZaGlmYjmYM+tiNBA5C6acmiDWF52Nqd40bBp0Znk4M4hP+LTmI0lpI1BuKMw45T8RIhrAsICIfKwZvi2Gg==", + "dependencies": { + "@swc/helpers": "^0.5.0" + }, + "engines": { + "node": ">= 12" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" + } + }, + "node_modules/@react-aria/utils": { + "version": "3.28.1", + "resolved": "https://registry.npmjs.org/@react-aria/utils/-/utils-3.28.1.tgz", + "integrity": "sha512-mnHFF4YOVu9BRFQ1SZSKfPhg3z+lBRYoW5mLcYTQihbKhz48+I1sqRkP7ahMITr8ANH3nb34YaMME4XWmK2Mgg==", + "dependencies": { + "@react-aria/ssr": "^3.9.7", + "@react-stately/flags": "^3.1.0", + "@react-stately/utils": "^3.10.5", + "@react-types/shared": "^3.28.0", + "@swc/helpers": "^0.5.0", + "clsx": "^2.0.0" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1", + "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" + } + }, + "node_modules/@react-stately/flags": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@react-stately/flags/-/flags-3.1.0.tgz", + "integrity": "sha512-KSHOCxTFpBtxhIRcKwsD1YDTaNxFtCYuAUb0KEihc16QwqZViq4hasgPBs2gYm7fHRbw7WYzWKf6ZSo/+YsFlg==", + "dependencies": { + "@swc/helpers": "^0.5.0" + } + }, + "node_modules/@react-stately/utils": { + "version": "3.10.5", + "resolved": "https://registry.npmjs.org/@react-stately/utils/-/utils-3.10.5.tgz", + "integrity": "sha512-iMQSGcpaecghDIh3mZEpZfoFH3ExBwTtuBEcvZ2XnGzCgQjeYXcMdIUwAfVQLXFTdHUHGF6Gu6/dFrYsCzySBQ==", + "dependencies": { + "@swc/helpers": "^0.5.0" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" + } + }, + "node_modules/@react-types/shared": { + "version": "3.28.0", + "resolved": "https://registry.npmjs.org/@react-types/shared/-/shared-3.28.0.tgz", + "integrity": "sha512-9oMEYIDc3sk0G5rysnYvdNrkSg7B04yTKl50HHSZVbokeHpnU0yRmsDaWb9B/5RprcKj8XszEk5guBO8Sa/Q+Q==", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" + } + }, "node_modules/@reduxjs/toolkit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-2.3.0.tgz", @@ -2201,6 +2322,14 @@ "integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==", "dev": true }, + "node_modules/@swc/helpers": { + "version": "0.5.15", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz", + "integrity": "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==", + "dependencies": { + "tslib": "^2.8.0" + } + }, "node_modules/@swc/types": { "version": "0.1.12", "resolved": "https://registry.npmjs.org/@swc/types/-/types-0.1.12.tgz", @@ -4265,11 +4394,6 @@ "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz", "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==" }, - "node_modules/client-only": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", - "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==" - }, "node_modules/clone-response": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz", @@ -4282,6 +4406,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "engines": { + "node": ">=6" + } + }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -11398,6 +11530,11 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, + "node_modules/tabbable": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.2.0.tgz", + "integrity": "sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==" + }, "node_modules/table": { "version": "6.8.2", "resolved": "https://registry.npmjs.org/table/-/table-6.8.2.tgz", @@ -11413,6 +11550,15 @@ "node": ">=10.0.0" } }, + "node_modules/tailwind-merge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.0.2.tgz", + "integrity": "sha512-l7z+OYZ7mu3DTqrL88RiKrKIqO3NcpEO8V/Od04bNpvk0kiIFndGEoqfuzvj4yuhRkHKjRkII2z+KS2HfPcSxw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/dcastil" + } + }, "node_modules/tailwindcss": { "version": "3.4.12", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.12.tgz", @@ -11730,9 +11876,9 @@ "dev": true }, "node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" }, "node_modules/type-check": { "version": "0.4.0", @@ -11833,16 +11979,16 @@ } }, "node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.8.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", + "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/typescript-eslint": { diff --git a/gui/package.json b/gui/package.json index 6724bd757..33f326de3 100644 --- a/gui/package.json +++ b/gui/package.json @@ -15,8 +15,8 @@ "test:watch": "vitest" }, "dependencies": { - "@continuedev/config-yaml": "^1.0.63", - "@headlessui/react": "^1.7.17", + "@continuedev/config-yaml": "^1.0.67", + "@headlessui/react": "^2.2.0", "@heroicons/react": "^2.0.18", "@reduxjs/toolkit": "^2.3.0", "@tiptap/core": "^2.3.2", @@ -34,6 +34,7 @@ "@tiptap/suggestion": "^2.1.13", "@types/uuid": "^10.0.0", "@types/vscode-webview": "^1.57.1", + "clsx": "^2.1.1", "core": "file:../core", "dompurify": "^3.0.6", "downshift": "^7.6.0", @@ -67,6 +68,7 @@ "socket.io-client": "^4.7.2", "styled-components": "^5.3.6", "table": "^6.8.1", + "tailwind-merge": "^3.0.2", "tippy.js": "^6.3.7", "unist-util-visit": "^5.0.0", "uuid": "^9.0.1", @@ -99,7 +101,7 @@ "jsdom": "^25.0.1", "postcss": "^8.4.21", "tailwindcss": "^3.2.7", - "typescript": "^4.9.3", + "typescript": "^5.6.3", "typescript-eslint": "^8.16.0", "vite": "^4.1.0", "vitest": "^2.1.3" diff --git a/gui/src/components/CodeToEditCard/AddFileButton.tsx b/gui/src/components/CodeToEditCard/AddFileButton.tsx index b1e1966fe..18316a5d7 100644 --- a/gui/src/components/CodeToEditCard/AddFileButton.tsx +++ b/gui/src/components/CodeToEditCard/AddFileButton.tsx @@ -1,9 +1,14 @@ +import { ChevronDownIcon, PlusIcon } from "@heroicons/react/24/outline"; import { useContext, useRef } from "react"; import { IdeMessengerContext } from "../../context/IdeMessenger"; -import { ChevronDownIcon, PlusIcon } from "@heroicons/react/24/outline"; -import { Listbox } from "@headlessui/react"; -import { addCodeToEdit } from "../../redux/slices/sessionSlice"; import { useAppDispatch } from "../../redux/hooks"; +import { addCodeToEdit } from "../../redux/slices/sessionSlice"; +import { + Listbox, + ListboxButton, + ListboxOption, + ListboxOptions, +} from "../ui/Listbox"; export interface AddFileButtonProps { onClick: () => void; @@ -29,9 +34,9 @@ export default function AddFileButton({ onClick }: AddFileButtonProps) { return (
-
- + - - - Add all open files - - + + Add all open files +
); diff --git a/gui/src/components/CodeToEditCard/AddFileCombobox.tsx b/gui/src/components/CodeToEditCard/AddFileCombobox.tsx index 9450ba480..d096f90a2 100644 --- a/gui/src/components/CodeToEditCard/AddFileCombobox.tsx +++ b/gui/src/components/CodeToEditCard/AddFileCombobox.tsx @@ -1,10 +1,15 @@ -import { Combobox } from "@headlessui/react"; import { ContextSubmenuItemWithProvider } from "core"; import { useEffect, useRef, useState } from "react"; +import { + Combobox, + ComboboxButton, + ComboboxInput, + ComboboxOption, + ComboboxOptions, +} from "../../components/ui/Combobox"; import { useSubmenuContextProviders } from "../../context/SubmenuContextProviders"; import { useAppSelector } from "../../redux/hooks"; import FileIcon from "../FileIcon"; - export interface AddFileComboboxProps { onSelect: (filepaths: string[]) => void | Promise; onEscape: () => void | Promise; @@ -54,8 +59,8 @@ export default function AddFileCombobox({ > {({ open }) => (
- - + { if (!open) { @@ -65,7 +70,7 @@ export default function AddFileCombobox({ onFocus={() => { buttonRef.current?.click(); }} - className="bg-vsc-background border-lightgray text-vsc-foreground box-border w-full rounded border border-solid py-0.5 pl-2 focus:outline-none" + className="bg-vsc-background border-lightgray text-vsc-foreground box-border w-full rounded border border-solid py-0.5 pl-2 text-xs focus:outline-none" onChange={(event) => setQuery(event.target.value)} placeholder="Type to search files..." onKeyDown={(e) => { @@ -75,10 +80,10 @@ export default function AddFileCombobox({ }} /> - + {filteredFiles.length > 0 ? ( filteredFiles.map((file) => ( - @@ -109,14 +114,14 @@ export default function AddFileCombobox({
)} - + )) ) : (
No results
)} - +
)} diff --git a/gui/src/components/ConversationStarters/ConversationStarterCard.tsx b/gui/src/components/ConversationStarters/ConversationStarterCard.tsx index f0428a723..29ff81833 100644 --- a/gui/src/components/ConversationStarters/ConversationStarterCard.tsx +++ b/gui/src/components/ConversationStarters/ConversationStarterCard.tsx @@ -1,7 +1,5 @@ import { ChatBubbleLeftIcon } from "@heroicons/react/24/outline"; import { SlashCommandDescription } from "core"; -import { useState } from "react"; -import { defaultBorderRadius, vscInputBackground } from ".."; interface ConversationStarterCardProps { command: SlashCommandDescription; @@ -12,26 +10,20 @@ export function ConversationStarterCard({ command, onClick, }: ConversationStarterCardProps) { - const [isHovered, setIsHovered] = useState(false); - return (
setIsHovered(true)} - onMouseLeave={() => setIsHovered(false)} + className="bg-vsc-input-background mb-2 w-full rounded-md shadow-md hover:cursor-pointer hover:brightness-110" onClick={() => onClick(command)} >
-
+
{command.name}
-
{command.description}
+ {command.description && ( +
{command.description}
+ )}
diff --git a/gui/src/components/ConversationStarters/ConversationStarterCards.tsx b/gui/src/components/ConversationStarters/ConversationStarterCards.tsx index 2a29d0749..7e0e2e183 100644 --- a/gui/src/components/ConversationStarters/ConversationStarterCards.tsx +++ b/gui/src/components/ConversationStarters/ConversationStarterCards.tsx @@ -1,15 +1,24 @@ import { SlashCommandDescription } from "core"; -import { useAppDispatch } from "../../redux/hooks"; +import { useState } from "react"; +import { useBookmarkedSlashCommands } from "../../hooks/useBookmarkedSlashCommands"; +import { useAppDispatch, useAppSelector } from "../../redux/hooks"; import { setMainEditorContentTrigger } from "../../redux/slices/sessionSlice"; import { getParagraphNodeFromString } from "../mainInput/utils"; import { ConversationStarterCard } from "./ConversationStarterCard"; -import { useBookmarkedSlashCommands } from "./useBookmarkedSlashCommands"; -const NUM_CARDS_TO_RENDER = 3; +const NUM_CARDS_TO_RENDER = 5; export function ConversationStarterCards() { const dispatch = useAppDispatch(); - const { cmdsSortedByBookmark } = useBookmarkedSlashCommands(); + const [showAll, setShowAll] = useState(false); + const { isCommandBookmarked } = useBookmarkedSlashCommands(); + const slashCommands = useAppSelector( + (state) => state.config.config.slashCommands ?? [], + ); + + const bookmarkedSlashCommands = slashCommands.filter((command) => + isCommandBookmarked(command.name), + ); function onClick(command: SlashCommandDescription) { if (command.prompt) { @@ -19,19 +28,35 @@ export function ConversationStarterCards() { } } - if (!cmdsSortedByBookmark || cmdsSortedByBookmark.length === 0) { + if (bookmarkedSlashCommands.length === 0) { return null; } + const visibleCommands = showAll + ? bookmarkedSlashCommands + : bookmarkedSlashCommands.slice(0, NUM_CARDS_TO_RENDER); + + const remainingCount = bookmarkedSlashCommands.length - NUM_CARDS_TO_RENDER; + return ( -
- {cmdsSortedByBookmark.slice(0, NUM_CARDS_TO_RENDER).map((command, i) => ( - - ))} +
+
+ {visibleCommands.map((command, i) => ( + + ))} +
+ {bookmarkedSlashCommands.length > NUM_CARDS_TO_RENDER && ( + setShowAll(!showAll)} + > + {showAll ? "Show less" : `Show ${remainingCount} more...`} + + )}
); } diff --git a/gui/src/components/ConversationStarters/useBookmarkedSlashCommands.ts b/gui/src/components/ConversationStarters/useBookmarkedSlashCommands.ts deleted file mode 100644 index 786ae379a..000000000 --- a/gui/src/components/ConversationStarters/useBookmarkedSlashCommands.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { SlashCommandDescription } from "core"; -import { usePostHog } from "posthog-js/react"; -import { useMemo } from "react"; -import { - bookmarkSlashCommand, - selectBookmarkedSlashCommands, - selectSelectedProfileId, - unbookmarkSlashCommand, -} from "../../redux"; -import { useAppDispatch, useAppSelector } from "../../redux/hooks"; -import { isDeprecatedCommandName, sortCommandsByBookmarkStatus } from "./utils"; - -export function useBookmarkedSlashCommands() { - const dispatch = useAppDispatch(); - const posthog = usePostHog(); - - const slashCommands = - useAppSelector((state) => state.config.config.slashCommands) ?? []; - const selectedProfileId = useAppSelector(selectSelectedProfileId); - const bookmarkedCommands = useAppSelector(selectBookmarkedSlashCommands); - - const filteredSlashCommands = slashCommands.filter(isDeprecatedCommandName); - - // Create a map of command names to bookmark status - const bookmarkStatuses = useMemo(() => { - const statuses: Record = {}; - if (selectedProfileId) { - filteredSlashCommands.forEach((command) => { - statuses[command.name] = bookmarkedCommands.includes(command.name); - }); - } - return statuses; - }, [filteredSlashCommands, bookmarkedCommands, selectedProfileId]); - - // Sort commands by bookmark status - const cmdsSortedByBookmark = useMemo( - () => - sortCommandsByBookmarkStatus(filteredSlashCommands, bookmarkedCommands), - [filteredSlashCommands, bookmarkedCommands], - ); - - const toggleBookmark = (command: SlashCommandDescription) => { - const isBookmarked = bookmarkStatuses[command.name]; - - posthog.capture("toggle_bookmarked_slash_command", { - isBookmarked, - }); - - if (isBookmarked) { - dispatch( - unbookmarkSlashCommand({ - commandName: command.name, - }), - ); - } else { - dispatch( - bookmarkSlashCommand({ - commandName: command.name, - }), - ); - } - }; - - return { - cmdsSortedByBookmark, - bookmarkStatuses, - toggleBookmark, - }; -} diff --git a/gui/src/components/Layout.tsx b/gui/src/components/Layout.tsx index 20ecc7761..d2d91f1ea 100644 --- a/gui/src/components/Layout.tsx +++ b/gui/src/components/Layout.tsx @@ -3,6 +3,7 @@ import { Outlet, useLocation, useNavigate } from "react-router-dom"; import styled from "styled-components"; import { CustomScrollbarDiv, defaultBorderRadius } from "."; import { AuthProvider } from "../context/Auth"; +import { LocalStorageProvider } from "../context/LocalStorage"; import { useWebviewListener } from "../hooks/useWebviewListener"; import { useAppDispatch, useAppSelector } from "../redux/hooks"; import { selectUseHub } from "../redux/selectors"; @@ -265,49 +266,51 @@ const Layout = () => { // }, [onboardingCard.show, useHub]); return ( - - - -
- { - dispatch(setShowDialog(false)); + + + + +
{ - dispatch(setShowDialog(false)); - }} - message={dialogMessage} - /> + > + { + dispatch(setShowDialog(false)); + }} + onClose={() => { + dispatch(setShowDialog(false)); + }} + message={dialogMessage} + /> - - - + + + - {hasFatalErrors && pathname !== ROUTES.CONFIG_ERROR && ( -
navigate(ROUTES.CONFIG_ERROR)} - > - Error!{" "} - Could not load config -
Learn More
-
- )} -
- -
-
- - + {hasFatalErrors && pathname !== ROUTES.CONFIG_ERROR && ( +
navigate(ROUTES.CONFIG_ERROR)} + > + Error!{" "} + Could not load config +
Learn More
+
+ )} +
+ +
+
+ + + ); }; diff --git a/gui/src/components/OnboardingCard/components/OllamaStatus.tsx b/gui/src/components/OnboardingCard/components/OllamaStatus.tsx index 515958503..3839ba6ad 100644 --- a/gui/src/components/OnboardingCard/components/OllamaStatus.tsx +++ b/gui/src/components/OnboardingCard/components/OllamaStatus.tsx @@ -2,12 +2,12 @@ import { ArrowPathIcon, ArrowTopRightOnSquareIcon, } from "@heroicons/react/24/outline"; -import { useState, useContext, useEffect } from "react"; +import { useContext, useEffect, useState } from "react"; +import { StyledActionButton } from "../.."; import { IdeMessengerContext } from "../../../context/IdeMessenger"; import { providers } from "../../../pages/AddNewModel/configs/providers"; -import { StyledActionButton } from "../.."; -import OllamaCompletedStep from "./OllamaCompletedStep"; import { OllamaConnectionStatuses } from "../utils"; +import OllamaCompletedStep from "./OllamaCompletedStep"; interface OllamaStatusProps { isOllamaConnected: boolean; @@ -38,7 +38,7 @@ export function OllamaStatus({ isOllamaConnected }: OllamaStatusProps) { case OllamaConnectionStatuses.WaitingToDownload: return ( -

{downloadUrl}

+

{downloadUrl}

); diff --git a/gui/src/components/PageHeader.tsx b/gui/src/components/PageHeader.tsx index c6f55e67e..ceb9bd64a 100644 --- a/gui/src/components/PageHeader.tsx +++ b/gui/src/components/PageHeader.tsx @@ -8,7 +8,7 @@ export interface PageHeaderProps { showBorder?: boolean; } -export default function PageHeader({ +export function PageHeader({ onTitleClick, title, rightContent, @@ -22,27 +22,26 @@ export default function PageHeader({ : "" }`} > -
- {title && ( - <> -
- - - {title} - -
- - )} -
-
{rightContent}
+ {title ? ( +
+ + + {title} + +
+ ) : ( +
+ )} + + {rightContent &&
{rightContent}
}
); } diff --git a/gui/src/components/StepContainer/ThinkingIndicator.tsx b/gui/src/components/StepContainer/ThinkingIndicator.tsx index 8757cae83..862351872 100644 --- a/gui/src/components/StepContainer/ThinkingIndicator.tsx +++ b/gui/src/components/StepContainer/ThinkingIndicator.tsx @@ -1,7 +1,7 @@ +import { ChatHistoryItem } from "core"; import { useEffect, useState } from "react"; import { useAppSelector } from "../../redux/hooks"; import { selectDefaultModel } from "../../redux/slices/configSlice"; -import { ChatHistoryItem } from "core"; interface ThinkingIndicatorProps { historyItem: ChatHistoryItem; @@ -37,7 +37,7 @@ const ThinkingIndicator = ({ historyItem }: ThinkingIndicatorProps) => { return (
- {`Thinking.${".".repeat(animation)}`} + {`Thinking.${".".repeat(animation)}`}
); }; diff --git a/gui/src/components/dialogs/AddDocsDialog.tsx b/gui/src/components/dialogs/AddDocsDialog.tsx index 9dec998e3..504ac94a8 100644 --- a/gui/src/components/dialogs/AddDocsDialog.tsx +++ b/gui/src/components/dialogs/AddDocsDialog.tsx @@ -116,7 +116,7 @@ function AddDocsDialog() {