diff --git a/ui/src/RecentFilesDrawer/MoreActionMenu.tsx b/ui/src/RecentFilesDrawer/MoreActionMenu.tsx index d8c8e01..c9f4e74 100644 --- a/ui/src/RecentFilesDrawer/MoreActionMenu.tsx +++ b/ui/src/RecentFilesDrawer/MoreActionMenu.tsx @@ -11,6 +11,7 @@ import { import { IconCopy, IconDotsVertical, + IconExternalLink, IconLock, IconLockOpen, IconUpload, @@ -19,6 +20,7 @@ import AddTagToWorkflowPopover from "./AddTagToWorkflowPopover"; import { Workflow } from "../types/dbTypes"; import { mediaTable, workflowsTable } from "../db-tables/WorkspaceDB"; import { WorkspaceContext } from "../WorkspaceContext"; +import { openWorkflowInNewTab } from "../utils"; type Props = { workflow: Workflow; @@ -71,7 +73,7 @@ export default function MoreActionMenu({ workflow }: Props) { return ( <> - + Duplicate + } + onClick={() => openWorkflowInNewTab(workflow.id)} + > + Open in new tab + {/* */} setDraggingFile?.(workflow)} borderRadius={6} px={1} - py={"3px"} + py={"5px"} onClick={() => { !isMultiSelecting && loadWorkflowID(workflow.id); }} @@ -53,7 +52,7 @@ export default memo(function WorkflowListItem({ workflow }: Props) { bg: hoverBgColor, }} > - + {!userSettingsTable?.settings?.hideCoverImage && (workflow.coverMediaPath?.length || workflow.latestImage?.length) && ( )} - + - + {workflow.name ?? "untitled"} {workflow.saveLock && ( )} - - - Updated: {formatTimestamp(workflow.updateTime)} - - + ); @@ -91,9 +87,11 @@ export default memo(function WorkflowListItem({ workflow }: Props) { return ( setIsHovering(true)} + onMouseLeave={() => setIsHovering(false)} > {isMultiSelecting ? ( {basicInfoComp} - {isHovering && } +
+ {isHovering ? ( + + ) : ( + + {formatTimestamp(workflow.updateTime, false, false, "/")} + + )} +
)}
diff --git a/ui/src/RecentFilesDrawer/WorkflowListItemActionButtons.tsx b/ui/src/RecentFilesDrawer/WorkflowListItemActionButtons.tsx index 86b093e..8d932d6 100644 --- a/ui/src/RecentFilesDrawer/WorkflowListItemActionButtons.tsx +++ b/ui/src/RecentFilesDrawer/WorkflowListItemActionButtons.tsx @@ -1,8 +1,6 @@ import { Flex, IconButton, Tooltip } from "@chakra-ui/react"; -import { IconExternalLink } from "@tabler/icons-react"; import DeleteConfirm from "../components/DeleteConfirm"; import MoreActionMenu from "./MoreActionMenu"; -import { openWorkflowInNewTab } from "../utils"; import { useContext } from "react"; import { RecentFilesContext } from "../WorkspaceContext"; import { Workflow } from "../types/dbTypes"; @@ -14,17 +12,7 @@ export default function WorkflowListItemActionButtons({ }) { const { onDeleteFlow } = useContext(RecentFilesContext); return ( - - - openWorkflowInNewTab(workflow.id)} - icon={} - /> - - + { diff --git a/ui/src/components/DeleteConfirm.tsx b/ui/src/components/DeleteConfirm.tsx index b5c1948..4efc008 100644 --- a/ui/src/components/DeleteConfirm.tsx +++ b/ui/src/components/DeleteConfirm.tsx @@ -40,7 +40,7 @@ export default function DeleteConfirm(props: Props) { } + icon={} isDisabled={isDisabled} variant={variant} /> diff --git a/ui/src/utils.tsx b/ui/src/utils.tsx index b3fe6ab..1a58475 100644 --- a/ui/src/utils.tsx +++ b/ui/src/utils.tsx @@ -103,6 +103,7 @@ export function formatTimestamp( unixTimestamp: number, showHourMinue: boolean = true, showSec: boolean = false, + splitChar: string = "-", ) { // Create a new Date object from the UNIX timestamp const date = new Date(unixTimestamp); @@ -115,7 +116,7 @@ export function formatTimestamp( const minutes = String(date.getMinutes()).padStart(2, "0"); const seconds = String(date.getSeconds()).padStart(2, "0"); // Format the date and time string - const res = `${month}-${day}-${year}`; + const res = `${month}${splitChar}${day}${splitChar}${year}`; if (showHourMinue) { return res + ` ${hours}:${minutes}`; }