diff --git a/vscode/media/onboarding/onboarding.html b/vscode/media/onboarding/onboarding.html index f2627a54..f6e470f8 100644 --- a/vscode/media/onboarding/onboarding.html +++ b/vscode/media/onboarding/onboarding.html @@ -87,7 +87,7 @@ playMode="normal" loop autoplay>

Visit Markesuite by Google and create + href="https://aistudio.google.com/app/apikey">AI Studio by Google and create your free API key and enter below.

@@ -97,7 +97,7 @@
-

Step 3. Executable download

+

Step 3. Setting up engine

diff --git a/vscode/media/onboarding/onboarding.js b/vscode/media/onboarding/onboarding.js index 3c2710fc..888e469f 100644 --- a/vscode/media/onboarding/onboarding.js +++ b/vscode/media/onboarding/onboarding.js @@ -1231,7 +1231,8 @@ function handleTriggerMessage(event) { githubCross.classList.remove('hidden'); githubTick.classList.add('hidden'); githubLogin.classList.remove("hidden"); - apiKeyContainer.classList.remove("hidden"); + apiKeyContainer.classList.add("hidden"); + executableContainer.classList.add("hidden"); break; case 1: @@ -1239,7 +1240,7 @@ function handleTriggerMessage(event) { apiKeyCross.classList.remove('hidden'); apiKeyTick.classList.add('hidden'); googleApiKeyTextInput.classList.remove("hidden"); - executableContainer.classList.remove("hidden"); + executableContainer.classList.add("hidden"); break; case 2: @@ -1257,13 +1258,18 @@ function handleTriggerMessage(event) { githubCross.classList.add("hidden"); githubTick.classList.remove("hidden"); githubLogin.classList.add("hidden"); + apiKeyContainer.classList.remove("hidden"); } if (!isApiKeyPending) { isApiKeyPending = false; + apiKeyContainer.classList.remove("hidden"); apiKeyCross.classList.add("hidden"); apiKeyTick.classList.remove("hidden"); googleApiKeyTextInput.classList.add("hidden"); - + vscode.postMessage({ + type: "executeDownload", + }); + executableContainer.classList.remove("hidden"); } if (!isExecutableDownloadPending) { isExecutableDownloadPending = false; @@ -1290,6 +1296,7 @@ function handleTriggerMessage(event) { apiKeyCross.classList.add("hidden"); apiKeyTick.classList.remove("hidden"); googleApiKeyTextInput.classList.add("hidden"); + executableContainer.classList.remove("hidden"); allStepsCompleted(); break; case 'githubLoggedIn': @@ -1297,6 +1304,8 @@ function handleTriggerMessage(event) { githubCross.classList.add("hidden"); githubTick.classList.remove("hidden"); githubLogin.classList.add("hidden"); + apiKeyContainer.classList.remove("hidden"); + executableContainer.classList.add("hidden"); allStepsCompleted(); break; case 'cleanUpEventListener': diff --git a/vscode/src/providers/chat_view_provider.ts b/vscode/src/providers/chat_view_provider.ts index 1cfb749f..37a6c2e4 100644 --- a/vscode/src/providers/chat_view_provider.ts +++ b/vscode/src/providers/chat_view_provider.ts @@ -180,6 +180,17 @@ export class FlutterGPTViewProvider implements vscode.WebviewViewProvider { this._fetchAgentsAPI(); break; } + case "executeDownload": + { + this.setupManager.pendingSetupSteps.forEach((steps: SetupStep) => { + if (steps === SetupStep.executable) { + this.setupManager.setupExecutable((progress: number) => { + this.postMessageToWebview({ type: 'executableDownloadProgress', value: progress }); + }); + } + }); + break; + } } }); this._fetchAgentsAPI(true); @@ -330,18 +341,8 @@ export class FlutterGPTViewProvider implements vscode.WebviewViewProvider { private async _setupManager() { - this.setupManager.pendingSetupSteps.forEach((steps: SetupStep) => { - if (steps === SetupStep.executable) { - this.setupManager.setupExecutable((progress: number) => { - this.postMessageToWebview({ type: 'executableDownloadProgress', value: progress }); - }); - } - }); - this._view?.webview.postMessage({ type: 'pendingSteps', value: JSON.stringify(this.setupManager.pendingSetupSteps) }); - // this.setupManager.deleteGithub(); - this.setupManager.onDidChangeSetup(event => { switch (event) { case SetupStep.github: @@ -351,6 +352,13 @@ export class FlutterGPTViewProvider implements vscode.WebviewViewProvider { case SetupStep.apiKey: console.log('apikey'); this._view?.webview.postMessage({ type: 'apiKeySet' }); + this.setupManager.pendingSetupSteps.forEach((steps: SetupStep) => { + if (steps === SetupStep.executable) { + this.setupManager.setupExecutable((progress: number) => { + this.postMessageToWebview({ type: 'executableDownloadProgress', value: progress }); + }); + } + }); break; case SetupStep.executable: console.log('executable');