From 2515bd2fbd976977b17b72c47e952a926d341ebe Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Tue, 13 May 2025 17:42:57 +0530 Subject: [PATCH] [WEB-3978] chore: cmd k search result redirection improvements (#3126) * chore: ce sync changes * chore: code refactor * chore: cmd-K search result redirection improvement * chore: code refactor * chore: code refactor * chore: code refactor * chore: code refactor * chore: code refactor --------- Co-authored-by: Prateek Shourya --- .../command-palette/actions/search-results.tsx | 8 ++++++++ web/ee/components/sidebar/project-navigation-root.tsx | 2 ++ web/styles/globals.css | 11 +++++++++++ 3 files changed, 21 insertions(+) diff --git a/web/ee/components/command-palette/actions/search-results.tsx b/web/ee/components/command-palette/actions/search-results.tsx index 6b6e63ad70..2c8f1ecf67 100644 --- a/web/ee/components/command-palette/actions/search-results.tsx +++ b/web/ee/components/command-palette/actions/search-results.tsx @@ -1,6 +1,8 @@ "use client"; import { Command } from "cmdk"; +// components +import { openProjectAndScrollToSidebar } from "@/components/command-palette/actions/helper"; // hooks import { useAppRouter } from "@/hooks/use-app-router"; // plane web helpers @@ -32,6 +34,12 @@ export const PagesAppCommandPaletteSearchResults: React.FC = (props) => { onSelect={() => { closePalette(); router.push(currentSection.path(item, undefined)); + 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" diff --git a/web/ee/components/sidebar/project-navigation-root.tsx b/web/ee/components/sidebar/project-navigation-root.tsx index ed2df08600..3282fb771f 100644 --- a/web/ee/components/sidebar/project-navigation-root.tsx +++ b/web/ee/components/sidebar/project-navigation-root.tsx @@ -39,6 +39,7 @@ export const ProjectNavigationRoot: FC = observer((props const additionalNavigationItems = (workspaceSlug: string, projectId: string): TNavigationItem[] => [ { name: "Overview", + key: "overview", href: `/${workspaceSlug}/projects/${projectId}/overview/`, icon: RssIcon, access: [EUserProjectRoles.ADMIN, EUserProjectRoles.MEMBER], @@ -49,6 +50,7 @@ export const ProjectNavigationRoot: FC = observer((props }, { name: "Epics", + key: "epics", href: `/${workspaceSlug}/projects/${projectId}/epics`, icon: EpicIcon, access: [EUserProjectRoles.ADMIN, EUserProjectRoles.MEMBER], diff --git a/web/styles/globals.css b/web/styles/globals.css index 7e44cd0f5a..d91c22de77 100644 --- a/web/styles/globals.css +++ b/web/styles/globals.css @@ -1322,3 +1322,14 @@ input[type="color"].custom-color-picker { --ease-in-out-expo: cubic-bezier(1, 0, 0, 1); --ease-in-out-circ: cubic-bezier(0.785, 0.135, 0.15, 0.86); } + +@keyframes highlight { + 0% { + background-color: rgba(var(--color-background-90), 1); + border-radius: 4px; + } + 100% { + background-color: transparent; + border-radius: 4px; + } +}