chore: add telemetry to alt-enter (#1805)

This commit is contained in:
Patrick Erichsen 2024-07-22 15:19:56 -07:00 • committed by GitHub
parent b065333912
commit 2185344809
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 5 deletions

View file

@ -136,11 +136,6 @@ function InputToolbar(props: InputToolbarProps) {
)}
<EnterButton
offFocus={props.usingCodebase}
// disabled={
// !active &&
// (!(inputRef.current as any)?.value ||
// typeof client === "undefined")
// }
onClick={(e) => {
props.onEnter({
useCodebase: isMetaEquivalentKeyPressed(e),

View file

@ -53,6 +53,7 @@ import {
getSlashCommandDropdownOptions,
} from "./getSuggestion";
import { ComboBoxItem } from "./types";
import { usePostHog } from "posthog-js/react";
const InputBoxDiv = styled.div`
resize: none;
@ -152,6 +153,8 @@ function TipTapEditor(props: TipTapEditorProps) {
const { saveSession } = useHistory(dispatch);
const posthog = usePostHog();
const inSubmenuRef = useRef<string | undefined>(undefined);
const inDropdownRef = useRef(false);
@ -285,10 +288,13 @@ function TipTapEditor(props: TipTapEditorProps) {
return true;
},
"Alt-Enter": () => {
posthog.capture("gui_use_active_file_enter");
onEnterRef.current({
useCodebase: false,
noContext: useActiveFile,
});
return true;
},
"Cmd-Backspace": () => {