From bb4861dbdcc0b6ff5f2c1505767ee73aba1d44b5 Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Tue, 24 Mar 2026 17:24:45 +0100 Subject: [PATCH] =?UTF-8?q?fix(settings):=20remove=20duplicate=20comma=20l?= =?UTF-8?q?istener=20from=20Sidebar=20=E2=80=94=20modal=20handles=20it=20g?= =?UTF-8?q?lobally?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/dashboard/Sidebar.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/components/dashboard/Sidebar.tsx b/components/dashboard/Sidebar.tsx index 4362005..1f9c111 100644 --- a/components/dashboard/Sidebar.tsx +++ b/components/dashboard/Sidebar.tsx @@ -6,7 +6,7 @@ import { usePathname, useRouter } from 'next/navigation' import { listSites, type Site } from '@/lib/api/sites' import { useAuth } from '@/lib/auth/context' import { useSettingsModal } from '@/lib/settings-modal-context' -import { useUnifiedSettings } from '@/lib/unified-settings-context' +// `,` shortcut handled globally by UnifiedSettingsModal import { getUserOrganizations, switchContext, type OrganizationMember } from '@/lib/api/organization' import { setSessionAction } from '@/app/actions/auth' import { logger } from '@/lib/utils/logger' @@ -444,7 +444,6 @@ export default function Sidebar({ const pathname = usePathname() const router = useRouter() const { openSettings } = useSettingsModal() - const { openUnifiedSettings } = useUnifiedSettings() const [sites, setSites] = useState([]) const [orgs, setOrgs] = useState([]) const [pendingHref, setPendingHref] = useState(null) @@ -485,14 +484,11 @@ export default function Sidebar({ if (e.key === '[' && !e.metaKey && !e.ctrlKey && !e.altKey) { e.preventDefault(); toggle() } - // `,` opens unified settings (same as GitHub/Linear) - if (e.key === ',' && !e.metaKey && !e.ctrlKey && !e.altKey) { - e.preventDefault(); openUnifiedSettings() - } + // `,` shortcut is handled globally by UnifiedSettingsModal — not here } document.addEventListener('keydown', handler) return () => document.removeEventListener('keydown', handler) - }, [collapsed, openUnifiedSettings]) + }, [collapsed]) const toggle = useCallback(() => { setCollapsed((prev) => { const next = !prev; localStorage.setItem(SIDEBAR_KEY, String(next)); return next })