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): make legacy Home redirect permanent (#40492)

yyh4175d062f47d
diff --git a/web/app/components/main-nav/__tests__/index.spec.tsx b/web/app/components/main-nav/__tests__/index.spec.tsx
index 8e68f063fdf..b1cf891b648 100644
--- a/web/app/components/main-nav/__tests__/index.spec.tsx
+++ b/web/app/components/main-nav/__tests__/index.spec.tsx
@@ -971,22 +971,6 @@ describe('MainNav', () => {
expect(homeLink).toHaveClass(activeStackingClassName)
})
- it('keeps Home active on the legacy explore apps route only', () => {
- mockPathname = '/explore/apps'
-
- const { rerender } = renderMainNav()
-
- const homeLink = screen.getByRole('link', { name: /common.mainNav.home/ })
- expect(homeLink).toHaveAttribute('aria-current', 'page')
-
- mockPathname = '/installed/installed-1'
- rerender(<MainNav />)
-
- expect(screen.getByRole('link', { name: /common.mainNav.home/ })).not.toHaveAttribute(
- 'aria-current',
- )
- })
-
it('opens goto anything from the search button', async () => {
renderMainNav(undefined, {
extra: (
diff --git a/web/app/components/main-nav/routes.ts b/web/app/components/main-nav/routes.ts
index 936e8d28c3c..bfd49563a9c 100644
--- a/web/app/components/main-nav/routes.ts
+++ b/web/app/components/main-nav/routes.ts
@@ -42,7 +42,7 @@ export const MAIN_NAV_ROUTES = [
key: 'home',
href: '/',
labelKey: 'mainNav.home',
- active: (path: string) => path === '/' || path === '/explore/apps',
+ active: (path: string) => path === '/',
icon: 'i-custom-vender-main-nav-home',
activeIcon: 'i-custom-vender-main-nav-home-active',
visibility: VISIBLE_TO_ALL,
diff --git a/web/next.config.ts b/web/next.config.ts
index 1446ea34d95..a093cff67a5 100644
--- a/web/next.config.ts
+++ b/web/next.config.ts
@@ -36,7 +36,7 @@ const nextConfig: NextConfig = {
{
source: '/explore/apps',
destination: '/',
- permanent: false,
+ permanent: true,
},
]
},