11'use client'
22
33import { useRef , useState } from 'react'
4+ < << << << HEAD
45import { createLogger } from '@sim/logger'
56import { useReactFlow } from 'reactflow'
67import {
78 Button ,
89 ChevronDown ,
10+ = === ===
11+ import { useReactFlow } from 'reactflow'
12+ import {
13+ Button ,
14+ > >>> >>> 72 ae3be5c ( feat ( workflow - controls ) : added action bar for picker / hand / undo / redo / zoom workflow controls , added general setting to disable )
915 Cursor ,
1016 Expand ,
1117 Hand ,
1218 Popover ,
1319 PopoverAnchor ,
1420 PopoverContent ,
1521 PopoverItem ,
22+ < << << << HEAD
1623 PopoverTrigger ,
24+ = === ===
25+ >>> >>> > 72 ae3be5c ( feat ( workflow - controls ) : added action bar for picker / hand / undo / redo / zoom workflow controls , added general setting to disable )
1726 Redo ,
1827 Tooltip ,
1928 Undo ,
@@ -22,19 +31,27 @@ import {
2231} from '@/components/emcn'
2332import { useSession } from '@/lib/auth/auth-client'
2433import { useUpdateGeneralSetting } from '@/hooks/queries/general-settings'
34+ < << << << HEAD
2535import { useCanvasViewport } from '@/hooks/use-canvas-viewport'
36+ = === ===
37+ >>> >>> > 72 ae3be5c ( feat ( workflow - controls ) : added action bar for picker / hand / undo / redo / zoom workflow controls , added general setting to disable )
2638import { useCollaborativeWorkflow } from '@/hooks/use-collaborative-workflow'
2739import { useCanvasModeStore } from '@/stores/canvas-mode'
2840import { useGeneralStore } from '@/stores/settings/general'
2941import { useUndoRedoStore } from '@/stores/undo-redo'
3042import { useWorkflowRegistry } from '@/stores/workflows/registry/store'
3143
44+ < << << << HEAD
3245const logger = createLogger ( 'ActionBar' )
3346
3447export function ActionBar ( ) {
3548 const reactFlowInstance = useReactFlow ( )
3649 const { zoomIn, zoomOut } = reactFlowInstance
3750 const { fitViewToBounds } = useCanvasViewport ( reactFlowInstance )
51+ === = ===
52+ export function ActionBar ( ) {
53+ const { zoomIn, zoomOut, fitView } = useReactFlow ( )
54+ >>> > >>> 72 ae3be5c ( feat ( workflow - controls ) : added action bar for picker / hand / undo / redo / zoom workflow controls , added general setting to disable )
3855 const { mode, setMode } = useCanvasModeStore ( )
3956 const { undo, redo } = useCollaborativeWorkflow ( )
4057 const showActionBar = useGeneralStore ( ( s ) => s . showActionBar )
@@ -50,7 +67,10 @@ export function ActionBar() {
5067 const canRedo = stack . redo . length > 0
5168
5269 const [ contextMenu , setContextMenu ] = useState < { x : number ; y : number } | null > ( null )
70+ << < < << < HEAD
5371 const [ isCanvasModeOpen , setIsCanvasModeOpen ] = useState ( false )
72+ === = ===
73+ >>> > >>> 72 ae3be5c ( feat ( workflow - controls ) : added action bar for picker / hand / undo / redo / zoom workflow controls , added general setting to disable )
5474 const menuRef = useRef < HTMLDivElement > ( null )
5575
5676 const handleContextMenu = ( e : React . MouseEvent ) => {
@@ -59,13 +79,18 @@ export function ActionBar() {
5979 }
6080
6181 const handleHide = async ( ) => {
82+ < < << << < HEAD
6283 try {
6384 await updateSetting . mutateAsync ( { key : 'showActionBar' , value : false } )
6485 } catch ( error ) {
6586 logger . error ( 'Failed to hide action bar' , error )
6687 } finally {
6788 setContextMenu ( null )
6889 }
90+ = === ===
91+ setContextMenu ( null )
92+ await updateSetting . mutateAsync ( { key : 'showActionBar' , value : false } )
93+ >>> > >>> 72 ae3be5c ( feat ( workflow - controls ) : added action bar for picker / hand / undo / redo / zoom workflow controls , added general setting to disable )
6994 }
7095
7196 if ( ! showActionBar ) {
@@ -75,6 +100,7 @@ export function ActionBar() {
75100 return (
76101 < >
77102 < div
103+ < < < << << HEAD
78104 className = '-translate-x-1/2 fixed bottom-[calc(var(--terminal-height)+16px)] left-[calc((100vw+var(--sidebar-width)-var(--panel-width))/2)] z-10 flex h-[36px] items-center gap-[2px] rounded-[8px] border border-[var(--border)] bg-[var(--surface-1)] p-[4px] shadow-sm transition-[left,bottom] duration-100 ease-out'
79105 onContextMenu = { handleContextMenu }
80106 >
@@ -120,14 +146,48 @@ export function ActionBar() {
120146 </ PopoverItem >
121147 </ PopoverContent >
122148 < / P o p o v e r >
149+ === === =
150+ className = 'fixed bottom-[calc(var(--terminal-height)+12px)] left-[calc(var(--sidebar-width)+12px)] z-10 flex h-[36px] items-center gap-[2px] rounded-[8px] border border-[var(--border)] bg-[var(--surface-1)] p-[4px] shadow-sm transition-[left,bottom] duration-100 ease-out'
151+ onContextMenu = { handleContextMenu}
152+ >
153+ < Tooltip . Root >
154+ < Tooltip . Trigger asChild >
155+ < Button
156+ variant = { mode === 'hand' ? 'secondary' : 'ghost' }
157+ className = 'h-[28px] w-[28px] p-0'
158+ onClick = { ( ) => setMode ( 'hand' ) }
159+ >
160+ < Hand className = 'h-[16px] w-[16px]' />
161+ </ Button >
162+ </ Tooltip . Trigger >
163+ < Tooltip . Content side = 'top' > Hand tool</ Tooltip . Content >
164+ </ Tooltip . Root >
165+
166+ < Tooltip . Root >
167+ < Tooltip . Trigger asChild >
168+ < Button
169+ variant = { mode === 'cursor' ? 'secondary' : 'ghost' }
170+ className = 'h-[28px] w-[28px] p-0'
171+ onClick = { ( ) => setMode ( 'cursor' ) }
172+ >
173+ < Cursor className = 'h-[16px] w-[16px]' />
174+ </ Button >
175+ </ Tooltip . Trigger >
176+ < Tooltip . Content side = 'top' > Move < / T o o l t i p .C o n t e n t >
177+ </Tooltip . Root >
178+ >>> > >>> 72 ae3be5c ( feat ( workflow - controls ) : added action bar for picker / hand / undo / redo / zoom workflow controls , added general setting to disable )
123179
124180 < div className = 'mx-[4px] h-[20px] w-[1px] bg-[var(--border)]' / >
125181
126182 < Tooltip . Root >
127183 < Tooltip . Trigger asChild >
128184 < Button
129185 variant = 'ghost'
186+ < << << << HEAD
130187 className = 'h-[28px] w-[28px] rounded-[6px] p-0 hover:bg-[var(--surface-5)]'
188+ = === ===
189+ className = 'h-[28px] w-[28px] p-0'
190+ > >>> >>> 72 ae3be5c ( feat ( workflow - controls ) : added action bar for picker / hand / undo / redo / zoom workflow controls , added general setting to disable )
131191 onClick = { undo}
132192 disabled = { ! canUndo}
133193 >
@@ -143,7 +203,11 @@ export function ActionBar() {
143203 < Tooltip . Trigger asChild >
144204 < Button
145205 variant = 'ghost'
206+ < << << << HEAD
146207 className = 'h-[28px] w-[28px] rounded-[6px] p-0 hover:bg-[var(--surface-5)]'
208+ = === ===
209+ className = 'h-[28px] w-[28px] p-0'
210+ > >>> >>> 72 ae3be5c ( feat ( workflow - controls ) : added action bar for picker / hand / undo / redo / zoom workflow controls , added general setting to disable )
147211 onClick = { redo}
148212 disabled = { ! canRedo}
149213 >
@@ -159,11 +223,15 @@ export function ActionBar() {
159223
160224 < Tooltip . Root >
161225 < Tooltip . Trigger asChild >
226+ < < << << < HEAD
162227 < Button
163228 variant = 'ghost'
164229 className = 'h-[28px] w-[28px] rounded-[6px] p-0 hover:bg-[var(--surface-5)]'
165230 onClick = { ( ) => zoomOut ( ) }
166231 >
232+ =======
233+ < Button variant = 'ghost' className = 'h-[28px] w-[28px] p-0' onClick = { ( ) => zoomOut ( ) } >
234+ >>> >>> > 72 ae3be5c ( feat ( workflow - controls ) : added action bar for picker / hand / undo / redo / zoom workflow controls , added general setting to disable )
167235 < ZoomOut className = 'h-[16px] w-[16px]' />
168236 </ Button >
169237 </ Tooltip . Trigger >
@@ -172,11 +240,15 @@ export function ActionBar() {
172240
173241 < Tooltip . Root >
174242 < Tooltip . Trigger asChild >
243+ < < << << < HEAD
175244 < Button
176245 variant = 'ghost'
177246 className = 'h-[28px] w-[28px] rounded-[6px] p-0 hover:bg-[var(--surface-5)]'
178247 onClick = { ( ) => zoomIn ( ) }
179248 >
249+ =======
250+ < Button variant = 'ghost' className = 'h-[28px] w-[28px] p-0' onClick = { ( ) => zoomIn ( ) } >
251+ >>> >>> > 72 ae3be5c ( feat ( workflow - controls ) : added action bar for picker / hand / undo / redo / zoom workflow controls , added general setting to disable )
180252 < ZoomIn className = 'h-[16px] w-[16px]' />
181253 </ Button >
182254 </ Tooltip . Trigger >
@@ -187,8 +259,13 @@ export function ActionBar() {
187259 < Tooltip . Trigger asChild >
188260 < Button
189261 variant = 'ghost'
262+ < << << << HEAD
190263 className = 'h-[28px] w-[28px] rounded-[6px] p-0 hover:bg-[var(--surface-5)]'
191264 onClick = { ( ) => fitViewToBounds ( { padding : 0.1 , duration : 300 } ) }
265+ = === ===
266+ className = 'h-[28px] w-[28px] p-0'
267+ onClick = { ( ) => fitView ( { padding : 0.3 , duration : 300 } ) }
268+ > >>> >>> 72 ae3be5c ( feat ( workflow - controls ) : added action bar for picker / hand / undo / redo / zoom workflow controls , added general setting to disable )
192269 >
193270 < Expand className = 'h-[16px] w-[16px]' />
194271 < / B u t t o n >
0 commit comments