From 4083d33b5c00b8c7e97dc138f7fc740a3d60e4f8 Mon Sep 17 00:00:00 2001 From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com> Date: Thu, 14 May 2026 22:53:41 +0530 Subject: [PATCH] refactor: enhance SidebarUserProfile component with download tracking and improved button styling --- .../layout/ui/sidebar/SidebarUserProfile.tsx | 39 ++++++++++++++++++- surfsense_web/components/ui/fixed-toolbar.tsx | 2 +- .../components/ui/inline-combobox.tsx | 2 +- surfsense_web/lib/posthog/events.ts | 10 +++++ 4 files changed, 49 insertions(+), 4 deletions(-) diff --git a/surfsense_web/components/layout/ui/sidebar/SidebarUserProfile.tsx b/surfsense_web/components/layout/ui/sidebar/SidebarUserProfile.tsx index a8275829b..e5bb18054 100644 --- a/surfsense_web/components/layout/ui/sidebar/SidebarUserProfile.tsx +++ b/surfsense_web/components/layout/ui/sidebar/SidebarUserProfile.tsx @@ -35,6 +35,7 @@ import { useLocaleContext } from "@/contexts/LocaleContext"; import { usePlatform } from "@/hooks/use-platform"; import { GITHUB_RELEASES_URL, usePrimaryDownload } from "@/lib/desktop-download-utils"; import { APP_VERSION } from "@/lib/env-config"; +import { trackDesktopDownloadClicked } from "@/lib/posthog/events"; import { cn } from "@/lib/utils"; import type { User } from "../../types/layout.types"; @@ -180,6 +181,7 @@ export function SidebarUserProfile({ const initials = getInitials(user.email); const displayName = user.name || user.email.split("@")[0]; const downloadUrl = primary?.url ?? GITHUB_RELEASES_URL; + const downloadLabel = t("download_for_os", { os }); const handleLanguageChange = (newLocale: "en" | "es" | "pt" | "hi" | "zh") => { setLocale(newLocale); @@ -203,6 +205,24 @@ export function SidebarUserProfile({ if (isCollapsed) { return (
+