diff --git a/client/src/telemetry/constants.ts b/client/src/telemetry/constants.ts index 8d06c7baa8c9..505463538c96 100644 --- a/client/src/telemetry/constants.ts +++ b/client/src/telemetry/constants.ts @@ -20,6 +20,7 @@ export const PLAYGROUND = "play_action"; export const AI_EXPLAIN = "ai_explain"; export const MENU = Object.freeze({ + CLICK_LINK: "menu_click_link", CLICK_MENU: "menu_click_menu", CLICK_SUBMENU: "menu_click_submenu", }); diff --git a/client/src/ui/molecules/main-menu/index.tsx b/client/src/ui/molecules/main-menu/index.tsx index a0e44062a0e3..6af28855a65e 100644 --- a/client/src/ui/molecules/main-menu/index.tsx +++ b/client/src/ui/molecules/main-menu/index.tsx @@ -7,6 +7,8 @@ import { PlusMenu } from "../plus-menu"; import "./index.scss"; import { PLUS_IS_ENABLED } from "../../../env"; import { useLocale } from "../../../hooks"; +import { useGleanClick } from "../../../telemetry/glean-context"; +import { MENU } from "../../../telemetry/constants"; export default function MainMenu({ isOpenOnMobile }) { const locale = useLocale(); @@ -79,22 +81,33 @@ export default function MainMenu({ isOpenOnMobile }) { toggleMenu={toggleMenu} /> )} -
  • - - Blog - -
  • -
  • - - Play - -
  • -
  • - - AI Help Beta - -
  • + Blog + Play + + AI Help Beta + ); } + +function TopLevelMenuLink({ + to, + children, +}: { + to: string; + children: React.ReactNode; +}) { + const gleanClick = useGleanClick(); + return ( +
  • + gleanClick(`${MENU.CLICK_LINK}: top-level -> ${to}`)} + > + {children} + +
  • + ); +}