2026-06-29 07:55:47 +02:00
|
|
|
import React from 'react';
|
2026-07-17 00:52:17 +02:00
|
|
|
import { Outlet, useLocation } from 'react-router-dom';
|
2026-06-29 07:55:47 +02:00
|
|
|
import { Sidebar } from './Sidebar';
|
|
|
|
|
import { TopBar } from './TopBar';
|
2026-07-15 12:22:14 +02:00
|
|
|
import { PluginToolbar } from './PluginToolbar';
|
2026-07-22 01:22:15 +02:00
|
|
|
import { MessageSidebar } from './MessageSidebar';
|
2026-06-29 07:55:47 +02:00
|
|
|
import { ToastContainer } from '@/components/ui/Toast';
|
2026-07-18 11:21:51 +02:00
|
|
|
import { useAIContext } from '@/hooks/useAIContext';
|
2026-07-23 20:13:39 +02:00
|
|
|
import { useAIUIControl } from '@/hooks/useAIUIControl';
|
2026-07-23 19:01:18 +02:00
|
|
|
import { PluginRegistry } from '@/components/plugins/PluginRegistry';
|
2026-07-23 20:13:39 +02:00
|
|
|
import { AIUIControlIndicator } from '@/components/ai-ui-control/AIUIControlIndicator';
|
2026-06-29 07:55:47 +02:00
|
|
|
|
|
|
|
|
export function AppShell() {
|
2026-07-17 00:52:17 +02:00
|
|
|
const location = useLocation();
|
2026-07-18 11:21:51 +02:00
|
|
|
|
|
|
|
|
// Track context for AI Proactive suggestions
|
|
|
|
|
useAIContext();
|
2026-07-17 00:52:17 +02:00
|
|
|
|
2026-07-23 20:13:39 +02:00
|
|
|
// AI UI Control — WebSocket-based UI control from AI agents (Phase 4)
|
|
|
|
|
useAIUIControl();
|
|
|
|
|
|
2026-07-22 01:22:15 +02:00
|
|
|
// Hide message sidebar on the AI Assistant page itself
|
|
|
|
|
const showMessageSidebar = !location.pathname.startsWith('/ai-assistant');
|
2026-07-17 00:52:17 +02:00
|
|
|
|
2026-06-29 07:55:47 +02:00
|
|
|
return (
|
|
|
|
|
<div className="flex h-screen overflow-hidden bg-secondary-50" data-testid="app-shell">
|
2026-07-23 19:01:18 +02:00
|
|
|
<PluginRegistry />
|
2026-06-29 07:55:47 +02:00
|
|
|
<Sidebar />
|
|
|
|
|
<div className="flex-1 flex flex-col overflow-hidden">
|
|
|
|
|
<TopBar />
|
2026-07-15 12:22:14 +02:00
|
|
|
<PluginToolbar />
|
2026-07-17 00:52:17 +02:00
|
|
|
<div className="flex-1 flex overflow-hidden">
|
|
|
|
|
<main
|
|
|
|
|
className="flex-1 overflow-y-auto focus:outline-none"
|
|
|
|
|
tabIndex={-1}
|
|
|
|
|
role="main"
|
|
|
|
|
id="main-content"
|
|
|
|
|
data-testid="content-area"
|
|
|
|
|
>
|
|
|
|
|
<Outlet />
|
|
|
|
|
</main>
|
|
|
|
|
</div>
|
2026-06-29 07:55:47 +02:00
|
|
|
</div>
|
2026-07-22 01:22:15 +02:00
|
|
|
{/* Message Sidebar — full height, right of TopBar and Toolbar */}
|
|
|
|
|
{showMessageSidebar && <MessageSidebar />}
|
2026-07-23 20:13:39 +02:00
|
|
|
<AIUIControlIndicator />
|
2026-06-29 07:55:47 +02:00
|
|
|
<ToastContainer />
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|