diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index eefddf351..e2bbbd57d 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -121,7 +121,6 @@ export default function GenericNode({ }, [flowPool, data.id]); const showNode = data.showNode ?? true; - const pinned = data.node?.pinned ?? false; const nameEditable = data.node?.flow || data.type === "CustomComponent"; @@ -161,7 +160,7 @@ export default function GenericNode({ const getIconPlayOrPauseComponent = (name, className) => ( ); @@ -180,15 +179,18 @@ export default function GenericNode({ return "red-status"; } else if (!validationStatus && buildStatus === BuildStatus.TO_BUILD) { return "green-status"; - } else if (buildStatus === BuildStatus.BUILDING) { - return "status-build-animation"; } else { - return "green-status"; + return "yellow-status"; } }; - const isDark = useDarkStore((state) => state.dark); - console.log(isDark); + const renderIconStatusComponents = ( + buildStatus: BuildStatus | undefined, + validationStatus: validationStatusType | null + ) => { + const className = getStatusClassName(buildStatus, validationStatus); + return <>{getIconPlayOrPauseComponent("CircleDot", className)}; + }; const renderIconPlayOrPauseComponents = ( buildStatus: BuildStatus | undefined, validationStatus: validationStatusType | null @@ -196,8 +198,12 @@ export default function GenericNode({ if (buildStatus === BuildStatus.BUILDING) { return ; } else { - const className = getStatusClassName(buildStatus, validationStatus); - return <>{getIconPlayOrPauseComponent("Play", className)}; + return ( + + ); } }; @@ -450,72 +456,18 @@ export default function GenericNode({ {showNode && ( - )} - {showNode && ( - )} +
+ Building... + ) : !validationStatus ? ( + Build to validate status. + ) : ( +
+ {typeof validationStatus.params === "string" + ? `${durationString}\n${validationStatus.params}` + .split("\n") + .map((line, index) =>
{line}
) + : durationString} +
+ ) + } + > +
+ {renderIconStatusComponents( + data?.buildStatus, + validationStatus + )} +
+
+
diff --git a/src/frontend/src/components/IOInputField/index.tsx b/src/frontend/src/components/IOInputField/index.tsx index c499bd551..0b1afa52d 100644 --- a/src/frontend/src/components/IOInputField/index.tsx +++ b/src/frontend/src/components/IOInputField/index.tsx @@ -63,7 +63,7 @@ export default function IOInputField({ } } return ( -
+
{inputType} {handleInputType()}
diff --git a/src/frontend/src/components/IOOutputView/index.tsx b/src/frontend/src/components/IOOutputView/index.tsx index fdae4b6b3..da37d34ee 100644 --- a/src/frontend/src/components/IOOutputView/index.tsx +++ b/src/frontend/src/components/IOOutputView/index.tsx @@ -44,7 +44,7 @@ export default function IOOutputView({ } } return ( -
+
{outputType} {handleOutputType()}
diff --git a/src/frontend/src/components/IOview/index.tsx b/src/frontend/src/components/IOview/index.tsx index 7e3e24f76..9fc109e21 100644 --- a/src/frontend/src/components/IOview/index.tsx +++ b/src/frontend/src/components/IOview/index.tsx @@ -10,6 +10,7 @@ import IconComponent from "../genericIconComponent"; import NewChatView from "../newChatView"; import { Badge } from "../ui/badge"; import { Button } from "../ui/button"; +import { Tabs, TabsContent, TabsList, TabsTrigger } from "../ui/tabs"; export default function IOView({ children, open, setOpen }): JSX.Element { const inputs = useFlowStore((state) => state.inputs).filter( @@ -67,123 +68,147 @@ export default function IOView({ children, open, setOpen }): JSX.Element { haveChat ? "w-2/6" : "w-full" )} > -
-
- {inputs.length > 0 && ( - - )} - {outputs.length > 0 && ( - - )} + { + setSelectedTab(Number(value)); + }} + > +
+ + {inputs.length > 0 && ( + Inputs + )} + {outputs.length > 0 && ( + Outputs + )} +
- {selectedViewField && haveChat && ( - - )} -
-
- {selectedTab === 1 && ( - <> - + + +
+ Text Inputs - - )} - {selectedTab === 2 && ( - <> - - Prompt Outputs - - )} -
- {nodes - .filter((node) => - selectedTab === 1 - ? inputs.some((input) => input.id === node.id) - : outputs.some((output) => output.id === node.id) - ) - .map((node, index) => { - const input = - selectedTab === 1 - ? inputs.find((input) => input.id === node.id)! - : outputs.find((output) => output.id === node.id)!; - return ( -
- - - {input.id} - - {haveChat && ( -
{ - event.stopPropagation(); - setSelectedViewField(input); - }} - > - +
+ {nodes + .filter((node) => + inputs.some((input) => input.id === node.id) + ) + .map((node, index) => { + const input = inputs.find( + (input) => input.id === node.id + )!; + return ( +
+ + + {input.id} + + {haveChat && ( +
{ + event.stopPropagation(); + setSelectedViewField(input); + }} + > + +
+ )}
- )} -
- } - key={index} - keyValue={input.id} - > -
-
- {input && - (selectedTab === 1 ? ( - - ) : ( - - ))} -
+ } + key={index} + keyValue={input.id} + > +
+
+ {input && ( + + )} +
+
+
- -
- ); - })} + ); + })} + + +
+ + Prompt Outputs +
+ {nodes + .filter((node) => + outputs.some((output) => output.id === node.id) + ) + .map((node, index) => { + const output = outputs.find( + (output) => output.id === node.id + )!; + return ( +
+ + + {output.id} + + {haveChat && ( +
{ + event.stopPropagation(); + setSelectedViewField(output); + }} + > + +
+ )} +
+ } + key={index} + keyValue={output.id} + > +
+
+ {output && ( + + )} +
+
+ +
+ ); + })} + +
)} diff --git a/src/frontend/src/constants/constants.ts b/src/frontend/src/constants/constants.ts index b9422efab..c1eaa999d 100644 --- a/src/frontend/src/constants/constants.ts +++ b/src/frontend/src/constants/constants.ts @@ -681,4 +681,4 @@ export const LANGFLOW_SUPPORTED_TYPES = new Set([ export const priorityFields = new Set(["code", "template"]); export const INPUT_TYPES = new Set(["ChatInput", "TextInput"]); -export const OUTPUT_TYPES = new Set(["ChatOutput"]); +export const OUTPUT_TYPES = new Set(["ChatOutput", "PromptTemplate"]); diff --git a/src/frontend/src/modals/genericModal/index.tsx b/src/frontend/src/modals/genericModal/index.tsx index 44173057f..2f7a07905 100644 --- a/src/frontend/src/modals/genericModal/index.tsx +++ b/src/frontend/src/modals/genericModal/index.tsx @@ -255,7 +255,7 @@ export default function GenericModal({ >
diff --git a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx index fe8eed37c..cac19cc16 100644 --- a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx @@ -25,7 +25,7 @@ import { expandGroupNode, updateFlowPosition, } from "../../../../utils/reactflowUtils"; -import { classNames } from "../../../../utils/utils"; +import { classNames, cn } from "../../../../utils/utils"; export default function NodeToolbarComponent({ data, @@ -60,6 +60,7 @@ export default function NodeToolbarComponent({ const isMinimal = numberOfHandles <= 1; const isGroup = data.node?.flow ? true : false; + const pinned = data.node?.pinned ?? false; const paste = useFlowStore((state) => state.paste); const nodes = useFlowStore((state) => state.nodes); const edges = useFlowStore((state) => state.edges); @@ -107,6 +108,9 @@ export default function NodeToolbarComponent({ takeSnapshot(); setShowNode(data.showNode ?? true ? false : true); break; + case "Share": + if (hasApiKey || hasStore) setShowconfirmShare(true); + break; case "Download": downloadNode(flowComponent!); break; @@ -269,22 +273,35 @@ export default function NodeToolbarComponent({ - {hasStore && ( - - - - )} + /> + +