|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="UTF-8"> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 | + <title>Smart Code Diff - Advanced Code Analysis Platform</title> |
| 7 | + <link rel="stylesheet" href="styles.css"> |
| 8 | + <link rel="preconnect" href="https://fonts.googleapis.com"> |
| 9 | + <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
| 10 | + <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet"> |
| 11 | + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-tomorrow.min.css"> |
| 12 | + <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-core.min.js"></script> |
| 13 | + <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/autoloader/prism-autoloader.min.js"></script> |
| 14 | +</head> |
| 15 | +<body> |
| 16 | + <div class="app"> |
| 17 | + <!-- Header --> |
| 18 | + <header class="header"> |
| 19 | + <div class="header-content"> |
| 20 | + <div class="logo"> |
| 21 | + <div class="logo-icon">🚀</div> |
| 22 | + <h1>Smart Code Diff</h1> |
| 23 | + <span class="version">v2.0</span> |
| 24 | + </div> |
| 25 | + <nav class="nav"> |
| 26 | + <button class="nav-btn active" data-view="explorer"> |
| 27 | + <span class="icon">📁</span> |
| 28 | + Explorer |
| 29 | + </button> |
| 30 | + <button class="nav-btn" data-view="compare"> |
| 31 | + <span class="icon">⚖️</span> |
| 32 | + Compare |
| 33 | + </button> |
| 34 | + <button class="nav-btn" data-view="analysis"> |
| 35 | + <span class="icon">📊</span> |
| 36 | + Analysis |
| 37 | + </button> |
| 38 | + <button class="nav-btn" data-view="settings"> |
| 39 | + <span class="icon">⚙️</span> |
| 40 | + Settings |
| 41 | + </button> |
| 42 | + </nav> |
| 43 | + <div class="header-actions"> |
| 44 | + <button class="btn-secondary" id="healthCheck"> |
| 45 | + <span class="status-indicator" id="healthStatus"></span> |
| 46 | + System Health |
| 47 | + </button> |
| 48 | + </div> |
| 49 | + </div> |
| 50 | + </header> |
| 51 | + |
| 52 | + <!-- Main Content --> |
| 53 | + <main class="main"> |
| 54 | + <!-- File Explorer View --> |
| 55 | + <div class="view active" id="explorer"> |
| 56 | + <div class="view-header"> |
| 57 | + <h2>📁 File Explorer & Parser</h2> |
| 58 | + <p>Upload files or directories to analyze code structure and extract functions</p> |
| 59 | + </div> |
| 60 | + |
| 61 | + <div class="explorer-container"> |
| 62 | + <div class="upload-zone" id="uploadZone"> |
| 63 | + <div class="upload-content"> |
| 64 | + <div class="upload-icon">📤</div> |
| 65 | + <h3>Drop files or directories here</h3> |
| 66 | + <p>Or click to browse and select files</p> |
| 67 | + <input type="file" id="fileInput" multiple webkitdirectory style="display: none;"> |
| 68 | + <input type="file" id="singleFileInput" multiple style="display: none;"> |
| 69 | + <div class="upload-buttons"> |
| 70 | + <button class="btn-primary" onclick="document.getElementById('fileInput').click()"> |
| 71 | + Select Directory |
| 72 | + </button> |
| 73 | + <button class="btn-secondary" onclick="document.getElementById('singleFileInput').click()"> |
| 74 | + Select Files |
| 75 | + </button> |
| 76 | + </div> |
| 77 | + </div> |
| 78 | + </div> |
| 79 | + |
| 80 | + <div class="file-tree" id="fileTree" style="display: none;"> |
| 81 | + <div class="tree-header"> |
| 82 | + <h3>📂 Project Structure</h3> |
| 83 | + <div class="tree-actions"> |
| 84 | + <button class="btn-small" id="parseAllBtn">Parse All Files</button> |
| 85 | + <button class="btn-small btn-secondary" id="clearFilesBtn">Clear</button> |
| 86 | + </div> |
| 87 | + </div> |
| 88 | + <div class="tree-content" id="treeContent"></div> |
| 89 | + </div> |
| 90 | + </div> |
| 91 | + |
| 92 | + <div class="parsing-results" id="parsingResults" style="display: none;"> |
| 93 | + <div class="results-header"> |
| 94 | + <h3>🔍 Parsing Results</h3> |
| 95 | + <div class="results-stats" id="resultsStats"></div> |
| 96 | + </div> |
| 97 | + <div class="results-content"> |
| 98 | + <div class="results-grid" id="resultsGrid"></div> |
| 99 | + </div> |
| 100 | + </div> |
| 101 | + </div> |
| 102 | + |
| 103 | + <!-- Compare View --> |
| 104 | + <div class="view" id="compare"> |
| 105 | + <div class="view-header"> |
| 106 | + <h2>⚖️ Visual Code Comparison</h2> |
| 107 | + <p>Compare two files or functions with advanced diff visualization</p> |
| 108 | + </div> |
| 109 | + |
| 110 | + <div class="compare-container"> |
| 111 | + <div class="compare-setup"> |
| 112 | + <div class="compare-source"> |
| 113 | + <h3>Source (Original)</h3> |
| 114 | + <div class="file-selector"> |
| 115 | + <select id="sourceFileSelect" class="file-select"> |
| 116 | + <option value="">Select a file...</option> |
| 117 | + </select> |
| 118 | + <button class="btn-small" id="loadSourceBtn">Load</button> |
| 119 | + </div> |
| 120 | + <div class="code-editor" id="sourceEditor"> |
| 121 | + <textarea placeholder="Paste source code here or select from parsed files..."></textarea> |
| 122 | + </div> |
| 123 | + </div> |
| 124 | + |
| 125 | + <div class="compare-target"> |
| 126 | + <h3>Target (Modified)</h3> |
| 127 | + <div class="file-selector"> |
| 128 | + <select id="targetFileSelect" class="file-select"> |
| 129 | + <option value="">Select a file...</option> |
| 130 | + </select> |
| 131 | + <button class="btn-small" id="loadTargetBtn">Load</button> |
| 132 | + </div> |
| 133 | + <div class="code-editor" id="targetEditor"> |
| 134 | + <textarea placeholder="Paste target code here or select from parsed files..."></textarea> |
| 135 | + </div> |
| 136 | + </div> |
| 137 | + </div> |
| 138 | + |
| 139 | + <div class="compare-actions"> |
| 140 | + <button class="btn-primary" id="compareBtn"> |
| 141 | + <span class="icon">🔍</span> |
| 142 | + Compare Files |
| 143 | + </button> |
| 144 | + <div class="compare-options"> |
| 145 | + <label> |
| 146 | + <input type="checkbox" id="ignoreWhitespace" checked> |
| 147 | + Ignore Whitespace |
| 148 | + </label> |
| 149 | + <label> |
| 150 | + <input type="checkbox" id="detectMoves" checked> |
| 151 | + Detect Moves |
| 152 | + </label> |
| 153 | + <label> |
| 154 | + Threshold: <input type="range" id="thresholdSlider" min="0" max="1" step="0.1" value="0.7"> |
| 155 | + <span id="thresholdValue">0.7</span> |
| 156 | + </label> |
| 157 | + </div> |
| 158 | + </div> |
| 159 | + </div> |
| 160 | + |
| 161 | + <div class="comparison-results" id="comparisonResults" style="display: none;"> |
| 162 | + <div class="results-summary" id="resultsSummary"></div> |
| 163 | + <div class="diff-visualization" id="diffVisualization"></div> |
| 164 | + </div> |
| 165 | + </div> |
| 166 | + |
| 167 | + <!-- Analysis View --> |
| 168 | + <div class="view" id="analysis"> |
| 169 | + <div class="view-header"> |
| 170 | + <h2>📊 Advanced Code Analysis</h2> |
| 171 | + <p>Multi-file analysis with cross-file detection and metrics</p> |
| 172 | + </div> |
| 173 | + |
| 174 | + <div class="analysis-container"> |
| 175 | + <div class="analysis-controls"> |
| 176 | + <button class="btn-primary" id="runAnalysisBtn"> |
| 177 | + <span class="icon">🔬</span> |
| 178 | + Run Analysis |
| 179 | + </button> |
| 180 | + <div class="analysis-options"> |
| 181 | + <label> |
| 182 | + <input type="checkbox" id="crossFileAnalysis" checked> |
| 183 | + Cross-file Analysis |
| 184 | + </label> |
| 185 | + <label> |
| 186 | + <input type="checkbox" id="detectDuplicates" checked> |
| 187 | + Detect Duplicates |
| 188 | + </label> |
| 189 | + <label> |
| 190 | + <input type="checkbox" id="calculateComplexity" checked> |
| 191 | + Calculate Complexity |
| 192 | + </label> |
| 193 | + </div> |
| 194 | + </div> |
| 195 | + |
| 196 | + <div class="analysis-results" id="analysisResults" style="display: none;"> |
| 197 | + <div class="metrics-dashboard" id="metricsDashboard"></div> |
| 198 | + <div class="analysis-details" id="analysisDetails"></div> |
| 199 | + </div> |
| 200 | + </div> |
| 201 | + </div> |
| 202 | + |
| 203 | + <!-- Settings View --> |
| 204 | + <div class="view" id="settings"> |
| 205 | + <div class="view-header"> |
| 206 | + <h2>⚙️ Configuration</h2> |
| 207 | + <p>Customize parser, semantic analyzer, and diff engine settings</p> |
| 208 | + </div> |
| 209 | + |
| 210 | + <div class="settings-container"> |
| 211 | + <div class="settings-section"> |
| 212 | + <h3>Parser Configuration</h3> |
| 213 | + <div class="setting-group"> |
| 214 | + <label>Max File Size (MB): <input type="number" id="maxFileSize" value="1" min="1" max="100"></label> |
| 215 | + <label>Parse Timeout (s): <input type="number" id="parseTimeout" value="30" min="5" max="300"></label> |
| 216 | + <label><input type="checkbox" id="enableErrorRecovery" checked> Enable Error Recovery</label> |
| 217 | + </div> |
| 218 | + </div> |
| 219 | + |
| 220 | + <div class="settings-section"> |
| 221 | + <h3>Semantic Analysis</h3> |
| 222 | + <div class="setting-group"> |
| 223 | + <label>Max Resolution Depth: <input type="number" id="maxResolutionDepth" value="10" min="1" max="50"></label> |
| 224 | + <label>Symbol Cache Size: <input type="number" id="symbolCacheSize" value="1000" min="100" max="10000"></label> |
| 225 | + <label><input type="checkbox" id="enableCrossFileAnalysis" checked> Enable Cross-file Analysis</label> |
| 226 | + </div> |
| 227 | + </div> |
| 228 | + |
| 229 | + <div class="settings-section"> |
| 230 | + <h3>Diff Engine</h3> |
| 231 | + <div class="setting-group"> |
| 232 | + <label>Default Similarity Threshold: <input type="range" id="defaultThreshold" min="0" max="1" step="0.1" value="0.8"></label> |
| 233 | + <label>Max Tree Depth: <input type="number" id="maxTreeDepth" value="100" min="10" max="1000"></label> |
| 234 | + <label><input type="checkbox" id="enableRefactoringDetection" checked> Enable Refactoring Detection</label> |
| 235 | + <label><input type="checkbox" id="enableCrossFileTracking" checked> Enable Cross-file Tracking</label> |
| 236 | + </div> |
| 237 | + </div> |
| 238 | + |
| 239 | + <div class="settings-actions"> |
| 240 | + <button class="btn-primary" id="saveSettingsBtn">Save Configuration</button> |
| 241 | + <button class="btn-secondary" id="resetSettingsBtn">Reset to Defaults</button> |
| 242 | + </div> |
| 243 | + </div> |
| 244 | + </div> |
| 245 | + </main> |
| 246 | + |
| 247 | + <!-- Loading Overlay --> |
| 248 | + <div class="loading-overlay" id="loadingOverlay" style="display: none;"> |
| 249 | + <div class="loading-content"> |
| 250 | + <div class="spinner"></div> |
| 251 | + <p id="loadingText">Processing...</p> |
| 252 | + </div> |
| 253 | + </div> |
| 254 | + |
| 255 | + <!-- Toast Notifications --> |
| 256 | + <div class="toast-container" id="toastContainer"></div> |
| 257 | + </div> |
| 258 | + |
| 259 | + <script src="app.js"></script> |
| 260 | +</body> |
| 261 | +</html> |
0 commit comments