From e8301fdcd693c9768e0f62a84e46e4e3827c1994 Mon Sep 17 00:00:00 2001 From: Yogesh Choudhary Date: Sat, 10 Aug 2024 13:55:17 +0530 Subject: [PATCH 1/3] Revert "Web app telemetry" --- web/package.json | 2 - .../lib/components/CreateAgentDialog.svelte | 30 +++------- .../components/chat/ChatIntroduction.svelte | 37 +------------ .../lib/components/chat/ChatMessage.svelte | 10 +--- web/src/lib/components/chat/ChatWindow.svelte | 55 +++++++------------ web/src/lib/utils/appInsights.ts | 18 ------ web/src/routes/+page.svelte | 25 +++------ web/src/routes/agent/+page.svelte | 19 +------ 8 files changed, 40 insertions(+), 156 deletions(-) delete mode 100644 web/src/lib/utils/appInsights.ts diff --git a/web/package.json b/web/package.json index 817e30ca..fb98509c 100644 --- a/web/package.json +++ b/web/package.json @@ -35,9 +35,7 @@ "type": "module", "dependencies": { "@lottiefiles/svelte-lottie-player": "^0.3.1", - "@microsoft/applicationinsights-web": "^3.3.1", "@tailwindcss/typography": "^0.5.13", - "dotenv": "^16.4.5", "highlight.js": "^11.10.0", "isomorphic-dompurify": "^2.14.0", "showdown": "^2.1.0", diff --git a/web/src/lib/components/CreateAgentDialog.svelte b/web/src/lib/components/CreateAgentDialog.svelte index 8ce6b99a..f9ad7a5a 100644 --- a/web/src/lib/components/CreateAgentDialog.svelte +++ b/web/src/lib/components/CreateAgentDialog.svelte @@ -4,8 +4,7 @@ import { goto } from "$app/navigation"; import { toastStore } from "$lib/stores/ToastStores"; import { ToastType } from "$lib/types/Toast"; - import appInsights from "$lib/utils/appInsights"; // Import the appInsights instance - import IconClose from "~icons/carbon/close"; + import IconClose from "~icons/carbon/close"; import CarbonSearch from "~icons/carbon/search"; import CarbonGithub from "~icons/carbon/logo-github"; @@ -27,14 +26,6 @@ const onCreateAgent = () => { if (validateGithubURL(value)) { - // Track custom event for form submission - appInsights.trackEvent({ - name: "CreateAgentSubmitted", - properties: { - githubUrl: value, - }, - }); - goto(`${base}/agent?github=${value}`); } else { toastStore.set({ @@ -43,13 +34,6 @@ }); } }; - - $: if (showModal) { - // Track custom event for dialog opened - appInsights.trackEvent({ - name: "CreateAgentDialogOpened", - }); - } {#if showModal} @@ -64,11 +48,11 @@ >
+ class="flex items-center px-2.5 py-1 text-sm text-white" + on:click={onClose} + > + +

Create Agent with Github

-{/if} \ No newline at end of file +{/if} diff --git a/web/src/lib/components/chat/ChatIntroduction.svelte b/web/src/lib/components/chat/ChatIntroduction.svelte index b1d50854..621c484d 100644 --- a/web/src/lib/components/chat/ChatIntroduction.svelte +++ b/web/src/lib/components/chat/ChatIntroduction.svelte @@ -1,7 +1,6 @@
@@ -127,7 +96,6 @@ href="https://marketplace.visualstudio.com/items?itemName=WelltestedAI.fluttergpt" target="_blank" class="flex items-center justify-center w-full md:w-auto h-12 px-6 font-medium text-white transition-colors duration-150 ease-in-out bg-blue-800 rounded-md hover:bg-blue-700 space-x-2 shadow-lg" - on:click={trackLinkClick} >
VSCode
@@ -177,8 +145,7 @@ {#each questionnaires as questionnaire} {/each} diff --git a/web/src/lib/components/chat/ChatMessage.svelte b/web/src/lib/components/chat/ChatMessage.svelte index 8d0e8638..b0aea399 100644 --- a/web/src/lib/components/chat/ChatMessage.svelte +++ b/web/src/lib/components/chat/ChatMessage.svelte @@ -2,7 +2,7 @@ import showdown from "showdown"; import hljs from "highlight.js"; import DOMPurify from "isomorphic-dompurify"; - import appInsights from "$lib/utils/appInsights"; + import { writable } from "svelte/store"; import Icon from "@iconify/svelte"; import IconVisualStudio from "../icons/IconVisualStudio.svelte"; @@ -180,13 +180,6 @@ }, ]; }; - - const trackLinkClick = () => { - appInsights.trackEvent({ - name: 'VSCodeLinkClicked', - - }); - } {#each messages as message, index} @@ -273,7 +266,6 @@ href="https://marketplace.visualstudio.com/items?itemName=WelltestedAI.fluttergpt" target="_blank" class="flex items-center justify-center w-full md:w-auto h-12 px-6 font-medium text-white transition-colors duration-150 ease-in-out bg-blue-800 rounded-md hover:bg-blue-700 space-x-2 shadow-lg" - on:click={trackLinkClick} >
VSCode
diff --git a/web/src/lib/components/chat/ChatWindow.svelte b/web/src/lib/components/chat/ChatWindow.svelte index 453f4a6b..b9f4b420 100644 --- a/web/src/lib/components/chat/ChatWindow.svelte +++ b/web/src/lib/components/chat/ChatWindow.svelte @@ -1,6 +1,5 @@ @@ -70,7 +55,9 @@ {#if loading} {:else if !loading && !currentAgentDetails} -
+

Error:

{errorMessage}

From 7524d13ccbe64b36d57aa28c8df6e3e2ef51f759 Mon Sep 17 00:00:00 2001 From: Samyak Jain <56000318+samyakkkk@users.noreply.github.com> Date: Sat, 10 Aug 2024 17:43:59 +0530 Subject: [PATCH 2/3] Revert "Merge pull request #325 from CommandDash/revert-324-web-app-telemetry" This reverts commit dc0bbd28de25cced761ad330cc000cbfdb541fb4, reversing changes made to 7d1bd221b10a78734ef7cb918a33f378fd0cdfee. --- web/package.json | 2 + .../lib/components/CreateAgentDialog.svelte | 30 +++++++--- .../components/chat/ChatIntroduction.svelte | 37 ++++++++++++- .../lib/components/chat/ChatMessage.svelte | 10 +++- web/src/lib/components/chat/ChatWindow.svelte | 55 ++++++++++++------- web/src/lib/utils/appInsights.ts | 18 ++++++ web/src/routes/+page.svelte | 25 ++++++--- web/src/routes/agent/+page.svelte | 19 ++++++- 8 files changed, 156 insertions(+), 40 deletions(-) create mode 100644 web/src/lib/utils/appInsights.ts diff --git a/web/package.json b/web/package.json index fb98509c..817e30ca 100644 --- a/web/package.json +++ b/web/package.json @@ -35,7 +35,9 @@ "type": "module", "dependencies": { "@lottiefiles/svelte-lottie-player": "^0.3.1", + "@microsoft/applicationinsights-web": "^3.3.1", "@tailwindcss/typography": "^0.5.13", + "dotenv": "^16.4.5", "highlight.js": "^11.10.0", "isomorphic-dompurify": "^2.14.0", "showdown": "^2.1.0", diff --git a/web/src/lib/components/CreateAgentDialog.svelte b/web/src/lib/components/CreateAgentDialog.svelte index f9ad7a5a..8ce6b99a 100644 --- a/web/src/lib/components/CreateAgentDialog.svelte +++ b/web/src/lib/components/CreateAgentDialog.svelte @@ -4,7 +4,8 @@ import { goto } from "$app/navigation"; import { toastStore } from "$lib/stores/ToastStores"; import { ToastType } from "$lib/types/Toast"; - import IconClose from "~icons/carbon/close"; + import appInsights from "$lib/utils/appInsights"; // Import the appInsights instance + import IconClose from "~icons/carbon/close"; import CarbonSearch from "~icons/carbon/search"; import CarbonGithub from "~icons/carbon/logo-github"; @@ -26,6 +27,14 @@ const onCreateAgent = () => { if (validateGithubURL(value)) { + // Track custom event for form submission + appInsights.trackEvent({ + name: "CreateAgentSubmitted", + properties: { + githubUrl: value, + }, + }); + goto(`${base}/agent?github=${value}`); } else { toastStore.set({ @@ -34,6 +43,13 @@ }); } }; + + $: if (showModal) { + // Track custom event for dialog opened + appInsights.trackEvent({ + name: "CreateAgentDialogOpened", + }); + } {#if showModal} @@ -48,11 +64,11 @@ >
+ class="flex items-center px-2.5 py-1 text-sm text-white" + on:click={onClose} + > + +

Create Agent with Github

-{/if} +{/if} \ No newline at end of file diff --git a/web/src/lib/components/chat/ChatIntroduction.svelte b/web/src/lib/components/chat/ChatIntroduction.svelte index 621c484d..b1d50854 100644 --- a/web/src/lib/components/chat/ChatIntroduction.svelte +++ b/web/src/lib/components/chat/ChatIntroduction.svelte @@ -1,6 +1,7 @@
@@ -96,6 +127,7 @@ href="https://marketplace.visualstudio.com/items?itemName=WelltestedAI.fluttergpt" target="_blank" class="flex items-center justify-center w-full md:w-auto h-12 px-6 font-medium text-white transition-colors duration-150 ease-in-out bg-blue-800 rounded-md hover:bg-blue-700 space-x-2 shadow-lg" + on:click={trackLinkClick} >
VSCode
@@ -145,7 +177,8 @@ {#each questionnaires as questionnaire} {/each} diff --git a/web/src/lib/components/chat/ChatMessage.svelte b/web/src/lib/components/chat/ChatMessage.svelte index b0aea399..8d0e8638 100644 --- a/web/src/lib/components/chat/ChatMessage.svelte +++ b/web/src/lib/components/chat/ChatMessage.svelte @@ -2,7 +2,7 @@ import showdown from "showdown"; import hljs from "highlight.js"; import DOMPurify from "isomorphic-dompurify"; - + import appInsights from "$lib/utils/appInsights"; import { writable } from "svelte/store"; import Icon from "@iconify/svelte"; import IconVisualStudio from "../icons/IconVisualStudio.svelte"; @@ -180,6 +180,13 @@ }, ]; }; + + const trackLinkClick = () => { + appInsights.trackEvent({ + name: 'VSCodeLinkClicked', + + }); + } {#each messages as message, index} @@ -266,6 +273,7 @@ href="https://marketplace.visualstudio.com/items?itemName=WelltestedAI.fluttergpt" target="_blank" class="flex items-center justify-center w-full md:w-auto h-12 px-6 font-medium text-white transition-colors duration-150 ease-in-out bg-blue-800 rounded-md hover:bg-blue-700 space-x-2 shadow-lg" + on:click={trackLinkClick} >
VSCode
diff --git a/web/src/lib/components/chat/ChatWindow.svelte b/web/src/lib/components/chat/ChatWindow.svelte index b9f4b420..453f4a6b 100644 --- a/web/src/lib/components/chat/ChatWindow.svelte +++ b/web/src/lib/components/chat/ChatWindow.svelte @@ -1,5 +1,6 @@ @@ -55,9 +70,7 @@ {#if loading} {:else if !loading && !currentAgentDetails} -
+

Error:

{errorMessage}

From a319492dc12fa3ea0eed2a2c6d0fc60180c81be9 Mon Sep 17 00:00:00 2001 From: Samyak Jain <56000318+samyakkkk@users.noreply.github.com> Date: Sat, 10 Aug 2024 17:51:42 +0530 Subject: [PATCH 3/3] (feat): remove app insights --- web/package.json | 2 - .../lib/components/CreateAgentDialog.svelte | 30 +++------- .../components/chat/ChatIntroduction.svelte | 37 +------------ .../lib/components/chat/ChatMessage.svelte | 10 +--- web/src/lib/components/chat/ChatWindow.svelte | 55 +++++++------------ web/src/lib/utils/appInsights.ts | 26 ++++----- web/src/routes/+page.svelte | 25 +++------ web/src/routes/agent/+page.svelte | 19 +------ 8 files changed, 53 insertions(+), 151 deletions(-) diff --git a/web/package.json b/web/package.json index 817e30ca..fb98509c 100644 --- a/web/package.json +++ b/web/package.json @@ -35,9 +35,7 @@ "type": "module", "dependencies": { "@lottiefiles/svelte-lottie-player": "^0.3.1", - "@microsoft/applicationinsights-web": "^3.3.1", "@tailwindcss/typography": "^0.5.13", - "dotenv": "^16.4.5", "highlight.js": "^11.10.0", "isomorphic-dompurify": "^2.14.0", "showdown": "^2.1.0", diff --git a/web/src/lib/components/CreateAgentDialog.svelte b/web/src/lib/components/CreateAgentDialog.svelte index 8ce6b99a..f9ad7a5a 100644 --- a/web/src/lib/components/CreateAgentDialog.svelte +++ b/web/src/lib/components/CreateAgentDialog.svelte @@ -4,8 +4,7 @@ import { goto } from "$app/navigation"; import { toastStore } from "$lib/stores/ToastStores"; import { ToastType } from "$lib/types/Toast"; - import appInsights from "$lib/utils/appInsights"; // Import the appInsights instance - import IconClose from "~icons/carbon/close"; + import IconClose from "~icons/carbon/close"; import CarbonSearch from "~icons/carbon/search"; import CarbonGithub from "~icons/carbon/logo-github"; @@ -27,14 +26,6 @@ const onCreateAgent = () => { if (validateGithubURL(value)) { - // Track custom event for form submission - appInsights.trackEvent({ - name: "CreateAgentSubmitted", - properties: { - githubUrl: value, - }, - }); - goto(`${base}/agent?github=${value}`); } else { toastStore.set({ @@ -43,13 +34,6 @@ }); } }; - - $: if (showModal) { - // Track custom event for dialog opened - appInsights.trackEvent({ - name: "CreateAgentDialogOpened", - }); - } {#if showModal} @@ -64,11 +48,11 @@ >
+ class="flex items-center px-2.5 py-1 text-sm text-white" + on:click={onClose} + > + +

Create Agent with Github

-{/if} \ No newline at end of file +{/if} diff --git a/web/src/lib/components/chat/ChatIntroduction.svelte b/web/src/lib/components/chat/ChatIntroduction.svelte index b1d50854..621c484d 100644 --- a/web/src/lib/components/chat/ChatIntroduction.svelte +++ b/web/src/lib/components/chat/ChatIntroduction.svelte @@ -1,7 +1,6 @@
@@ -127,7 +96,6 @@ href="https://marketplace.visualstudio.com/items?itemName=WelltestedAI.fluttergpt" target="_blank" class="flex items-center justify-center w-full md:w-auto h-12 px-6 font-medium text-white transition-colors duration-150 ease-in-out bg-blue-800 rounded-md hover:bg-blue-700 space-x-2 shadow-lg" - on:click={trackLinkClick} >
VSCode
@@ -177,8 +145,7 @@ {#each questionnaires as questionnaire} {/each} diff --git a/web/src/lib/components/chat/ChatMessage.svelte b/web/src/lib/components/chat/ChatMessage.svelte index 8d0e8638..b0aea399 100644 --- a/web/src/lib/components/chat/ChatMessage.svelte +++ b/web/src/lib/components/chat/ChatMessage.svelte @@ -2,7 +2,7 @@ import showdown from "showdown"; import hljs from "highlight.js"; import DOMPurify from "isomorphic-dompurify"; - import appInsights from "$lib/utils/appInsights"; + import { writable } from "svelte/store"; import Icon from "@iconify/svelte"; import IconVisualStudio from "../icons/IconVisualStudio.svelte"; @@ -180,13 +180,6 @@ }, ]; }; - - const trackLinkClick = () => { - appInsights.trackEvent({ - name: 'VSCodeLinkClicked', - - }); - } {#each messages as message, index} @@ -273,7 +266,6 @@ href="https://marketplace.visualstudio.com/items?itemName=WelltestedAI.fluttergpt" target="_blank" class="flex items-center justify-center w-full md:w-auto h-12 px-6 font-medium text-white transition-colors duration-150 ease-in-out bg-blue-800 rounded-md hover:bg-blue-700 space-x-2 shadow-lg" - on:click={trackLinkClick} >
VSCode
diff --git a/web/src/lib/components/chat/ChatWindow.svelte b/web/src/lib/components/chat/ChatWindow.svelte index 453f4a6b..b9f4b420 100644 --- a/web/src/lib/components/chat/ChatWindow.svelte +++ b/web/src/lib/components/chat/ChatWindow.svelte @@ -1,6 +1,5 @@ @@ -70,7 +55,9 @@ {#if loading} {:else if !loading && !currentAgentDetails} -
+

Error:

{errorMessage}