@@ -20,7 +20,7 @@ import EditNodeDialog from '@/views/agentflowsv2/EditNodeDialog'
2020import { flowContext } from '@/store/context/ReactFlowContext'
2121
2222// icons
23- import { IconMagnetFilled , IconMagnetOff } from '@tabler/icons-react'
23+ import { IconMagnetFilled , IconMagnetOff , IconArtboard , IconArtboardOff } from '@tabler/icons-react'
2424
2525const nodeTypes = { agentFlow : AgentFlowNode , stickyNote : StickyNote , iteration : IterationNode }
2626const edgeTypes = { agentFlow : AgentFlowEdge }
@@ -42,6 +42,7 @@ const MarketplaceCanvasV2 = () => {
4242 const [ editNodeDialogOpen , setEditNodeDialogOpen ] = useState ( false )
4343 const [ editNodeDialogProps , setEditNodeDialogProps ] = useState ( { } )
4444 const [ isSnappingEnabled , setIsSnappingEnabled ] = useState ( false )
45+ const [ isBackgroundEnabled , setIsBackgroundEnabled ] = useState ( true )
4546
4647 const reactFlowWrapper = useRef ( null )
4748 const { setReactFlowInstance } = useContext ( flowContext )
@@ -136,8 +137,18 @@ const MarketplaceCanvasV2 = () => {
136137 >
137138 { isSnappingEnabled ? < IconMagnetFilled /> : < IconMagnetOff /> }
138139 </ button >
140+ < button
141+ className = 'react-flow__controls-button react-flow__controls-interactive'
142+ onClick = { ( ) => {
143+ setIsBackgroundEnabled ( ! isBackgroundEnabled )
144+ } }
145+ title = 'toggle background'
146+ aria-label = 'toggle background'
147+ >
148+ { isBackgroundEnabled ? < IconArtboard /> : < IconArtboardOff /> }
149+ </ button >
139150 </ Controls >
140- < Background color = '#aaa' gap = { 16 } />
151+ { isBackgroundEnabled && < Background color = '#aaa' gap = { 16 } /> }
141152 < EditNodeDialog
142153 show = { editNodeDialogOpen }
143154 dialogProps = { editNodeDialogProps }
0 commit comments