From cf14ee0111c0eab378550178158e9a81de81db37 Mon Sep 17 00:00:00 2001 From: Nicole Rappe Date: Wed, 30 Apr 2025 23:40:15 -0600 Subject: [PATCH] Added Collapsible Sidebar --- Data/Server/WebUI/src/Borealis.css | 4 +- Data/Server/WebUI/src/Node_Sidebar.jsx | 236 ++++++++++-------- .../WebUI/src/nodes/Agents/Node_Agent.jsx | 14 +- Data/Server/WebUI/tsconfig.json | 47 ++-- 4 files changed, 159 insertions(+), 142 deletions(-) diff --git a/Data/Server/WebUI/src/Borealis.css b/Data/Server/WebUI/src/Borealis.css index 2799c93..b513965 100644 --- a/Data/Server/WebUI/src/Borealis.css +++ b/Data/Server/WebUI/src/Borealis.css @@ -82,7 +82,7 @@ input, select, button { - background-color: #2a2a2a; + background-color: #1d1d1d; color: #ccc; border: 1px solid #444; font-size: 12px; @@ -91,7 +91,7 @@ button { /* Label / Dark Text styling */ label { color: #aaa; - font-size: 10px; + font-size: 9px; } /* ======================================= */ diff --git a/Data/Server/WebUI/src/Node_Sidebar.jsx b/Data/Server/WebUI/src/Node_Sidebar.jsx index f7c5afb..ab0ae68 100644 --- a/Data/Server/WebUI/src/Node_Sidebar.jsx +++ b/Data/Server/WebUI/src/Node_Sidebar.jsx @@ -7,7 +7,8 @@ import { AccordionDetails, Button, Tooltip, - Typography + Typography, + IconButton } from "@mui/material"; import { ExpandMore as ExpandMoreIcon, @@ -15,7 +16,9 @@ import { FileOpen as FileOpenIcon, DeleteForever as DeleteForeverIcon, DragIndicator as DragIndicatorIcon, - Polyline as PolylineIcon + Polyline as PolylineIcon, + ChevronLeft as ChevronLeftIcon, + ChevronRight as ChevronRightIcon } from "@mui/icons-material"; export default function NodeSidebar({ @@ -27,6 +30,7 @@ export default function NodeSidebar({ onFileInputChange }) { const [expandedCategory, setExpandedCategory] = useState(null); + const [collapsed, setCollapsed] = useState(false); const handleAccordionChange = (category) => (_, isExpanded) => { setExpandedCategory(isExpanded ? category : null); @@ -35,132 +39,154 @@ export default function NodeSidebar({ return (
- {/* Workflows Section */} - - } - sx={{ - backgroundColor: "#2c2c2c", - minHeight: "36px", - "& .MuiAccordionSummary-content": { margin: 0 } - }} - > - - Workflows - - - - - - - - - - {/* Nodes Section */} - - } - sx={{ - backgroundColor: "#2c2c2c", - minHeight: "36px", - "& .MuiAccordionSummary-content": { margin: 0 } - }} - > - - Nodes - - - - {Object.entries(categorizedNodes).map(([category, items]) => ( +
+ {!collapsed && ( + <> + {/* Workflows Section */} } sx={{ - bgcolor: "#1e1e1e", - px: 2, - minHeight: "32px", + backgroundColor: "#2c2c2c", + minHeight: "36px", "& .MuiAccordionSummary-content": { margin: 0 } }} > - - {category} + + Workflows - - {items.map((nodeDef) => ( - - {nodeDef.description || "Drag & Drop into Editor"} - - } - placement="right" - arrow + + + + + + + + {/* Nodes Section */} + + } + sx={{ + backgroundColor: "#2c2c2c", + minHeight: "36px", + "& .MuiAccordionSummary-content": { margin: 0 } + }} + > + + Nodes + + + + {Object.entries(categorizedNodes).map(([category, items]) => ( + - - + + {category} + + + + {items.map((nodeDef) => ( + + {nodeDef.description || "Drag & Drop into Editor"} + + } + placement="right" + arrow + > + + + ))} + + ))} - ))} - - - {/* Hidden file input fallback for older browsers */} - + {/* Hidden file input */} + + + )} +
+ + {/* Bottom toggle button */} +
+ + setCollapsed(!collapsed)} + size="small" + sx={{ color: "#888" }} + > + {collapsed ? : } + + +
); } diff --git a/Data/Server/WebUI/src/nodes/Agents/Node_Agent.jsx b/Data/Server/WebUI/src/nodes/Agents/Node_Agent.jsx index 985fd14..3ee2115 100644 --- a/Data/Server/WebUI/src/nodes/Agents/Node_Agent.jsx +++ b/Data/Server/WebUI/src/nodes/Agents/Node_Agent.jsx @@ -104,7 +104,7 @@ const BorealisAgentNode = ({ id, data }) => { > {Object.entries(agents).map(([id, info]) => { - const label = info.status === "provisioned" ? "(Provisioned)" : "(Idle)"; + const label = info.status === "provisioned" ? "(Provisioned)" : "(Not Provisioned)"; return (