fix(web): make legacy Home redirect permanent (#40492)

This commit is contained in:
yyh
2026-08-11 16:27:57 +08:00
committed by GitHub
parent 84f9b6530e
commit 4175d062f4
3 changed files with 2 additions and 18 deletions
@@ -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: (
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -36,7 +36,7 @@ const nextConfig: NextConfig = {
{
source: '/explore/apps',
destination: '/',
permanent: false,
permanent: true,
},
]
},