fix(dashboard,server): restore code change ledger UI and enrich model schema parity and pagination

This commit is contained in:
Riz Ashraf committed 2026-10-07 13:14:33 +01:00
1 parent 3b146f91c2
commit 73c3d41c87
9 files changed
+297 -19

No files matched your search

+28 -5
View File
@@ -7,8 +7,9 @@ function switchTab(tabId, btn) {
const targetTab = document.getElementById(tabId);
if (targetTab)
targetTab.classList.add("active");
if (btn)
btn.classList.add("active");
const targetBtn = btn || document.querySelector(`.tab-button[onclick*="'${tabId}'"]`);
if (targetBtn)
targetBtn.classList.add("active");
switch (tabId) {
case "graph-tab":
if (network) {
@@ -334,7 +335,10 @@ function buildTaskTreeHTML(tasks, parentId, depth = 0) {
if (isCancelled) {
html += `<div style="background:#95a5a6; color:white; font-size:0.75em; padding:2px 6px; border-radius:3px; display:inline-block; margin-bottom:6px; font-weight:bold;">[CANCELLED]</div>`;
}
html += `<strong>${t.title}</strong>${t.description}`;
html += `<strong>${escapeHtml(t.title)}</strong>`;
if (t.description) {
html += `<div style="margin-top:5px; font-size:0.9em; color:var(--text-secondary); line-height:1.4;">${escapeHtml(t.description)}</div>`;
}
const criteria = t.acceptance_criteria || [];
if (criteria.length > 0) {
html += `<ul style="margin:8px 0 0 0; padding-left:20px; font-size: 0.9em; color: var(--text-secondary);">`;
@@ -420,7 +424,7 @@ async function handleSearch(e) {
return;
}
container.innerHTML = data.results.map((r) => `
<div class="search-result-item" onclick="if(rawEntities['${r.id}']){ showInspector('${r.id}'); network.selectNodes(['${r.id}']); network.focus('${r.id}', {scale:1.2, animation:true}); }" style="cursor:pointer;">
<div class="search-result-item" onclick="switchTab('graph-tab'); if(rawEntities['${r.id}']){ showInspector('${r.id}'); if(network){ network.selectNodes(['${r.id}']); network.focus('${r.id}', {scale:1.2, animation:true}); } }" style="cursor:pointer;">
<div style="display:flex; justify-content:space-between; align-items:flex-start;">
<div>
<strong>${highlightText(r.title, q)}</strong>
@@ -726,10 +730,16 @@ function setupWS() {
};
}
async function loadGenericList(endpoint, containerId, formatter) {
const container = document.getElementById(containerId);
try {
const res = await fetch(endpoint);
if (!res.ok) {
if (container) {
container.innerHTML = `<div style="color:var(--error-color); padding:20px; text-align:center;">⚠️ Failed to load ${endpoint} (${res.status} ${res.statusText})</div>`;
}
return;
}
const data = await res.json();
const container = document.getElementById(containerId);
if (!container)
return;
if (!data || data.length === 0) {
@@ -745,6 +755,9 @@ async function loadGenericList(endpoint, containerId, formatter) {
}).join("");
} catch (err) {
console.error(`Failed to load ${endpoint}`, err);
if (container) {
container.innerHTML = `<div style="color:var(--error-color); padding:20px; text-align:center;">⚠️ Failed to load ${endpoint} (${escapeHtml(String(err))})</div>`;
}
}
}
function loadLedger() {
@@ -832,6 +845,16 @@ function loadMemos() {
<strong>Memo from ${item.author || "System"}</strong>
<div style="white-space:pre-wrap; font-size:0.9em; line-height:1.4;">${item.content || item.summary || ""}</div>
`);
loadGenericList("/api/session_summaries", "summaries-container", (item) => `
<div style="display:flex; justify-content:space-between; align-items:center;">
<strong>Session ${item.session_id ? escapeHtml(item.session_id) : "Summary"}</strong>
<span style="font-size:0.75em; color:var(--text-secondary); background:var(--canvas-bg); padding:2px 6px; border-radius:4px; border:1px solid var(--border-color);">${escapeHtml(item.namespace || "global")}</span>
</div>
${item.git_commit || item.git_branch ? `<div style="font-size:0.8em; color:var(--text-secondary); margin-top:3px; font-family:monospace;">${escapeHtml(item.git_branch || "")} @ ${escapeHtml((item.git_commit || "").substring(0, 8))}</div>` : ""}
<div style="white-space:pre-wrap; font-size:0.9em; line-height:1.4; margin-top:8px;">${escapeHtml(item.summary || "")}</div>
${item.tasks_completed && item.tasks_completed.length > 0 ? `<div style="margin-top:8px; font-size:0.85em;"><strong>Tasks Completed:</strong><ul style="margin:4px 0 0 16px; padding:0;">${item.tasks_completed.map((t) => `<li>${escapeHtml(t)}</li>`).join("")}</ul></div>` : ""}
${item.next_steps && item.next_steps.length > 0 ? `<div style="margin-top:6px; font-size:0.85em;"><strong>Next Steps:</strong><ul style="margin:4px 0 0 16px; padding:0;">${item.next_steps.map((s) => `<li>${escapeHtml(s)}</li>`).join("")}</ul></div>` : ""}
`);
loadGenericList("/api/milestones", "milestones-container", (item) => `
<strong>${item.title || item.name}</strong>
<div style="margin-top:5px; font-size:0.85em;">${item.description || ""}</div>