Workspaces layout, automation page

This commit is contained in:
2026-02-18 17:04:32 +00:00
parent 89f23f9426
commit 485ae4c3d7
89 changed files with 2168 additions and 514 deletions
@@ -1,52 +1,24 @@
import { useUserState } from '@/state/useUserState';
import { WorkspaceView } from '@/components/Workspace';
import { useState } from 'react';
import type { LayoutNode } from '@/components/Workspace';
import { widgetRegistry } from '@/Screens/Dashboard/Workspaces/widget-registry';
import { WorkspaceLayout } from '@/components/Workspace';
import { appRegistry } from '../Workspaces/app-registry';
const DEFAULT_HOME_LAYOUT: LayoutNode = {
const initialLayout: LayoutNode = {
type: 'group',
id: 'home-root',
direction: 'horizontal',
direction: 'vertical',
children: [
{
size: 50,
node: {
type: 'group',
id: 'home-left',
direction: 'vertical',
children: [
{ size: 50, node: { type: 'panel', id: 'home-tl', widgetType: null } },
{ size: 50, node: { type: 'panel', id: 'home-bl', widgetType: null } },
],
},
},
{
size: 50,
node: {
type: 'group',
id: 'home-right',
direction: 'vertical',
children: [
{ size: 50, node: { type: 'panel', id: 'home-tr', widgetType: null } },
{ size: 50, node: { type: 'panel', id: 'home-br', widgetType: null } },
],
},
},
{ node: { type: 'panel', id: 'homepage-widget-panel', appType: 'widget-panel' }, size: 60 },
{ node: { type: 'panel', id: 'home-bottom', appType: 'chat-launcher' }, size: 40 },
],
};
export const HomeScreen = () => {
const [layout, setLayout] = useUserState<LayoutNode>('home-workspace-layout', DEFAULT_HOME_LAYOUT);
const [layout, setLayout] = useState<LayoutNode>(initialLayout);
return (
<div className="h-full w-full">
<WorkspaceView
workspace={null}
name="Home"
layout={layout}
onLayoutChange={setLayout}
registry={widgetRegistry}
/>
<WorkspaceLayout layout={layout} onLayoutChange={setLayout} registry={appRegistry} />
</div>
);
};