Skip to content

Commit 530c435

Browse files
authored
feat(tarko-agent-ui): add webui.layout.enableSidebar config (#1624)
1 parent c8e83ef commit 530c435

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

multimodal/tarko/agent-ui/src/config/web-ui-config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export function getLayoutConfig() {
6767
getWebUIConfig().layout || {
6868
defaultLayout: 'default',
6969
enableLayoutSwitchButton: false,
70+
enableSidebar: true,
7071
}
7172
);
7273
}
@@ -84,3 +85,10 @@ export function isLayoutSwitchButtonEnabled(): boolean {
8485
export function getDefaultLayoutMode() {
8586
return getLayoutConfig().defaultLayout || 'default';
8687
}
88+
89+
/**
90+
* Check if sidebar is enabled
91+
*/
92+
export function isSidebarEnabled(): boolean {
93+
return getLayoutConfig().enableSidebar ?? true;
94+
}

multimodal/tarko/agent-ui/src/standalone/app/App.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ import { useReplayMode } from '@/common/hooks/useReplayMode';
77
import { SessionRouter } from './Router/SessionRouter';
88
import { Sidebar } from '@/standalone/sidebar';
99
import { Navbar } from '@/standalone/navbar';
10+
import { isSidebarEnabled } from '@/config/web-ui-config';
1011

1112
export const App: React.FC = () => {
1213
const { initConnectionMonitoring, loadSessions, connectionStatus, activeSessionId } =
1314
useSession();
1415
const { isReplayMode } = useReplayMode();
16+
const sidebarEnabled = isSidebarEnabled();
1517

1618
useEffect(() => {
1719
if (isReplayMode) {
@@ -44,7 +46,7 @@ export const App: React.FC = () => {
4446
console.log('[ReplayMode] Rendering replay layout directly');
4547
return (
4648
<div className="flex h-screen bg-[#F2F3F5] dark:bg-gray-900 text-gray-900 dark:text-gray-100 overflow-hidden">
47-
<Sidebar />
49+
{sidebarEnabled && <Sidebar />}
4850
<div className="flex-1 flex flex-col overflow-hidden">
4951
<Navbar />
5052
<Layout isReplayMode={true} />
@@ -59,7 +61,7 @@ export const App: React.FC = () => {
5961
path="/"
6062
element={
6163
<div className="flex h-screen bg-[#F2F3F5] dark:bg-gray-900 text-gray-900 dark:text-gray-100 overflow-hidden">
62-
<Sidebar />
64+
{sidebarEnabled && <Sidebar />}
6365
<div className="flex-1 flex flex-col overflow-hidden">
6466
<HomePage />
6567
</div>
@@ -70,7 +72,7 @@ export const App: React.FC = () => {
7072
path="/:sessionId"
7173
element={
7274
<div className="flex h-screen bg-[#F2F3F5] dark:bg-gray-900 text-gray-900 dark:text-gray-100 overflow-hidden">
73-
<Sidebar />
75+
{sidebarEnabled && <Sidebar />}
7476
<div className="flex-1 flex flex-col overflow-hidden">
7577
<Navbar />
7678
<SessionRouter>

multimodal/tarko/interface/src/web-ui-implementation.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ export interface LayoutConfig {
6161
* @defaultValue false
6262
*/
6363
enableLayoutSwitchButton?: boolean;
64+
/**
65+
* Enable sidebar display
66+
* @defaultValue true
67+
*/
68+
enableSidebar?: boolean;
6469
}
6570

6671
/**

0 commit comments

Comments
 (0)