From 8d83fa2185da52bfcfce51060eef96669edd7508 Mon Sep 17 00:00:00 2001 From: Lorenzo Blasa Date: Wed, 22 Mar 2023 11:53:54 -0700 Subject: [PATCH] Control use diagnostics Summary: Current control diagnostics: - Play/Pause - Search - Framework Event Monitoring - Toggle more options Reviewed By: LukeDefeo Differential Revision: D44292835 fbshipit-source-id: c1ef6181141ef47262de8e75abeeb88ffebd4bd6 --- .../ui-debugger/components/Controls.tsx | 19 +++++++++++++++++-- desktop/plugins/public/ui-debugger/index.tsx | 2 -- .../plugins/public/ui-debugger/tracker.tsx | 13 +++++++++++-- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/desktop/plugins/public/ui-debugger/components/Controls.tsx b/desktop/plugins/public/ui-debugger/components/Controls.tsx index 4d415473b..ab48b944e 100644 --- a/desktop/plugins/public/ui-debugger/components/Controls.tsx +++ b/desktop/plugins/public/ui-debugger/components/Controls.tsx @@ -28,6 +28,12 @@ import { } from '@ant-design/icons'; import {usePlugin, useValue, Layout} from 'flipper-plugin'; import {FrameworkEventType} from '../types'; +import {tracker} from '../tracker'; +import {debounce} from 'lodash'; + +const searchTermUpdated = debounce((searchTerm: string) => { + tracker.track('search-term-updated', {searchTerm}); +}, 250); export const Controls: React.FC = () => { const instance = usePlugin(plugin); @@ -42,6 +48,7 @@ export const Controls: React.FC = () => { eventType: FrameworkEventType, monitored: boolean, ) => void = (eventType: FrameworkEventType, monitored: boolean) => { + tracker.track('framework-event-monitored', {eventType, monitored}); instance.uiState.frameworkEventMonitoring.update((draft) => draft.set(eventType, monitored), ); @@ -51,14 +58,21 @@ export const Controls: React.FC = () => { instance.uiState.searchTerm.set(e.target.value)} + onChange={(e) => { + instance.uiState.searchTerm.set(e.target.value); + searchTermUpdated(e.target.value); + }} prefix={} placeholder="Search" />