Generate HTML content from parsed diff phases.
(phases: list[dict], task_id: str = None, json_data: dict = None)
| 154 | |
| 155 | |
| 156 | def generate_html(phases: list[dict], task_id: str = None, json_data: dict = None) -> str: |
| 157 | """Generate HTML content from parsed diff phases.""" |
| 158 | html = f"""<!DOCTYPE html> |
| 159 | <html lang="en"> |
| 160 | <head> |
| 161 | <meta charset="UTF-8"> |
| 162 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 163 | <title>File Diff Log{f" - {task_id}" if task_id else ""}</title> |
| 164 | <style> |
| 165 | body {{ |
| 166 | font-family: 'Consolas', 'Monaco', 'Courier New', monospace; |
| 167 | background-color: #1e1e1e; |
| 168 | color: #d4d4d4; |
| 169 | margin: 0; |
| 170 | padding: 10px; |
| 171 | line-height: 1.2; |
| 172 | }} |
| 173 | |
| 174 | .container {{ |
| 175 | max-width: 1200px; |
| 176 | margin: 0 auto; |
| 177 | }} |
| 178 | |
| 179 | h1 {{ |
| 180 | color: #569cd6; |
| 181 | font-size: 18px; |
| 182 | margin-bottom: 15px; |
| 183 | border-bottom: 1px solid #3c3c3c; |
| 184 | padding-bottom: 8px; |
| 185 | }} |
| 186 | |
| 187 | .phase {{ |
| 188 | margin-bottom: 20px; |
| 189 | border: 1px solid #3c3c3c; |
| 190 | border-radius: 4px; |
| 191 | overflow: hidden; |
| 192 | }} |
| 193 | |
| 194 | .phase-header {{ |
| 195 | background-color: #2d2d30; |
| 196 | padding: 8px 12px; |
| 197 | cursor: pointer; |
| 198 | user-select: none; |
| 199 | display: flex; |
| 200 | align-items: center; |
| 201 | justify-content: space-between; |
| 202 | transition: background-color 0.2s; |
| 203 | }} |
| 204 | |
| 205 | .phase-header:hover {{ |
| 206 | background-color: #3c3c3c; |
| 207 | }} |
| 208 | |
| 209 | .phase-header.collapsed .collapse-icon {{ |
| 210 | transform: rotate(-90deg); |
| 211 | }} |
| 212 | |
| 213 | .phase-stats {{ |
no test coverage detected