From d04979ab46b9a619f69a52e40a207601621aadf1 Mon Sep 17 00:00:00 2001 From: Connor Yoh Date: Fri, 22 Aug 2025 10:47:43 +0100 Subject: [PATCH] remove redundant code --- .../src/contexts/ToolNavigationContext.tsx | 85 ------------------- 1 file changed, 85 deletions(-) delete mode 100644 frontend/src/contexts/ToolNavigationContext.tsx diff --git a/frontend/src/contexts/ToolNavigationContext.tsx b/frontend/src/contexts/ToolNavigationContext.tsx deleted file mode 100644 index 6a4fb4825..000000000 --- a/frontend/src/contexts/ToolNavigationContext.tsx +++ /dev/null @@ -1,85 +0,0 @@ -// /** -// * ToolNavigationContext - Handles tool selection and navigation without tool registry -// * This breaks the circular dependency by not importing the tool registry -// */ - -// import React, { createContext, useContext, useState, useCallback } from 'react'; -// import { useFileContext } from './FileContext'; - -// // Navigation state interface -// interface ToolNavigationState { -// selectedToolKey: string | null; -// } - -// // Context value interface -// interface ToolNavigationContextValue extends ToolNavigationState { -// // Navigation Actions -// selectTool: (toolKey: string) => void; -// clearToolSelection: () => void; -// handleToolSelect: (toolId: string) => void; -// } - -// const ToolNavigationContext = createContext(undefined); - -// // Provider component -// interface ToolNavigationProviderProps { -// children: React.ReactNode; -// } - -// export function ToolNavigationProvider({ children }: ToolNavigationProviderProps) { -// const [selectedToolKey, setSelectedToolKey] = useState(null); -// const { setCurrentView } = useFileContext(); - -// const selectTool = useCallback((toolKey: string) => { -// setSelectedToolKey(toolKey); -// }, []); - -// const clearToolSelection = useCallback(() => { -// setSelectedToolKey(null); -// }, []); - -// const handleToolSelect = useCallback((toolId: string) => { -// // Handle special cases -// if (toolId === 'allTools') { -// clearToolSelection(); -// return; -// } - -// selectTool(toolId); -// setCurrentView('fileEditor'); -// }, [selectTool, setCurrentView, clearToolSelection]); - -// const contextValue: ToolNavigationContextValue = { -// selectedToolKey, -// selectTool, -// clearToolSelection, -// handleToolSelect -// }; - -// return ( -// -// {children} -// -// ); -// } - -// // Custom hook to use the context -// export function useToolNavigation(): ToolNavigationContextValue { -// const context = useContext(ToolNavigationContext); -// if (!context) { -// // During development hot reload, temporarily return a safe fallback -// if (process.env.NODE_ENV === 'development') { -// console.warn('ToolNavigationContext temporarily unavailable during hot reload, using fallback'); - -// return { -// selectedToolKey: null, -// selectTool: () => {}, -// clearToolSelection: () => {}, -// handleToolSelect: () => {} -// } as ToolNavigationContextValue; -// } - -// throw new Error('useToolNavigation must be used within a ToolNavigationProvider'); -// } -// return context; -// }