Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🔥 feat(sidebar): remove the redundant Pages entry from the home sidebar (#21546)

Lobehub Coder23eaed62054f
diff --git a/src/features/HomeSidebar/Body/CustomizeSidebarModal.tsx b/src/features/HomeSidebar/Body/CustomizeSidebarModal.tsx
index e1a36c2dc7c..8c3eddd2ade 100644
--- a/src/features/HomeSidebar/Body/CustomizeSidebarModal.tsx
+++ b/src/features/HomeSidebar/Body/CustomizeSidebarModal.tsx
@@ -68,7 +68,6 @@ const ALL_SIDEBAR_ITEMS: SidebarItemConfig[] = [
{ id: 'tasks', labelKey: 'tab.tasks', routeId: 'tasks' },
{ id: 'goals', labelKey: 'tab.goals', routeId: 'goals' },
{ id: 'dashboard', labelKey: 'tab.dashboard', routeId: 'dashboard' },
- { id: 'pages', labelKey: 'tab.pages', routeId: 'page' },
{ id: 'recents', labelKey: 'recents' },
{ id: 'project', labelKey: 'project:sidebar.title' },
{ id: 'private', labelKey: 'navPanel.privateAgents' },
diff --git a/src/hooks/useNavLayout.test.tsx b/src/hooks/useNavLayout.test.tsx
index 4f634229a90..1538ff4e606 100644
--- a/src/hooks/useNavLayout.test.tsx
+++ b/src/hooks/useNavLayout.test.tsx
@@ -103,6 +103,18 @@ describe('useNavLayout', () => {
expect(memoryItem?.hidden).not.toBe(true);
});
+ it('does not list Pages, which now lives in Docs', async () => {
+ const { useNavLayout } = await import('./useNavLayout');
+ const { result } = renderHook(() => useNavLayout());
+
+ const navKeys = [...result.current.topNavItems, ...result.current.bottomMenuItems].map(
+ (item) => item.key,
+ );
+
+ expect(navKeys).not.toContain('pages');
+ expect(navKeys).toContain('resource');
+ });
+
it('hides Memory in workspace mode', async () => {
mocks.activeWorkspaceSlug = 'lobe-team';
diff --git a/src/hooks/useNavLayout.ts b/src/hooks/useNavLayout.ts
index af5a1d4604e..ef396d2aa32 100644
--- a/src/hooks/useNavLayout.ts
+++ b/src/hooks/useNavLayout.ts
@@ -111,12 +111,6 @@ export const useNavLayout = (): NavLayout => {
title: t('tab.community'),
url: '/community',
},
- {
- icon: getRouteById('page')!.icon,
- key: SidebarTabKey.Pages,
- title: t('tab.pages'),
- url: '/page',
- },
{
hidden: !!activeWorkspaceSlug,
icon: getRouteById('memory')!.icon,
diff --git a/src/store/global/selectors/systemStatus.test.ts b/src/store/global/selectors/systemStatus.test.ts
index d59e88f1509..a90dad719b9 100644
--- a/src/store/global/selectors/systemStatus.test.ts
+++ b/src/store/global/selectors/systemStatus.test.ts
@@ -358,7 +358,6 @@ describe('systemStatusSelectors', () => {
const items = systemStatusSelectors.sidebarItems(null)(s);
const spacerIdx = items.indexOf(SIDEBAR_SPACER_ID);
// every known key is present
- expect(items).toContain('pages');
expect(items).toContain('tasks');
expect(items).toContain('community');
expect(items).toContain('resource');
@@ -372,7 +371,8 @@ describe('systemStatusSelectors', () => {
expect(items.indexOf('resource')).toBeLessThan(spacerIdx - 3);
// missing bottom-group defaults sit after the spacer
expect(items.indexOf('image')).toBeGreaterThan(spacerIdx);
- expect(items.indexOf('pages')).toBeGreaterThan(spacerIdx);
+ // Pages live in Docs now; the retired entry is not backfilled
+ expect(items).not.toContain('pages');
});
it('should migrate legacy `sidebarSectionOrder` accordion order into the default layout', () => {
@@ -394,7 +394,6 @@ describe('systemStatusSelectors', () => {
SIDEBAR_SPACER_ID,
'image',
'community',
- 'pages',
'memory',
]);
});
@@ -418,7 +417,6 @@ describe('systemStatusSelectors', () => {
SIDEBAR_SPACER_ID,
'image',
'community',
- 'pages',
'memory',
]);
});
diff --git a/src/store/global/selectors/systemStatus.ts b/src/store/global/selectors/systemStatus.ts
index c524acd6da9..72b7ae22acd 100644
--- a/src/store/global/selectors/systemStatus.ts
+++ b/src/store/global/selectors/systemStatus.ts
@@ -205,7 +205,6 @@ export const DEFAULT_SIDEBAR_ITEMS: string[] = [
SIDEBAR_SPACER_ID,
'image',
'community',
- 'pages',
'memory',
];