From 25dd79fba77978363f51640ce5b43007fccd5fc7 Mon Sep 17 00:00:00 2001 From: yyh <92089059+lyzno1@users.noreply.github.com> Date: Sat, 18 Apr 2026 21:33:13 +0800 Subject: [PATCH] fix(web): remove dynamic import from Goto Anything to restore cmd+k (#35383) --- web/app/(commonLayout)/layout.tsx | 6 +----- .../components/goto-anything/__tests__/index.spec.tsx | 2 +- web/app/components/goto-anything/index.tsx | 11 +++-------- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/web/app/(commonLayout)/layout.tsx b/web/app/(commonLayout)/layout.tsx index 49e9431940..35da7ef792 100644 --- a/web/app/(commonLayout)/layout.tsx +++ b/web/app/(commonLayout)/layout.tsx @@ -5,6 +5,7 @@ import InSiteMessageNotification from '@/app/components/app/in-site-message/noti import AmplitudeProvider from '@/app/components/base/amplitude' import GA, { GaType } from '@/app/components/base/ga' import Zendesk from '@/app/components/base/zendesk' +import { GotoAnything } from '@/app/components/goto-anything' import Header from '@/app/components/header' import HeaderWrapper from '@/app/components/header/header-wrapper' import ReadmePanel from '@/app/components/plugins/readme-panel' @@ -12,15 +13,10 @@ import { AppContextProvider } from '@/context/app-context-provider' import { EventEmitterContextProvider } from '@/context/event-emitter-provider' import { ModalContextProvider } from '@/context/modal-context-provider' import { ProviderContextProvider } from '@/context/provider-context-provider' -import dynamic from '@/next/dynamic' import PartnerStack from '../components/billing/partner-stack' import Splash from '../components/splash' import RoleRouteGuard from './role-route-guard' -const GotoAnything = dynamic(() => import('@/app/components/goto-anything'), { - ssr: false, -}) - const Layout = ({ children }: { children: ReactNode }) => { return ( <> diff --git a/web/app/components/goto-anything/__tests__/index.spec.tsx b/web/app/components/goto-anything/__tests__/index.spec.tsx index b2050ef9fb..39249e0427 100644 --- a/web/app/components/goto-anything/__tests__/index.spec.tsx +++ b/web/app/components/goto-anything/__tests__/index.spec.tsx @@ -3,7 +3,7 @@ import type { ActionItem, SearchResult } from '../actions/types' import { act, render, screen, waitFor } from '@testing-library/react' import userEvent from '@testing-library/user-event' import * as React from 'react' -import GotoAnything from '../index' +import { GotoAnything } from '../index' type TestSearchResult = Omit & { icon?: ReactNode diff --git a/web/app/components/goto-anything/index.tsx b/web/app/components/goto-anything/index.tsx index 13f43ba75a..af6f0a7a9b 100644 --- a/web/app/components/goto-anything/index.tsx +++ b/web/app/components/goto-anything/index.tsx @@ -22,7 +22,7 @@ type Props = { onHide?: () => void } -const GotoAnything: FC = ({ +const GotoAnythingDialog: FC = ({ onHide, }) => { const { t } = useTranslation() @@ -234,15 +234,10 @@ const GotoAnything: FC = ({ ) } -/** - * GotoAnything component with context provider - */ -const GotoAnythingWithContext: FC = (props) => { +export const GotoAnything: FC = (props) => { return ( - + ) } - -export default GotoAnythingWithContext