Skip to content

Commit 445b351

Browse files
committed
improvement(workflow): move canvas controls into header
1 parent ceb0595 commit 445b351

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/panel.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ import {
2121
useUsageLimits,
2222
} from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/hooks'
2323
import { Variables } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/variables/variables'
24-
import { WorkflowHistoryControls } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-controls/workflow-controls'
24+
import {
25+
WorkflowControls,
26+
WorkflowHistoryControls,
27+
} from '@/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-controls/workflow-controls'
2528
import { WorkflowOptionsMenu } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-controls/workflow-options-menu'
2629
import { useWorkflowExecution } from '@/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution'
2730
import { useFolderMap } from '@/hooks/queries/folders'
@@ -190,6 +193,7 @@ export const Panel = memo(function Panel({ onCloseEditor }: PanelProps) {
190193
<WorkflowOptionsMenu isExecuting={isExecuting} />
191194
</div>
192195
<WorkflowHistoryControls />
196+
<WorkflowControls />
193197
</div>
194198
<div
195199
className={cn(

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-controls/workflow-controls.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export const WorkflowHistoryControls = memo(function WorkflowHistoryControls() {
8888
})
8989

9090
/**
91-
* Floating controls for canvas mode and fit-to-view.
91+
* Header controls for canvas mode and fit-to-view.
9292
*/
9393
export const WorkflowControls = memo(function WorkflowControls() {
9494
const reactFlowInstance = useReactFlow()
@@ -136,7 +136,7 @@ export const WorkflowControls = memo(function WorkflowControls() {
136136
return (
137137
<>
138138
<div
139-
className='absolute bottom-4 left-[16px] z-10 flex h-[36px] items-center gap-0.5 rounded-lg border border-[var(--border)] bg-[var(--surface-1)] p-1'
139+
className='flex h-[36px] flex-shrink-0 items-center gap-0.5 rounded-lg border border-[var(--border)] bg-[var(--surface-1)] p-1'
140140
onContextMenu={handleContextMenu}
141141
>
142142
{/* Canvas Mode Selector */}

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ import {
5555
import { Cursors } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/cursors/cursors'
5656
import { ErrorBoundary } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/error/index'
5757
import { WorkflowSearchReplace } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/search-replace/workflow-search-replace'
58-
import { WorkflowControls } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-controls/workflow-controls'
5958
import {
6059
useAutoLayout,
6160
useCanvasContextMenu,
@@ -4769,7 +4768,6 @@ const WorkflowContent = React.memo(
47694768

47704769
{!embedded && (
47714770
<>
4772-
<WorkflowControls />
47734771
<Suspense fallback={null}>
47744772
<LazyChat />
47754773
</Suspense>

0 commit comments

Comments
 (0)