From c3eab000ecfb73449192449f2412813c6d58f970 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Mon, 8 Jan 2024 13:35:11 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20posthog,=20improve=20quick?= =?UTF-8?q?=20edit=20placeholder=20message?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extensions/vscode/src/commands.ts | 5 ++++- gui/src/hooks/CustomPostHogProvider.tsx | 6 +----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/extensions/vscode/src/commands.ts b/extensions/vscode/src/commands.ts index cb378e9b8..49435ebc5 100644 --- a/extensions/vscode/src/commands.ts +++ b/extensions/vscode/src/commands.ts @@ -149,8 +149,11 @@ const commandsMap: { [command: string]: (...args: any) => any } = { vscode.commands.executeCommand("workbench.action.toggleAuxiliaryBar"); }, "continue.quickEdit": async () => { + const selectionEmpty = vscode.window.activeTextEditor?.selection.isEmpty; const text = await vscode.window.showInputBox({ - placeHolder: "Describe how to edit the highlighted code", + placeHolder: selectionEmpty + ? "Describe the code you want to generate" + : "Describe how to edit the highlighted code", title: "Continue Quick Edit", }); if (text) { diff --git a/gui/src/hooks/CustomPostHogProvider.tsx b/gui/src/hooks/CustomPostHogProvider.tsx index eaace76a3..9b97bad75 100644 --- a/gui/src/hooks/CustomPostHogProvider.tsx +++ b/gui/src/hooks/CustomPostHogProvider.tsx @@ -12,10 +12,7 @@ const CustomPostHogProvider = ({ children }: PropsWithChildren) => { const [client, setClient] = React.useState(undefined); useEffect(() => { - if ( - allowAnonymousTelemetry === true || - allowAnonymousTelemetry === undefined - ) { + if (allowAnonymousTelemetry === true) { posthog.init("phc_JS6XFROuNbhJtVCEdTSYk6gl5ArRrTNMpCcguAXlSPs", { api_host: "https://app.posthog.com", disable_session_recording: true, @@ -24,7 +21,6 @@ const CustomPostHogProvider = ({ children }: PropsWithChildren) => { posthog.opt_in_capturing(); setClient(client); } else { - posthog.opt_out_capturing(); setClient(undefined); } }, [allowAnonymousTelemetry]);