diff --git a/frontend/src/components/ui/WorkspaceTabs.jsx b/frontend/src/components/ui/WorkspaceTabs.jsx index cdac51ae..db422c29 100644 --- a/frontend/src/components/ui/WorkspaceTabs.jsx +++ b/frontend/src/components/ui/WorkspaceTabs.jsx @@ -2,11 +2,16 @@ import { useEffect, useState } from "react"; import { Tabs, TabList, Tab, TabPanels, TabPanel } from "@carbon/react"; import { workspaceAtom } from "@/atoms/pipelineAtom"; import { useImmerAtom } from "jotai-immer"; +import { useAtom } from "jotai"; +import { drawflowEditorAtom } from "@/atoms/drawflowAtom"; export default function WorkspaceTabs() { const [workspace, setWorkspace] = useImmerAtom(workspaceAtom); const [renderedTabs, setRenderedTabs] = useState([]); const [selectedIndex, setSelectedIndex] = useState(0); + const [zoomLevels, setZoomLevels] = useState({}); + + const [editor] = useAtom(drawflowEditorAtom); useEffect(() => { const pipelineTabs = []; @@ -27,9 +32,20 @@ export default function WorkspaceTabs() { const handleTabChange = (evt) => { const index = evt.selectedIndex; const key = renderedTabs[index]?.id; + + setZoomLevels((prevZoomLevels) => ({ + ...prevZoomLevels, + [workspace.active]: editor?.zoom, + })); + setWorkspace((draft) => { draft.active = key; }); + + if (editor) { + editor.zoom = zoomLevels[key] ?? 1; + editor.zoom_refresh(); // Refresh after setting zoom, *required. + } }; const handleCloseTabRequest = (deleteIndex) => { diff --git a/translator.go b/translator.go index 1ad707bb..6d97df44 100644 --- a/translator.go +++ b/translator.go @@ -204,9 +204,26 @@ func blockTemplate(block *zjson.Block, blockKey string, key string, organization Image: image, Command: block.Action.Container.CommandLine, ImagePullPolicy: "IfNotPresent", + VolumeMounts: []corev1.VolumeMount{ + { + Name: "dshm", + MountPath: "/dev/shm", + }, + }, }, Inputs: wfv1.Inputs{Artifacts: []wfv1.Artifact{entrypoint, computations}}, Metadata: wfv1.Metadata{Annotations: idMap}, + Volumes: []corev1.Volume{ + { + //https://stackoverflow.com/questions/46085748/define-size-for-dev-shm-on-container-engine + Name: "dshm", + VolumeSource: corev1.VolumeSource{ + EmptyDir: &corev1.EmptyDirVolumeSource{ + Medium: "Memory", + }, + }, + }, + }, } }