Skip to content

Commit 058ae3c

Browse files
Implement Airtable-style unified sidebar navigation
- Add NavigationContext provider for Home/App context switching - Create UnifiedSidebar component with contextual navigation - Update HomeLayout to use AppShell with sidebar - Update ConsoleLayout to use UnifiedSidebar - Move Settings and User profile to pinned bottom area - Add smooth transitions for sidebar content - Remove redundant Home page header navigation - Wrap App with NavigationProvider Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/49a47ba8-e174-4627-a631-a66425a62a98 Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
1 parent 150c920 commit 058ae3c

File tree

6 files changed

+770
-113
lines changed

6 files changed

+770
-113
lines changed

apps/console/src/App.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ const HomeLayout = lazy(() => import('./pages/home/HomeLayout').then(m => ({ def
6262

6363
import { ThemeProvider } from './components/theme-provider';
6464
import { ConsoleToaster } from './components/ConsoleToaster';
65+
import { NavigationProvider } from './context/NavigationContext';
6566

6667
/**
6768
* ConnectedShell
@@ -518,6 +519,7 @@ export function App() {
518519
<ConsoleToaster position="bottom-right" />
519520
<ConditionalAuthWrapper authUrl="/api/v1/auth">
520521
<PreviewBanner />
522+
<NavigationProvider>
521523
<BrowserRouter basename={import.meta.env.BASE_URL?.replace(/\/$/, '') || '/'}>
522524
<Suspense fallback={<LoadingScreen />}>
523525
<Routes>
@@ -569,6 +571,7 @@ export function App() {
569571
</Routes>
570572
</Suspense>
571573
</BrowserRouter>
574+
</NavigationProvider>
572575
</ConditionalAuthWrapper>
573576
</ThemeProvider>
574577
);

apps/console/src/components/ConsoleLayout.tsx

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@
22
* ConsoleLayout
33
*
44
* Root layout shell for the console application. Composes the AppShell
5-
* with the sidebar, header, and main content area.
5+
* with the UnifiedSidebar, header, and main content area.
66
* Includes the global floating chatbot (FAB) widget.
7+
* Sets navigation context to 'app' for app-specific routes.
78
* @module
89
*/
910

10-
import React from 'react';
11+
import React, { useEffect } from 'react';
1112
import { AppShell } from '@object-ui/layout';
1213
import { FloatingChatbot, useObjectChat, type ChatMessage } from '@object-ui/plugin-chatbot';
1314
import { useDiscovery } from '@object-ui/react';
14-
import { AppSidebar } from './AppSidebar';
15+
import { UnifiedSidebar } from './UnifiedSidebar';
1516
import { AppHeader } from './AppHeader';
1617
import { useResponsiveSidebar } from '../hooks/useResponsiveSidebar';
18+
import { useNavigationContext } from '../context/NavigationContext';
1719
import { resolveI18nLabel } from '../utils';
1820
import type { ConnectionState } from '../dataSource';
1921

@@ -88,28 +90,35 @@ function ConsoleFloatingChatbot({ appLabel, objects }: { appLabel: string; objec
8890
);
8991
}
9092

91-
export function ConsoleLayout({
92-
children,
93-
activeAppName,
93+
export function ConsoleLayout({
94+
children,
95+
activeAppName,
9496
activeApp,
9597
onAppChange,
9698
objects,
9799
connectionState
98100
}: ConsoleLayoutProps) {
99101
const appLabel = resolveI18nLabel(activeApp?.label) || activeAppName;
100102
const { isAiEnabled } = useDiscovery();
103+
const { setContext, setCurrentAppName } = useNavigationContext();
104+
105+
// Set navigation context to 'app' when this layout mounts
106+
useEffect(() => {
107+
setContext('app');
108+
setCurrentAppName(activeAppName);
109+
}, [setContext, setCurrentAppName, activeAppName]);
101110

102111
return (
103112
<AppShell
104113
sidebar={
105-
<AppSidebar
106-
activeAppName={activeAppName}
107-
onAppChange={onAppChange}
114+
<UnifiedSidebar
115+
activeAppName={activeAppName}
116+
onAppChange={onAppChange}
108117
/>
109118
}
110119
navbar={
111-
<AppHeader
112-
appName={appLabel}
120+
<AppHeader
121+
appName={appLabel}
113122
objects={objects}
114123
connectionState={connectionState}
115124
/>

0 commit comments

Comments
 (0)