diff --git a/src/frontend/src/App.css b/src/frontend/src/App.css index 095c63bd7..c2427fb0f 100644 --- a/src/frontend/src/App.css +++ b/src/frontend/src/App.css @@ -90,3 +90,11 @@ body { .jv-indent::-webkit-scrollbar-thumb:hover { background-color: #bbb !important; } + +.custom-hover { + transition: background-color 0.5s ease; +} + +.custom-hover:hover { + background-color: rgba(99, 102, 241, 0.1); /* Medium indigo color with 20% opacity */ +} \ No newline at end of file diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index ddfc04aef..a580684ac 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -509,10 +509,10 @@ export default function GenericNode({ ) : !validationStatus ? ( {STATUS_BUILD} ) : ( -
+
{lastRunTime && ( -
+
{RUN_TIMESTAMP_PREFIX}
{lastRunTime} @@ -520,19 +520,19 @@ export default function GenericNode({
)}
-
+
Duration:
-
+
{validationStatus?.data.duration}

- + Output -
+
{validationString.split("\n").map((line, index) => ( -
{line}
+
{line}
))}
diff --git a/src/frontend/src/components/chatComponent/index.tsx b/src/frontend/src/components/chatComponent/index.tsx index da612340a..15e13fc15 100644 --- a/src/frontend/src/components/chatComponent/index.tsx +++ b/src/frontend/src/components/chatComponent/index.tsx @@ -1,14 +1,26 @@ -import { useEffect, useRef, useState } from "react"; +import { useEffect, useMemo, useRef, useState } from "react"; import useFlowStore from "../../stores/flowStore"; import { ChatType } from "../../types/chat"; import IOView from "../IOview"; import ChatTrigger from "../ViewTriggers/chat"; +import { Transition } from "@headlessui/react"; +import ForwardedIconComponent from "../genericIconComponent"; +import { Separator } from "../ui/separator"; +import ShareModal from "../../modals/shareModal"; +import { useStoreStore } from "../../stores/storeStore"; +import useFlowsManagerStore from "../../stores/flowsManagerStore"; +import { classNames } from "../../utils/utils"; +import ApiModal from "../../modals/ApiModal"; export default function Chat({ flow }: ChatType): JSX.Element { const [open, setOpen] = useState(false); const flowState = useFlowStore((state) => state.flowState); const nodes = useFlowStore((state) => state.nodes); const hasIO = useFlowStore((state) => state.hasIO); + const hasStore = useStoreStore((state) => state.hasStore); + const validApiKey = useStoreStore((state) => state.validApiKey); + const currentFlow = useFlowsManagerStore((state) => state.currentFlow); + const hasApiKey = useStoreStore((state) => state.hasApiKey); useEffect(() => { const handleKeyDown = (event: KeyboardEvent) => { @@ -29,16 +41,100 @@ export default function Chat({ flow }: ChatType): JSX.Element { const prevNodesRef = useRef(); + const ModalMemo = useMemo( + () => ( + + + + ), + [hasApiKey, validApiKey, currentFlow, hasStore] + ); + return ( <> -
- {/* */} - {hasIO && ( + +
+
+
+ {hasIO && ( - +
+ + Run +
)} +
+ {hasIO && ( +
+ +
+ )} +
+ {currentFlow && currentFlow.data && ( + +
+ + API +
+
+ )} +
+ {hasStore && validApiKey && ( +
+ +
+ )} +
+ {hasStore && validApiKey && ( +
{ModalMemo}
+ )} +
+
+
); } diff --git a/src/frontend/src/components/headerComponent/components/menuBar/index.tsx b/src/frontend/src/components/headerComponent/components/menuBar/index.tsx index 9bff70924..bc5202c87 100644 --- a/src/frontend/src/components/headerComponent/components/menuBar/index.tsx +++ b/src/frontend/src/components/headerComponent/components/menuBar/index.tsx @@ -1,4 +1,4 @@ -import { useState } from "react"; +import { useMemo, useState } from "react"; import { DropdownMenu, DropdownMenuContent, @@ -14,10 +14,13 @@ import FlowSettingsModal from "../../../../modals/flowSettingsModal"; import useAlertStore from "../../../../stores/alertStore"; import useFlowStore from "../../../../stores/flowStore"; import useFlowsManagerStore from "../../../../stores/flowsManagerStore"; -import { cn } from "../../../../utils/utils"; +import { classNames, cn } from "../../../../utils/utils"; import ShadTooltip from "../../../ShadTooltipComponent"; import IconComponent from "../../../genericIconComponent"; import { Button } from "../../../ui/button"; +import { UPLOAD_ERROR_ALERT } from "../../../../constants/alerts_constants"; +import ExportModal from "../../../../modals/exportModal"; +import { useStoreStore } from "../../../../stores/storeStore"; export const MenuBar = ({ removeFunction, @@ -32,9 +35,27 @@ export const MenuBar = ({ const saveLoading = useFlowsManagerStore((state) => state.saveLoading); const [openSettings, setOpenSettings] = useState(false); const n = useFlowStore((state) => state.nodes); - + const uploadFlow = useFlowsManagerStore((state) => state.uploadFlow); + const hasApiKey = useStoreStore((state) => state.hasApiKey); + const validApiKey = useStoreStore((state) => state.validApiKey); const navigate = useNavigate(); const isBuilding = useFlowStore((state) => state.isBuilding); + const [myOpen, mySetOpen] = useState(false) + + const ExportMemo = useMemo( + () => ( + +
+ + Export +
+
+ ), + [] + ); function handleAddFlow() { try { @@ -100,6 +121,30 @@ export const MenuBar = ({ /> Settings + { + uploadFlow({ newProject: false, isComponent: false }).catch( + (error) => { + setErrorData({ + title: UPLOAD_ERROR_ALERT, + list: [error], + }); + } + ); + }} + > + + Import + + {(!hasApiKey || !validApiKey) && ( + +
+ + Export +
+
+ )} { diff --git a/src/frontend/src/modals/exportModal/index.tsx b/src/frontend/src/modals/exportModal/index.tsx index 9fac4d0a8..e10dd6ff6 100644 --- a/src/frontend/src/modals/exportModal/index.tsx +++ b/src/frontend/src/modals/exportModal/index.tsx @@ -16,7 +16,7 @@ import { downloadFlow, removeApiKeys } from "../../utils/reactflowUtils"; import BaseModal from "../baseModal"; const ExportModal = forwardRef( - (props: { children: ReactNode }, ref): JSX.Element => { + (props: { children: ReactNode, myOpen?: boolean, mySetOpen?: (open: boolean) => void }, ref): JSX.Element => { const version = useDarkStore((state) => state.version); const setNoticeData = useAlertStore((state) => state.setNoticeData); const [checked, setChecked] = useState(true); @@ -29,6 +29,10 @@ const ExportModal = forwardRef( const [description, setDescription] = useState(currentFlow!.description); const [open, setOpen] = useState(false); + useEffect(() => { + console.log(open) + }, [open]) + return ( {props.children} diff --git a/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx index 299507bbd..565192709 100644 --- a/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx @@ -235,66 +235,6 @@ export default function ExtraSidebar(): JSX.Element { return (
-
- {hasStore && validApiKey && ( - -
{ModalMemo}
-
- )} -
- - - -
- {(!hasApiKey || !validApiKey) && ( - -
{ExportMemo}
-
- )} - -
- {currentFlow && currentFlow.data && ( - - - - )} -
-
-
-
handleBlur()} @@ -318,7 +258,7 @@ export default function ExtraSidebar(): JSX.Element { />
- +
{Object.keys(dataFilter) .sort(sortKeys) diff --git a/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/sideBarDraggableComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/sideBarDraggableComponent/index.tsx index f33e97a1d..35f646d62 100644 --- a/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/sideBarDraggableComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/sideBarDraggableComponent/index.tsx @@ -43,6 +43,7 @@ export const SidebarDraggableComponent = forwardRef( const deleteComponent = useFlowsManagerStore( (state) => state.deleteComponent ); + console.log(display_name) const version = useDarkStore((state) => state.version); const [cursorPos, setCursorPos] = useState({ x: 0, y: 0 }); const popoverRef = useRef(null); diff --git a/src/frontend/src/style/applies.css b/src/frontend/src/style/applies.css index cca804fc7..348b58f9a 100644 --- a/src/frontend/src/style/applies.css +++ b/src/frontend/src/style/applies.css @@ -114,7 +114,7 @@ @apply pointer-events-none; } .extra-side-bar-buttons { - @apply relative inline-flex w-full items-center justify-center rounded-md bg-background px-2 py-2 text-foreground shadow-sm ring-1 ring-inset ring-input transition-all duration-500 ease-in-out; + @apply relative inline-flex w-full items-center justify-center rounded-md bg-background px-2 py-2 text-foreground transition-all duration-500 ease-in-out; } .extra-side-bar-buttons:hover { @apply hover:bg-muted; diff --git a/src/frontend/src/style/index.css b/src/frontend/src/style/index.css index fb4242661..0c58cb1df 100644 --- a/src/frontend/src/style/index.css +++ b/src/frontend/src/style/index.css @@ -50,6 +50,9 @@ --component-icon: #d8598a; --flow-icon: #2f67d0; + --hover: #F2F4F5; + + /* Colors that are shared in dark and light mode */ --blur-shared: #151923de; @@ -69,6 +72,7 @@ --background: 224 35% 7.5%; /* hsl(224 40% 10%) */ --foreground: 213 31% 80%; /* hsl(213 31% 91%) */ --ice: #60A5FA; + --hover: #1A202E; --muted: 223 27% 11%; /* hsl(223 27% 11%) */ --muted-foreground: 215.4 16.3% 56.9%; /* hsl(215 16% 56%) */ diff --git a/src/frontend/src/utils/styleUtils.ts b/src/frontend/src/utils/styleUtils.ts index dc7115838..340d30ffd 100644 --- a/src/frontend/src/utils/styleUtils.ts +++ b/src/frontend/src/utils/styleUtils.ts @@ -32,6 +32,7 @@ import { Cpu, Database, Delete, + Dot, Download, DownloadCloud, Edit, @@ -475,4 +476,5 @@ export const nodeIconsLucide: iconsType = { Bot, Delete, Command, + Dot, }; diff --git a/src/frontend/tailwind.config.js b/src/frontend/tailwind.config.js index 80a5416c3..540289fc8 100644 --- a/src/frontend/tailwind.config.js +++ b/src/frontend/tailwind.config.js @@ -88,7 +88,7 @@ module.exports = { "chat-bot-icon": "var(--chat-bot-icon)", "chat-user-icon": "var(--chat-user-icon)", "ice": "var(--ice)", - + hover: "var(--hover)", white: "var(--white)", border: "hsl(var(--border))", input: "hsl(var(--input))",