import re import os def automate_dashboard_setup(): input_filename = "code.html" output_filename = "dashboard.html" # 1. Check if the source file exists if not os.path.exists(input_filename): print(f"❌ Error: '{input_filename}' not found. Please save your Stitch UI code as '{input_filename}' first.") return print(f"Reading {input_filename}...") with open(input_filename, "r", encoding="utf-8") as f: html = f.read() # --- Step 1: Inject IDs into the HTML elements --- print("Injecting IDs for interactivity...") # Inject ID for the Drop Zone & Hidden Input # We look for the dashed border div that acts as the drop zone if 'border-dashed' in html: html = re.sub( r'(