@@ -330,16 +373,74 @@ function renderLitePlanTab(session) {
+
+ ${plan.tasks?.length ? `
+
+
Fix Tasks (${plan.tasks.length})
+
+ ${plan.tasks.map((task, idx) => `
+
+
+
+ ${task.modification_points?.length ? `
+
+
Modification Points:
+
+ ${task.modification_points.map(mp => `
+ -
+
${escapeHtml(mp.file || '')}
+ ${mp.function_name ? `→ ${escapeHtml(mp.function_name)}` : ''}
+ ${mp.change_type ? `(${escapeHtml(mp.change_type)})` : ''}
+
+ `).join('')}
+
+
+ ` : ''}
+ ${task.implementation?.length ? `
+
+
Implementation Steps:
+
+ ${task.implementation.map(step => `- ${escapeHtml(step)}
`).join('')}
+
+
+ ` : ''}
+ ${task.verification?.length ? `
+
+
Verification:
+
+ ${task.verification.map(v => `- ${escapeHtml(v)}
`).join('')}
+
+
+ ` : ''}
+
+
+ `).join('')}
+
+
+ ` : ''}
+
-
-
{ } Raw JSON
-
${escapeHtml(JSON.stringify(plan, null, 2))}
+
+
+
+
${escapeHtml(JSON.stringify(plan, null, 2))}
+
`;
@@ -393,3 +494,192 @@ async function loadAndRenderLiteSummaryTab(session, contentArea) {
contentArea.innerHTML = `
Failed to load summaries: ${err.message}
`;
}
}
+
+// ============================================
+// DIAGNOSES TAB RENDERING (lite-fix specific)
+// ============================================
+
+function renderDiagnosesTab(session) {
+ const diagnoses = session.diagnoses;
+
+ if (!diagnoses || (!diagnoses.manifest && diagnoses.items?.length === 0)) {
+ return `
+
+
+
No Diagnoses
+
No diagnosis-*.json files found for this session.
+
+ `;
+ }
+
+ let sections = [];
+
+ // Manifest summary (if available)
+ if (diagnoses.manifest) {
+ sections.push(`
+
+ `);
+ }
+
+ // Individual diagnosis items
+ if (diagnoses.items && diagnoses.items.length > 0) {
+ const diagnosisCards = diagnoses.items.map(diag => renderDiagnosisCard(diag)).join('');
+ sections.push(`
+
+
Diagnosis Details (${diagnoses.items.length})
+
+ ${diagnosisCards}
+
+
+ `);
+ }
+
+ return `
${sections.join('')}
`;
+}
+
+function renderDiagnosisCard(diag) {
+ const diagJsonId = `diag-json-${diag.id}`.replace(/[^a-zA-Z0-9-]/g, '-');
+ taskJsonStore[diagJsonId] = diag;
+
+ return `
+
+
+
+ ${renderDiagnosisContent(diag)}
+
+
+ `;
+}
+
+function renderDiagnosisContent(diag) {
+ let content = [];
+
+ // Summary/Overview
+ if (diag.summary || diag.overview) {
+ content.push(`
+
+
Summary:
+
${escapeHtml(diag.summary || diag.overview)}
+
+ `);
+ }
+
+ // Root Cause Analysis
+ if (diag.root_cause || diag.root_cause_analysis) {
+ content.push(`
+
+
Root Cause:
+
${escapeHtml(diag.root_cause || diag.root_cause_analysis)}
+
+ `);
+ }
+
+ // Issues/Findings
+ if (diag.issues && Array.isArray(diag.issues)) {
+ content.push(`
+
+
Issues Found (${diag.issues.length}):
+
+
+ `);
+ }
+
+ // Affected Files
+ if (diag.affected_files && Array.isArray(diag.affected_files)) {
+ content.push(`
+
+
Affected Files:
+
+ ${diag.affected_files.map(f => `${escapeHtml(typeof f === 'string' ? f : f.path || f.file)}`).join('')}
+
+
+ `);
+ }
+
+ // API Contracts (for api-contracts diagnosis)
+ if (diag.contracts && Array.isArray(diag.contracts)) {
+ content.push(`
+
+
API Contracts (${diag.contracts.length}):
+
+ ${diag.contracts.map(contract => `
+
+
+ ${contract.description ? `
${escapeHtml(contract.description)}
` : ''}
+ ${contract.issues?.length ? `
${contract.issues.length} issue(s)
` : ''}
+
+ `).join('')}
+
+
+ `);
+ }
+
+ // Dataflow Analysis (for dataflow diagnosis)
+ if (diag.dataflow || diag.data_flow) {
+ const df = diag.dataflow || diag.data_flow;
+ content.push(`
+
+
Data Flow Analysis:
+ ${typeof df === 'string' ? `
${escapeHtml(df)}
` : `
+
+ ${df.source ? `
Source: ${escapeHtml(df.source)}
` : ''}
+ ${df.sink ? `
Sink: ${escapeHtml(df.sink)}
` : ''}
+ ${df.transformations?.length ? `
+
+
Transformations:
+
${df.transformations.map(t => `- ${escapeHtml(t)}
`).join('')}
+
+ ` : ''}
+
+ `}
+
+ `);
+ }
+
+ // Recommendations
+ if (diag.recommendations && Array.isArray(diag.recommendations)) {
+ content.push(`
+
+
Recommendations:
+
+ ${diag.recommendations.map(rec => `- ${escapeHtml(typeof rec === 'string' ? rec : rec.description || rec.action)}
`).join('')}
+
+
+ `);
+ }
+
+ // If no specific content was rendered, show raw JSON preview
+ if (content.length === 0) {
+ content.push(`
+
+
${escapeHtml(JSON.stringify(diag, null, 2))}
+
+ `);
+ }
+
+ return content.join('');
+}