Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix(web): remove dynamic import from Goto Anything to restore cmd+k (#35383)

yyh25dd79fba779
diff --git a/web/app/(commonLayout)/layout.tsx b/web/app/(commonLayout)/layout.tsx
index 49e9431940a..35da7ef7921 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 b2050ef9fbc..39249e04270 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<SearchResult, 'icon' | 'data'> & {
icon?: ReactNode
diff --git a/web/app/components/goto-anything/index.tsx b/web/app/components/goto-anything/index.tsx
index 13f43ba75a7..af6f0a7a9b1 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<Props> = ({
+const GotoAnythingDialog: FC<Props> = ({
onHide,
}) => {
const { t } = useTranslation()
@@ -234,15 +234,10 @@ const GotoAnything: FC<Props> = ({
)
}
-/**
- * GotoAnything component with context provider
- */
-const GotoAnythingWithContext: FC<Props> = (props) => {
+export const GotoAnything: FC<Props> = (props) => {
return (
<GotoAnythingProvider>
- <GotoAnything {...props} />
+ <GotoAnythingDialog {...props} />
</GotoAnythingProvider>
)
}
-
-export default GotoAnythingWithContext