diff --git a/apps/web/core/components/command-palette/actions/search-results.tsx b/apps/web/core/components/command-palette/actions/search-results.tsx index e73ed71f06b..2fd20af8526 100644 --- a/apps/web/core/components/command-palette/actions/search-results.tsx +++ b/apps/web/core/components/command-palette/actions/search-results.tsx @@ -3,6 +3,7 @@ import { Command } from "cmdk"; import { observer } from "mobx-react"; import { useParams } from "next/navigation"; +import type { MouseEvent } from "react"; // plane imports import type { IWorkspaceSearchResults } from "@plane/types"; // hooks @@ -35,28 +36,43 @@ export const CommandPaletteSearchResults: React.FC = observer((props) => if (section.length > 0) { return ( - {section.map((item: any) => ( - { - closePalette(); - router.push(currentSection.path(item, projectId)); - const itemProjectId = - item?.project_id || - (Array.isArray(item?.project_ids) && item?.project_ids?.length > 0 - ? item?.project_ids[0] - : undefined); - if (itemProjectId) openProjectAndScrollToSidebar(itemProjectId); - }} - value={`${key}-${item?.id}-${item.name}-${item.project__identifier ?? ""}-${item.sequence_id ?? ""}`} - className="focus:outline-none" - > -
- {currentSection.icon} -

{currentSection.itemName(item)}

-
-
- ))} + {section.map((item: any) => { + const targetPath = currentSection.path(item, projectId); + const itemProjectId = + item?.project_id || + (Array.isArray(item?.project_ids) && item?.project_ids?.length > 0 + ? item?.project_ids[0] + : undefined); + + const handleMetaClick = (event: MouseEvent) => { + if (!event.metaKey && !event.ctrlKey) return; + + event.preventDefault(); + event.stopPropagation(); + + closePalette(); + window.open(targetPath, "_blank", "noopener,noreferrer"); + }; + + return ( + { + closePalette(); + router.push(targetPath); + if (itemProjectId) openProjectAndScrollToSidebar(itemProjectId); + }} + value={`${key}-${item?.id}-${item.name}-${item.project__identifier ?? ""}-${item.sequence_id ?? ""}`} + className="focus:outline-none" + > +
+ {currentSection.icon} +

{currentSection.itemName(item)}

+
+
+ ); + })}
); }