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

This commit is contained in:
yyh 2026-04-18 21:33:13 +08:00 committed by GitHub
parent 0c8acd402a
commit 25dd79fba7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 14 deletions

View File

@ -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 (
<>

View File

@ -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

View File

@ -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