From 3ec66c2b26162786ed47159ae769559d7c2a4443 Mon Sep 17 00:00:00 2001 From: Claas Augner <495429+caugner@users.noreply.github.com> Date: Tue, 22 Oct 2024 22:20:24 +0200 Subject: [PATCH] enhance(telemetry): measure search source + change (#12000) * enhance(telemetry): add id to quick-search measurement * enhance(telemetry): measure initial search input change --- client/src/search.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/src/search.tsx b/client/src/search.tsx index 4f5209528ac3..d6c70d438846 100644 --- a/client/src/search.tsx +++ b/client/src/search.tsx @@ -245,7 +245,7 @@ function InnerSearchNavigateWidget(props: InnerSearchNavigateWidgetProps) { ); const resultClick: React.MouseEventHandler = () => { - gleanClick(quicksearchPing(inputValue)); + gleanClick(quicksearchPing(`${id} -> ${inputValue}`)); }; const { @@ -325,6 +325,8 @@ function InnerSearchNavigateWidget(props: InnerSearchNavigateWidgetProps) { ); }, [resultItems, inputValue]); + const [hasChanged, setHasChanged] = useState(false); + const searchResults = (() => { if (!isOpen || !inputValue.trim()) { return null; @@ -493,6 +495,10 @@ function InnerSearchNavigateWidget(props: InnerSearchNavigateWidgetProps) { onChange(event) { if (event.target instanceof HTMLInputElement) { onChangeInputValue(event.target.value); + if (!hasChanged) { + gleanClick(`quick-search-change: ${id}`); + setHasChanged(true); + } } }, ref: (input) => {