Skip to content

Commit b8c07e5

Browse files
waleedlatif1emir-karabeg
authored andcommitted
ack PR comments
1 parent 2568d7e commit b8c07e5

File tree

2 files changed

+3
-22
lines changed

2 files changed

+3
-22
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/action-bar/action-bar.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ export function ActionBar() {
6161
const handleHide = async () => {
6262
try {
6363
await updateSetting.mutateAsync({ key: 'showActionBar', value: false })
64-
} catch (error) {
65-
logger.error('Failed to hide action bar', error)
6664
} finally {
6765
setContextMenu(null)
6866
}

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

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1939,7 +1939,6 @@ const WorkflowContent = React.memo(() => {
19391939
}
19401940
const handleFocusLoss = () => {
19411941
setIsShiftPressed(false)
1942-
setIsSelectionDragActive(false)
19431942
}
19441943
const handleVisibilityChange = () => {
19451944
if (document.hidden) {
@@ -2858,20 +2857,6 @@ const WorkflowContent = React.memo(() => {
28582857
]
28592858
)
28602859

2861-
// Lock selection mode when selection drag starts (captures Shift state at drag start)
2862-
const onSelectionStart = useCallback(() => {
2863-
if (isShiftPressed) {
2864-
setIsSelectionDragActive(true)
2865-
}
2866-
}, [isShiftPressed])
2867-
2868-
const onSelectionEnd = useCallback(() => {
2869-
requestAnimationFrame(() => {
2870-
setIsSelectionDragActive(false)
2871-
setDisplayNodes((nodes) => resolveParentChildSelectionConflicts(nodes, blocks))
2872-
})
2873-
}, [blocks])
2874-
28752860
/** Captures initial positions when selection drag starts (for marquee-selected nodes). */
28762861
const onSelectionDragStart = useCallback(
28772862
(_event: React.MouseEvent, nodes: Node[]) => {
@@ -3334,9 +3319,9 @@ const WorkflowContent = React.memo(() => {
33343319
edgeTypes={edgeTypes}
33353320
onDrop={effectivePermissions.canEdit ? onDrop : undefined}
33363321
onDragOver={effectivePermissions.canEdit ? onDragOver : undefined}
3337-
onInit={() => {
3322+
onInit={(instance) => {
33383323
requestAnimationFrame(() => {
3339-
fitViewToBounds({ padding: 0.1, maxZoom: 1.0 })
3324+
instance.fitView(reactFlowFitViewOptions)
33403325
setIsCanvasReady(true)
33413326
})
33423327
}}
@@ -3357,11 +3342,9 @@ const WorkflowContent = React.memo(() => {
33573342
onPointerMove={handleCanvasPointerMove}
33583343
onPointerLeave={handleCanvasPointerLeave}
33593344
elementsSelectable={true}
3360-
selectionOnDrag={!isHandMode || isSelectionDragActive}
3345+
selectionOnDrag={!isHandMode}
33613346
selectionMode={SelectionMode.Partial}
33623347
panOnDrag={isHandMode ? [0, 1] : false}
3363-
onSelectionStart={onSelectionStart}
3364-
onSelectionEnd={onSelectionEnd}
33653348
multiSelectionKeyCode={['Meta', 'Control', 'Shift']}
33663349
nodesConnectable={effectivePermissions.canEdit}
33673350
nodesDraggable={effectivePermissions.canEdit}

0 commit comments

Comments
 (0)