Skip to content

Commit 332e4af

Browse files
authored
SY-4416: Separate Nav Slice and Componentry from Layout in Console (#2534)
1 parent 5f4f00c commit 332e4af

128 files changed

Lines changed: 3394 additions & 1819 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

configs/eslint/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ const config: Linter.Config[] = [
152152
typescript: {}, // this loads <rootdir>/tsconfig.json to eslint
153153
node: { extensions: [".js", ".jsx", ".ts", ".tsx"] },
154154
},
155-
react: { version: "^18.0.0" },
155+
react: { version: "19.0.0" },
156156
},
157157
},
158158
{

console/src/arc/Toolbar.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import { EXPLORER_LAYOUT } from "@/arc/Explorer";
3030
import { useRename, useTask } from "@/arc/hooks";
3131
import { EmptyAction, Toolbar } from "@/components";
3232
import { CSS } from "@/css";
33+
import { type Service } from "@/layered/service";
3334
import { Layout } from "@/layout";
3435

3536
interface EmptyContentProps {
@@ -147,7 +148,7 @@ const Actions = ({ handleCreate }: ActionsProps): ReactElement | null => {
147148
);
148149
};
149150

150-
export const TOOLBAR: Layout.NavDrawerItem = {
151+
export const TOOLBAR: Service.Nav.Item = {
151152
key: "arc",
152153
icon: <Icon.Arc />,
153154
content: <Content />,

console/src/arc/editor/graph/Editor.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
setViewportMode,
2323
} from "@/arc/slice";
2424
import { ContextMenu as CMenu, Controls as BaseControls } from "@/components";
25+
import { Session } from "@/layered/session";
2526
import { Layout } from "@/layout";
2627

2728
export const ContextMenu: Layout.ContextMenuRenderer = ({ layoutKey }) => (
@@ -65,8 +66,7 @@ export const Editor: Layout.Renderer = ({ layoutKey, visible }): ReactElement =>
6566
[dispatch],
6667
);
6768
const handleDoubleClick = useCallback(() => {
68-
if (!state.graph.editable) return;
69-
dispatch(Layout.setNavDrawerVisible({ key: "visualization", value: true }));
69+
dispatch(Session.Nav.showBottom({}));
7070
}, [state.graph.editable, dispatch]);
7171

7272
const renderExtraMenuItems = useCallback(

console/src/auth/LoginNav.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@
1010
import { Nav, OS } from "@synnaxlabs/pluto";
1111
import { type ReactElement } from "react";
1212

13-
import { Layout } from "@/layout";
13+
import { Service } from "@/layered/service";
1414
import { Version } from "@/version";
1515

1616
export const LoginNav = (): ReactElement => {
1717
const os = OS.use();
1818
return (
19-
<Layout.Nav.Bar location="top" size="6.5rem" bordered data-tauri-drag-region>
19+
<Service.Nav.Bar location="top" size="6.5rem" bordered data-tauri-drag-region>
2020
<Nav.Bar.Start data-tauri-drag-region>
21-
<Layout.Controls visibleIfOS="macOS" forceOS={os} />
21+
<Service.Window.Controls visibleIfOS="macOS" forceOS={os} />
2222
</Nav.Bar.Start>
2323
<Nav.Bar.End data-tauri-drag-region justify="end">
2424
<Version.Badge />
25-
<Layout.Controls visibleIfOS="Windows" forceOS={os} />
25+
<Service.Window.Controls visibleIfOS="Windows" forceOS={os} />
2626
</Nav.Bar.End>
27-
</Layout.Nav.Bar>
27+
</Service.Nav.Bar>
2828
);
2929
};

console/src/channel/services/Toolbar.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { type ReactElement } from "react";
1414
import { CALCULATED_LAYOUT } from "@/channel/calculatedLayout";
1515
import { CREATE_LAYOUT } from "@/channel/Create";
1616
import { EmptyAction, Toolbar } from "@/components";
17+
import { type Service } from "@/layered/service";
1718
import { Layout } from "@/layout";
1819
import { Ontology } from "@/ontology";
1920

@@ -67,7 +68,7 @@ const EmptyContent = (): ReactElement => {
6768
);
6869
};
6970

70-
export const TOOLBAR: Layout.NavDrawerItem = {
71+
export const TOOLBAR: Service.Nav.Item = {
7172
key: "channel",
7273
icon: <Icon.Channel />,
7374
content: <Content />,

console/src/cluster/services/logout.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@
1010
import { type Dispatch } from "@reduxjs/toolkit";
1111

1212
import { Cluster } from "@/cluster";
13+
import { Session } from "@/layered/session";
1314
import { Layout } from "@/layout";
1415
import { Project } from "@/project";
1516

1617
export const logout = (dispatch: Dispatch) => {
1718
dispatch(Cluster.setActive(null));
1819
dispatch(Project.setActive(null));
1920
dispatch(Layout.clearProject());
20-
dispatch(Layout.hideAllNavDrawers());
21+
dispatch(Session.Nav.hideAll({}));
2122
};

console/src/hardware/device/Toolbar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { Access, Device, Icon } from "@synnaxlabs/pluto";
1212
import { type ReactElement } from "react";
1313

1414
import { Toolbar } from "@/components";
15-
import { type Layout } from "@/layout";
15+
import { type Service } from "@/layered/service";
1616
import { Ontology } from "@/ontology";
1717

1818
const Content = (): ReactElement => {
@@ -27,7 +27,7 @@ const Content = (): ReactElement => {
2727
);
2828
};
2929

30-
export const TOOLBAR: Layout.NavDrawerItem = {
30+
export const TOOLBAR: Service.Nav.Item = {
3131
key: "device",
3232
icon: <Icon.Device />,
3333
content: <Content />,

console/src/hardware/device/external.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { LabJack } from "@/hardware/labjack";
1414
import { Modbus } from "@/hardware/modbus";
1515
import { NI } from "@/hardware/ni";
1616
import { OPC } from "@/hardware/opc";
17+
import { type Service } from "@/layered/service";
1718
import { type Layout } from "@/layout";
1819
import { type Palette } from "@/palette";
1920

@@ -38,4 +39,4 @@ export const LAYOUTS: Record<string, Layout.Renderer> = {
3839
...OPC.Device.LAYOUTS,
3940
};
4041

41-
export const NAV_DRAWER_ITEMS: Layout.NavDrawerItem[] = [TOOLBAR];
42+
export const NAV_DRAWER_ITEMS: Service.Nav.Item[] = [TOOLBAR];

console/src/hardware/external.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { type Export } from "@/export";
1111
import { Device } from "@/hardware/device";
1212
import { Task } from "@/hardware/task";
1313
import { type Import } from "@/import";
14+
import { type Service } from "@/layered/service";
1415
import { type Layout } from "@/layout";
1516
import { type Link } from "@/link";
1617
import { type Notifications } from "@/notifications";
@@ -37,7 +38,7 @@ export const LINK_HANDLERS: Record<string, Link.Handler> = {
3738
task: Task.handleLink,
3839
};
3940

40-
export const NAV_DRAWER_ITEMS: Layout.NavDrawerItem[] = [
41+
export const NAV_DRAWER_ITEMS: Service.Nav.Item[] = [
4142
...Device.NAV_DRAWER_ITEMS,
4243
...Task.NAV_DRAWER_ITEMS,
4344
];

console/src/hardware/task/Toolbar.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import { SELECTOR_LAYOUT } from "@/hardware/task/Selector";
3939
import { getIcon, parseType } from "@/hardware/task/types";
4040
import { useRangeSnapshot } from "@/hardware/task/useRangeSnapshot";
4141
import { useSetDataSaving } from "@/hardware/task/useSetDataSaving";
42+
import { type Service } from "@/layered/service";
4243
import { Layout } from "@/layout";
4344
import { Link } from "@/link";
4445
import { Modals } from "@/modals";
@@ -238,7 +239,7 @@ const Content = () => {
238239
);
239240
};
240241

241-
export const TOOLBAR_NAV_DRAWER_ITEM: Layout.NavDrawerItem = {
242+
export const TOOLBAR: Service.Nav.Item = {
242243
key: "task",
243244
icon: <Icon.Task />,
244245
content: <Content />,

0 commit comments

Comments
 (0)