Skip to content

Commit 14570e7

Browse files
committed
added fit to view in canvas context menu
1 parent 06782a8 commit 14570e7

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/context-menu/pane-context-menu.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export function PaneContextMenu({
2323
onPaste,
2424
onAddBlock,
2525
onAutoLayout,
26+
onFitToView,
2627
onOpenLogs,
2728
onToggleVariables,
2829
onToggleChat,
@@ -115,6 +116,14 @@ export function PaneContextMenu({
115116
<span>Auto-layout</span>
116117
<span className='ml-auto opacity-70 group-hover:opacity-100'>⇧L</span>
117118
</PopoverItem>
119+
<PopoverItem
120+
onClick={() => {
121+
onFitToView()
122+
onClose()
123+
}}
124+
>
125+
Fit to View
126+
</PopoverItem>
118127

119128
{/* View actions */}
120129
<PopoverDivider />

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/context-menu/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export interface PaneContextMenuProps {
7676
onPaste: () => void
7777
onAddBlock: () => void
7878
onAutoLayout: () => void
79+
onFitToView: () => void
7980
onOpenLogs: () => void
8081
onToggleVariables: () => void
8182
onToggleChat: () => void

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3347,6 +3347,7 @@ const WorkflowContent = React.memo(() => {
33473347
onPaste={handleContextPaste}
33483348
onAddBlock={handleContextAddBlock}
33493349
onAutoLayout={handleAutoLayout}
3350+
onFitToView={() => fitViewToBounds({ padding: 0.1, duration: 300 })}
33503351
onOpenLogs={handleContextOpenLogs}
33513352
onToggleVariables={handleContextToggleVariables}
33523353
onToggleChat={handleContextToggleChat}

0 commit comments

Comments
 (0)