reflectt-node 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dashboard.js +1 -1
- package/dist/dashboard.js.map +1 -1
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +15 -2
- package/dist/events.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +15 -0
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
- package/public/dashboard.js +17 -19
package/package.json
CHANGED
package/public/dashboard.js
CHANGED
|
@@ -33,6 +33,8 @@ function activatePage(page) {
|
|
|
33
33
|
document.querySelectorAll('.sidebar-link[data-page]').forEach(link => {
|
|
34
34
|
link.classList.toggle('active', link.dataset.page === page);
|
|
35
35
|
});
|
|
36
|
+
// Load doctor page data when shown
|
|
37
|
+
if (page === 'doctor' && typeof loadDoctorPage === 'function') loadDoctorPage();
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
function toggleSidebar() {
|
|
@@ -1658,12 +1660,7 @@ async function loadDoctorPage() {
|
|
|
1658
1660
|
}
|
|
1659
1661
|
}
|
|
1660
1662
|
|
|
1661
|
-
//
|
|
1662
|
-
const _origActivatePage = activatePage;
|
|
1663
|
-
function activatePage(page) {
|
|
1664
|
-
_origActivatePage(page);
|
|
1665
|
-
if (page === 'doctor') loadDoctorPage();
|
|
1666
|
-
}
|
|
1663
|
+
// Doctor page activation handled in activatePage() above
|
|
1667
1664
|
|
|
1668
1665
|
async function loadReleaseStatus(force = false) {
|
|
1669
1666
|
const badge = document.getElementById('release-badge');
|
|
@@ -2670,7 +2667,7 @@ function openTaskModal(taskId) {
|
|
|
2670
2667
|
loadPrReviewPanel(currentTask);
|
|
2671
2668
|
}
|
|
2672
2669
|
|
|
2673
|
-
function
|
|
2670
|
+
function formatDurationSec(sec) {
|
|
2674
2671
|
if (sec == null) return '';
|
|
2675
2672
|
if (sec < 60) return sec + 's';
|
|
2676
2673
|
return Math.floor(sec / 60) + 'm ' + (sec % 60) + 's';
|
|
@@ -2763,7 +2760,7 @@ function renderPrReviewPanel(data) {
|
|
|
2763
2760
|
html += '<div class="ci-check-row">';
|
|
2764
2761
|
html += '<span class="check-icon">' + icon + '</span>';
|
|
2765
2762
|
html += '<span class="check-name">' + esc(c.name) + '</span>';
|
|
2766
|
-
if (c.durationSec != null) html += '<span class="check-duration">' +
|
|
2763
|
+
if (c.durationSec != null) html += '<span class="check-duration">' + formatDurationSec(c.durationSec) + '</span>';
|
|
2767
2764
|
if (c.detailsUrl) html += '<a href="' + esc(c.detailsUrl) + '" target="_blank">logs</a>';
|
|
2768
2765
|
html += '</div>';
|
|
2769
2766
|
});
|
|
@@ -2979,7 +2976,7 @@ async function checkGettingStarted() {
|
|
|
2979
2976
|
// Step 1 done: check if system health loops are ticking (not just uptime > 0)
|
|
2980
2977
|
const hasHeartbeat = !!(health.system?.loops?.lastTickAt || (health.tasks?.total > 0));
|
|
2981
2978
|
const hasTasks = (health.tasks?.total || 0) > 0;
|
|
2982
|
-
const hasMessages = (health.chat?.total || 0) > 0;
|
|
2979
|
+
const hasMessages = (health.chat?.totalMessages || health.chat?.total || 0) > 0;
|
|
2983
2980
|
|
|
2984
2981
|
// Step 1: server running — always done if dashboard loads
|
|
2985
2982
|
const step1 = document.getElementById('gs-preflight');
|
|
@@ -3005,11 +3002,19 @@ async function checkGettingStarted() {
|
|
|
3005
3002
|
step3.querySelector('.gs-icon').textContent = '✓';
|
|
3006
3003
|
}
|
|
3007
3004
|
|
|
3008
|
-
// Auto-hide if all steps done
|
|
3005
|
+
// Auto-hide if all steps done, OR if the system clearly isn't a fresh install
|
|
3009
3006
|
const allDone = panel.querySelectorAll('.gs-step.done').length === 3;
|
|
3010
|
-
|
|
3007
|
+
const clearlyNotFresh = (health.tasks?.total || 0) > 5 || (health.chat?.totalMessages || health.chat?.total || 0) > 100;
|
|
3008
|
+
if (allDone || clearlyNotFresh) {
|
|
3011
3009
|
panel.classList.add('hidden');
|
|
3012
3010
|
}
|
|
3011
|
+
|
|
3012
|
+
// Pre-populate task badge from health before full task fetch completes
|
|
3013
|
+
const taskTotal = health.tasks?.total || 0;
|
|
3014
|
+
const navTaskBadge = document.getElementById('nav-task-count');
|
|
3015
|
+
if (navTaskBadge && taskTotal > 0 && allTasks.length === 0) {
|
|
3016
|
+
navTaskBadge.textContent = taskTotal;
|
|
3017
|
+
}
|
|
3013
3018
|
} catch {}
|
|
3014
3019
|
}
|
|
3015
3020
|
|
|
@@ -3407,14 +3412,7 @@ function formatFileSize(bytes) {
|
|
|
3407
3412
|
return (bytes / 1048576).toFixed(1) + ' MB';
|
|
3408
3413
|
}
|
|
3409
3414
|
|
|
3410
|
-
|
|
3411
|
-
const d = typeof ts === 'string' ? new Date(ts) : new Date(ts);
|
|
3412
|
-
const s = Math.floor((Date.now() - d.getTime()) / 1000);
|
|
3413
|
-
if (s < 60) return 'just now';
|
|
3414
|
-
if (s < 3600) return Math.floor(s / 60) + 'm ago';
|
|
3415
|
-
if (s < 86400) return Math.floor(s / 3600) + 'h ago';
|
|
3416
|
-
return Math.floor(s / 86400) + 'd ago';
|
|
3417
|
-
}
|
|
3415
|
+
// timeAgo defined above (line ~3286)
|
|
3418
3416
|
|
|
3419
3417
|
async function loadFiles() {
|
|
3420
3418
|
try {
|