Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
fix(open-knowledge): project switcher dropdown not opening in desktop app (#1621)
Andrew Mikofalvyfb38a81dea4b
diff --git a/.changeset/fix-project-switcher-dropdown-open.md b/.changeset/fix-project-switcher-dropdown-open.mdnew file mode 100644index 000000000..44b3c915f--- /dev/null+++ b/.changeset/fix-project-switcher-dropdown-open.md@@ -0,0 +1,9 @@+---+"@inkeep/open-knowledge": patch+"@inkeep/open-knowledge-core": patch+"@inkeep/open-knowledge-server": patch+"@inkeep/open-knowledge-app": patch+"@inkeep/open-knowledge-desktop": patch+---++Fix the project switcher in the sidebar footer not opening in the macOS desktop app. Clicking it showed a press state but the dropdown never opened. A Radix tooltip recently added to the trigger (to show the project path on hover) interfered with the menu on the desktop host: once the tooltip had opened on hover, clicking the trigger raced the tooltip's teardown against the menu's open, so the menu never stayed open. The trigger no longer uses a Radix tooltip — the full project path is shown via a native tooltip instead — and the menu opens reliably.diff --git a/packages/app/src/components/ProjectSwitcher.test.ts b/packages/app/src/components/ProjectSwitcher.test.tsindex 015a2405c..02a15d246 100644--- a/packages/app/src/components/ProjectSwitcher.test.ts+++ b/packages/app/src/components/ProjectSwitcher.test.ts@@ -207,3 +207,18 @@ describe('Recent-projects search affordance (source-level guards)', () => {expect(div).toMatch(/overscroll-contain/);});});++describe('macOS dropdown-open regression guard (no Radix Tooltip on the trigger)', () => {+ const SRC_PATH = join(__dirname, 'ProjectSwitcher.tsx');+ const src = readFileSync(SRC_PATH, 'utf-8');++ test('trigger is not wrapped in a Radix Tooltip; project path uses native title', () => {+ expect(src).not.toContain("from '@/components/ui/tooltip'");+ expect(src).not.toMatch(/<TooltipTrigger\b/);+ const triggerTag = src.match(+ /<SidebarMenuButton\b[\s\S]*?data-testid="project-switcher-trigger"[\s\S]*?>/,+ )?.[0];+ expect(triggerTag, 'project switcher trigger button not found').toBeTruthy();+ expect(triggerTag).toMatch(/title=\{bridge\.config\.projectPath\}/);+ });+});diff --git a/packages/app/src/components/ProjectSwitcher.tsx b/packages/app/src/components/ProjectSwitcher.tsxindex e0bf77a67..bb16adfeb 100644--- a/packages/app/src/components/ProjectSwitcher.tsx+++ b/packages/app/src/components/ProjectSwitcher.tsx@@ -11,7 +11,6 @@ import {} from '@/components/ui/dropdown-menu';import { InputGroup, InputGroupAddon, InputGroupInput } from '@/components/ui/input-group';import { SidebarMenuButton } from '@/components/ui/sidebar';-import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';import { useCurrentBranch } from '@/hooks/use-current-branch';import type { OkDesktopBridge, RecentProjectEntry } from '@/lib/desktop-bridge-types';import { runWithToast as runWithToastBase } from '@/lib/error-state';@@ -94,37 +93,43 @@ export function ProjectSwitcher({ bridge }: ProjectSwitcherProps) {if (!next) setSearch('');}}>- <Tooltip>- <TooltipTrigger asChild>- <DropdownMenuTrigger asChild>- <SidebarMenuButton- className={cn(- 'justify-between text-sidebar-foreground/70 hover:text-sidebar-foreground! data-open:hover:text-sidebar-foreground!',- branch !== null && 'h-auto py-1.5',- )}- data-testid="project-switcher-trigger"- aria-label={t`Open project menu`}- >- <span className="flex min-w-0 flex-col gap-0.5">- <span className="truncate">{bridge.config.projectName}</span>- {branch !== null ? (- <span- className="flex min-w-0 items-center gap-1 text-xs text-sidebar-foreground/50 group-hover/menu-button:text-sidebar-foreground"- data-testid="project-switcher-branch"- >- <GitBranch aria-hidden="true" className="size-3! shrink-0" />- <span className="truncate">{branch}</span>- </span>- ) : null}+ {/*+ Bare trigger — do NOT wrap in a Radix <Tooltip>. The project path is+ surfaced via the native `title` attribute instead. A Radix Tooltip+ here breaks the dropdown: once the tooltip has opened on hover,+ clicking the trigger races the tooltip layer's pointerdown-teardown+ against the dropdown's open on the macOS desktop host, and the menu+ never stays open (the trigger shows its click state but nothing+ opens). The native title has no layer to tear down, so the dropdown+ opens cleanly. This is the mirror of the EditorHeader Open-with-AI+ trigger, which is bare for the same class of pointer-interaction+ reason.+ */}+ <DropdownMenuTrigger asChild>+ <SidebarMenuButton+ className={cn(+ 'justify-between text-sidebar-foreground/70 hover:text-sidebar-foreground! data-open:hover:text-sidebar-foreground!',+ branch !== null && 'h-auto py-1.5',+ )}+ data-testid="project-switcher-trigger"+ aria-label={t`Open project menu`}+ title={bridge.config.projectPath}+ >+ <span className="flex min-w-0 flex-col gap-0.5">+ <span className="truncate">{bridge.config.projectName}</span>+ {branch !== null ? (+ <span+ className="flex min-w-0 items-center gap-1 text-xs text-sidebar-foreground/50 group-hover/menu-button:text-sidebar-foreground"+ data-testid="project-switcher-branch"+ >+ <GitBranch aria-hidden="true" className="size-3! shrink-0" />+ <span className="truncate">{branch}</span></span>- <ChevronsUpDown aria-hidden="true" className="opacity-60" />- </SidebarMenuButton>- </DropdownMenuTrigger>- </TooltipTrigger>- <TooltipContent side="right" className="max-w-xs break-all">- {bridge.config.projectPath}- </TooltipContent>- </Tooltip>+ ) : null}+ </span>+ <ChevronsUpDown aria-hidden="true" className="opacity-60" />+ </SidebarMenuButton>+ </DropdownMenuTrigger><DropdownMenuContentalign="start"side="top"