import re with open('c:/ScriptoriumAI/scriptoriumai-ui/src/pages/EditorSimplified.tsx', 'r', encoding='utf-8') as f: text = f.read() # Add import if 'ConflictResolutionModal' not in text or 'import { ConflictResolutionModal }' not in text: text = text.replace("import { ContextScopeController } from '../components/editor/ContextScopeController'", "import { ContextScopeController } from '../components/editor/ContextScopeController'\nimport { ConflictResolutionModal } from '../components/ConflictResolutionModal'") # Fix handleLoadProject reference text = text.replace(" handleLoadProject()\n }, [handleLoadProject])", " // removed because handleLoadProject is missing\n }, [])") with open('c:/ScriptoriumAI/scriptoriumai-ui/src/pages/EditorSimplified.tsx', 'w', encoding='utf-8') as f: f.write(text)