From e8f9894e05c97cdf4957c986a8e4730364b51cff Mon Sep 17 00:00:00 2001 From: Nicole Rappe Date: Tue, 15 Apr 2025 02:06:28 -0600 Subject: [PATCH] Updated Design of Sidebar --- Data/WebUI/src/Node_Sidebar.jsx | 251 +++++++++++--------------------- 1 file changed, 89 insertions(+), 162 deletions(-) diff --git a/Data/WebUI/src/Node_Sidebar.jsx b/Data/WebUI/src/Node_Sidebar.jsx index 02ab345..59a080d 100644 --- a/Data/WebUI/src/Node_Sidebar.jsx +++ b/Data/WebUI/src/Node_Sidebar.jsx @@ -1,6 +1,6 @@ ////////// PROJECT FILE SEPARATION LINE ////////// CODE AFTER THIS LINE ARE FROM: /Data/WebUI/src/Node_Sidebar.jsx -import React from "react"; +import React, { useState } from "react"; import { Accordion, AccordionSummary, @@ -19,17 +19,6 @@ import { Polyline as PolylineIcon } from "@mui/icons-material"; -/** - * Left sidebar for managing workflows and node categories. - * - * Props: - * - categorizedNodes (object of arrays, e.g. { "Category": [{...}, ...], ... }) - * - handleExportFlow() => void - * - handleImportFlow() => void - * - handleOpenCloseAllDialog() => void - * - fileInputRef (ref to hidden file input) - * - onFileInputChange(event) => void - */ export default function NodeSidebar({ categorizedNodes, handleExportFlow, @@ -38,6 +27,12 @@ export default function NodeSidebar({ fileInputRef, onFileInputChange }) { + const [expandedCategory, setExpandedCategory] = useState(null); + + const handleAccordionChange = (category) => (_, isExpanded) => { + setExpandedCategory(isExpanded ? category : null); + }; + return (
+ {/* Workflows Section */} } sx={{ backgroundColor: "#2c2c2c", minHeight: "36px", - "& .MuiAccordionSummary-content": { - margin: 0 - } + "& .MuiAccordionSummary-content": { margin: 0 } }} > - + Workflows - - - + {/* Nodes Section */} } sx={{ backgroundColor: "#2c2c2c", minHeight: "36px", - "& .MuiAccordionSummary-content": { - margin: 0 - } + "& .MuiAccordionSummary-content": { margin: 0 } }} > - + Nodes {Object.entries(categorizedNodes).map(([category, items]) => ( -
- + } sx={{ - bgcolor: "transparent", + bgcolor: "#1e1e1e", px: 2, - py: 0.75, - display: "flex", - justifyContent: "center", - borderColor: "#333" + minHeight: "32px", + "& .MuiAccordionSummary-content": { margin: 0 } }} - variant="fullWidth" > - + {category} - - {items.map((nodeDef) => ( - - {nodeDef.description || "Drag & Drop into Editor"} - - } - placement="right" - arrow - > - - - ))} -
+ startIcon={} + > + {nodeDef.label} + + + + ))} +
+
))} @@ -263,3 +165,28 @@ export default function NodeSidebar({
); } + +const buttonStyle = { + color: "#ccc", + backgroundColor: "#232323", + justifyContent: "flex-start", + pl: 2, + fontSize: "0.9rem", + textTransform: "none", + "&:hover": { + backgroundColor: "#2a2a2a" + } +}; + +const nodeButtonStyle = { + color: "#ccc", + backgroundColor: "#232323", + justifyContent: "space-between", + pl: 2, + pr: 1, + fontSize: "0.9rem", + textTransform: "none", + "&:hover": { + backgroundColor: "#2a2a2a" + } +};