@@ -286,7 +295,7 @@ const WebAppsSectionContent = () => {
{noResultsMessage}
)}
{webAppRows.length > 0 && (
-
@@ -294,19 +303,45 @@ const WebAppsSectionContent = () => {
const row = webAppRows[virtualRow.index]!
return (
-
setLastFocusedAppId(row.app.id) : undefined
+ }
className="absolute top-0 left-0 w-full"
style={{
height: `${virtualRow.size}px`,
transform: `translateY(${virtualRow.start}px)`,
}}
>
- {renderRow(row)}
-
+ {row.kind === 'separator' ? (
+
+ ) : (
+
{
+ uninstallAppMutation.reset()
+ setUninstallDialogAppId(id)
+ }}
+ />
+ )}
+
)
})}
-
+
)}
{installedAppsQuery.hasNextPage && (
@@ -347,14 +382,20 @@ const WebAppsSectionContent = () => {
- )}
+
{
+ onOpenChange={(open, details) => {
+ if (uninstallAppMutation.isPending) {
+ details.cancel()
+ return
+ }
if (!open) setUninstallDialogAppId(null)
}}
>
-
+ (uninstallAppMutation.isSuccess ? sectionToggleRef.current : true)}
+ >
{t(($) => $['sidebar.delete.title'], { ns: 'explore' })}
@@ -381,6 +422,8 @@ const WebAppsSectionContent = () => {
}
const WebAppsSection = () => {
+ use(browser('The installed apps navigation renders in the browser.'))
+
const workspacePermissionKeys = useAtomValue(workspacePermissionKeysAtom)
const canAccessAppLibrary = hasPermission(workspacePermissionKeys, 'app_library.access')
diff --git a/web/app/components/main-nav/index.tsx b/web/app/components/main-nav/index.tsx
index 0eb7859d3aa..a3b7dfc7c70 100644
--- a/web/app/components/main-nav/index.tsx
+++ b/web/app/components/main-nav/index.tsx
@@ -4,7 +4,7 @@ import type { MainNavItem, MainNavProps } from './types'
import { cn } from '@langgenius/dify-ui/cn'
import { useQuery, useSuspenseQuery } from '@tanstack/react-query'
import { useAtomValue } from 'jotai'
-import { useMemo, useRef } from 'react'
+import { lazy, Suspense, useMemo, useRef } from 'react'
import { useTranslation } from 'react-i18next'
import Badge from '@/app/components/base/badge'
import { DifyLogo } from '@/app/components/base/logo/dify-logo'
@@ -15,7 +15,6 @@ import { userProfileQueryOptions } from '@/features/account-profile/client'
import { isAgentV2Enabled } from '@/features/agent-v2/feature-flag'
import { useCanViewSkills } from '@/features/skills/permissions'
import { systemFeaturesQueryOptions } from '@/features/system-features/client'
-import dynamic from '@/next/dynamic'
import Link from '@/next/link'
import { usePathname } from '@/next/navigation'
import { consoleQuery } from '@/service/console'
@@ -26,7 +25,7 @@ import { MainNavSearchButton } from './components/search-button'
import { WorkspaceCard } from './components/workspace-card'
import { isMainNavRouteVisible, MAIN_NAV_ROUTES } from './routes'
-const WebAppsSection = dynamic(() => import('./components/web-apps-section'), { ssr: false })
+const WebAppsSection = lazy(() => import('./components/web-apps-section'))
export function MainNav({ className, initialPlatform }: MainNavProps) {
const { t } = useTranslation()
@@ -131,7 +130,11 @@ export function MainNav({ className, initialPlatform }: MainNavProps) {
))}
- {!isCurrentWorkspaceDatasetOperator && }
+ {!isCurrentWorkspaceDatasetOperator && (
+
+
+
+ )}
{showEnvTag && (