Count orchestrators on the board, pin it, and open on the assistant
Counting every step reported a fully scheduled system as 10 of 82, and reopening the last thread brought its profile with it, so the tab came up as Troubleshoot pointed at nothing.
This commit is contained in:
@@ -137,14 +137,22 @@ $_childManuals = array_values(array_filter($_repoFiles, function($f) {
|
||||
}));
|
||||
sort($_childManuals);
|
||||
|
||||
// Job stats for notification board
|
||||
$totalJobs = 0; $scheduledJobs = 0;
|
||||
// Job stats for notification board.
|
||||
//
|
||||
// Counted against orchestrators, not against every script. A schedule here is normally expressed
|
||||
// as one cron on an orchestrator that then calls its steps in order, so the steps are deliberately
|
||||
// cronless — counting them as unscheduled reported a fully-scheduled system as almost entirely
|
||||
// unscheduled, "10 / 82", which is alarming and wrong.
|
||||
//
|
||||
// Steps that do carry their own cron are counted separately. That happens when an orchestrator is
|
||||
// off and its steps have been given schedules of their own, which is the exception — and the
|
||||
// number of exceptions is the figure actually worth knowing.
|
||||
$orchTotal = 0; $orchScheduled = 0; $soloScheduled = 0;
|
||||
foreach ($tree as $orch) {
|
||||
$totalJobs++;
|
||||
if (!empty($orch['cron']) && $orch['enabled']) $scheduledJobs++;
|
||||
$orchTotal++;
|
||||
if (!empty($orch['cron']) && $orch['enabled']) $orchScheduled++;
|
||||
foreach (($orch['children'] ?? []) as $child) {
|
||||
$totalJobs++;
|
||||
if (!empty($child['cron']) && $child['enabled']) $scheduledJobs++;
|
||||
if (!empty($child['cron']) && $child['enabled']) $soloScheduled++;
|
||||
}
|
||||
}
|
||||
$runningScripts = [];
|
||||
@@ -493,7 +501,11 @@ $runningScripts = array_unique($runningScripts);
|
||||
|
||||
<!-- ── Notification Board ── -->
|
||||
<div class="vv-nb-board">
|
||||
<span class="vv-nb-stat"><?= $scheduledJobs ?> / <?= $totalJobs ?> scheduled</span>
|
||||
<span class="vv-nb-stat"><?= $orchScheduled ?> / <?= $orchTotal ?> orchestrators</span>
|
||||
<?php if ($soloScheduled): ?>
|
||||
<span class="vv-nb-sep">·</span>
|
||||
<span class="vv-nb-stat"><?= $soloScheduled ?> standalone<?= $soloScheduled === 1 ? '' : 's' ?></span>
|
||||
<?php endif; ?>
|
||||
<span class="vv-nb-sep">·</span>
|
||||
<span class="vv-nb-stat <?= !empty($runningScripts) ? 'vv-nb-running' : '' ?>">
|
||||
<?= !empty($runningScripts) ? 'Running: ' . htmlspecialchars(implode(', ', $runningScripts)) : 'Idle' ?>
|
||||
@@ -1203,6 +1215,12 @@ function vvFitRight() {
|
||||
const pre = document.getElementById('vv-log-pre');
|
||||
const sug = document.getElementById('vv-suggestions');
|
||||
|
||||
// The pinned help block sticks directly under the notification board, so it needs the board's
|
||||
// real height — which changes when Advanced mode adds the conf buttons and the board wraps.
|
||||
// Set before the stacked-layout return below, because the two rows stay pinned there too.
|
||||
const nb = right.querySelector('.vv-nb-board');
|
||||
if (nb && sug) sug.style.setProperty('--vv-nb-h', nb.offsetHeight + 'px');
|
||||
|
||||
const leftRect = left.getBoundingClientRect();
|
||||
const rightRect = right.getBoundingClientRect();
|
||||
|
||||
@@ -2398,6 +2416,13 @@ if (document.getElementById('vv-sched-ai-chat')) {
|
||||
prefix: 'vv-sched-ai',
|
||||
profile: vvAiProfile,
|
||||
scopeLabel: vvAiScopeLabel,
|
||||
// No reopening the last thread here, unlike the other two surfaces. Restoring a conversation
|
||||
// restores the profile it was held under, so the tab would come up as Troubleshoot pointed at
|
||||
// a log nobody has opened — the chip saying one thing and vvAiScope saying "Scheduler". This
|
||||
// panel's subject follows the view, and at load the view is the tab itself, so it starts where
|
||||
// that puts it: the assistant, scoped to the Scheduler. Saved threads are a click away under
|
||||
// Saved.
|
||||
resume: false,
|
||||
// Re-read at send time rather than captured, because the operator moves around this tab
|
||||
// between asking and sending.
|
||||
scope: () => vvAiScope,
|
||||
|
||||
Reference in New Issue
Block a user