Просмотр исходного кода

chore(posthog): capture "push to" buttons (#5270)

Xingyao Wang 1 год назад
Родитель
Сommit
0b05c296d8
1 измененных файлов с 7 добавлено и 1 удалено
  1. 7 1
      frontend/src/components/chat-interface.tsx

+ 7 - 1
frontend/src/components/chat-interface.tsx

@@ -186,6 +186,7 @@ export function ChatInterface() {
                           "Please push the changes to a remote branch on GitHub, but do NOT create a pull request.",
                       }}
                       onClick={(value) => {
+                        posthog.capture("push_to_branch_button_clicked");
                         handleSendMessage(value, []);
                       }}
                     />
@@ -196,6 +197,7 @@ export function ChatInterface() {
                           "Please push the changes to GitHub and open a pull request.",
                       }}
                       onClick={(value) => {
+                        posthog.capture("create_pr_button_clicked");
                         handleSendMessage(value, []);
                         setHasPullRequest(true);
                       }}
@@ -209,6 +211,7 @@ export function ChatInterface() {
                         "Please push the latest changes to the existing pull request.",
                     }}
                     onClick={(value) => {
+                      posthog.capture("push_to_pr_button_clicked");
                       handleSendMessage(value, []);
                     }}
                   />
@@ -222,7 +225,10 @@ export function ChatInterface() {
                     : "Downloading, please wait...",
                   value: "Download .zip",
                 }}
-                onClick={handleDownloadWorkspace}
+                onClick={() => {
+                  posthog.capture("download_workspace_button_clicked");
+                  handleDownloadWorkspace();
+                }}
               />
             )}
           </div>