Open-source agentic AI Search Execution Platform. Track AI visibility, find opportunities, and let agents turn signals into prioritized actions and drafted fixes across ChatGPT, Claude, Gemini, Google AI Overviews, Google AI Mode, Perplexity, Grok, and Microsoft Copilot.
TypeScript aeoai-agentai-searchanswer-engine-optimizationbrand-monitoringchatgptclaudecopilotdockergeminigeogoogle-ai-overviewsgrokmcpnextjsopen-sourceperplexityseosupabasetypescript
feat(sidebar): show a Settings gear beside the user's name (#1031)
Cihan8c83f35d7006
diff --git a/web/src/components/layout/user-profile-nav-item.tsx b/web/src/components/layout/user-profile-nav-item.tsxindex 22be579a9..cebfe7a16 100644--- a/web/src/components/layout/user-profile-nav-item.tsx+++ b/web/src/components/layout/user-profile-nav-item.tsx@@ -1,6 +1,8 @@'use client';-import { Link } from '@/i18n/navigation';+import { useTranslations } from 'next-intl';+import { Settings } from 'lucide-react';+import { Link, usePathname } from '@/i18n/navigation';import { cn } from '@/lib/utils';import { useAuthStore } from '@/stores/use-auth-store';import { Avatar, AvatarFallback } from '@/components/ui/avatar';@@ -16,6 +18,10 @@ export function UserProfileNavItem({onClick,className,}: UserProfileNavItemProps) {+ const t = useTranslations('nav');+ const pathname = usePathname();+ // The row is the sidebar's way into Settings, so it marks Settings as current.+ const active = pathname.startsWith('/dashboard/settings');const user = useAuthStore((state) => state.user);const fullName = user?.user_metadata?.full_name;const displayName = typeof fullName === 'string' ? fullName : '';@@ -35,19 +41,38 @@ export function UserProfileNavItem({<Linkhref="/dashboard/settings"onClick={onClick}+ aria-current={active ? 'page' : undefined}className={cn(- 'flex items-center gap-2 rounded-md px-2 py-2 text-sm transition-colors hover:bg-sidebar-accent',+ 'group flex items-center gap-2 rounded-md px-2 py-2 text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50',+ active ? 'bg-primary/10 text-primary' : 'hover:bg-sidebar-accent',collapsed && 'justify-center px-0',className,)}- title={collapsed ? label : undefined}+ title={collapsed ? `${label} · ${t('settings')}` : undefined}>- <Avatar className="h-8 w-8 shrink-0">+ {/* The initials repeat the name, so screen readers skip them. */}+ <Avatar className="h-8 w-8 shrink-0" aria-hidden><AvatarFallback className="bg-primary/10 text-xs font-semibold text-primary">{initials}</AvatarFallback></Avatar>- {!collapsed && <span className="truncate text-sm font-medium capitalize">{label}</span>}+ {!collapsed && (+ <>+ <span className="truncate text-sm font-medium capitalize">{label}</span>+ {/* The whole row opens Settings; the gear says so. */}+ <Settings+ className={cn(+ 'ml-auto h-4 w-4 shrink-0 transition-colors',+ active+ ? 'text-primary'+ : 'text-muted-foreground group-hover:text-foreground group-focus-visible:text-foreground',+ )}+ aria-hidden+ />+ </>+ )}+ {/* Read as "<name>, Settings"; collapsed, the name comes from here too. */}+ <span className="sr-only">{collapsed ? `${label}, ${t('settings')}` : t('settings')}</span></Link>);}