diff --git a/Plugin/unraid/css/varaverk.css b/Plugin/unraid/css/varaverk.css index 323e007..08734ee 100644 --- a/Plugin/unraid/css/varaverk.css +++ b/Plugin/unraid/css/varaverk.css @@ -943,6 +943,12 @@ mark { background: #5d4037; color: #ffcc80; border-radius: 2px; } .vv-ack-btn { margin-left: auto; font-size: 10px; padding: 1px 6px; color: #555; border-color: #333; flex-shrink: 0; } .vv-ack-btn:hover { color: #aaa; border-color: #555; } +/* Same size as Ack beside it, but not the same weight. Ack is the quiet, frequent action; asking + what an error means is the rarer one and the one worth noticing on a row you do not understand, + so it carries the assistant's blue rather than dissolving into the border. */ +.vv-why-btn { font-size: 10px; padding: 1px 6px; flex-shrink: 0; + color: #5c7cfa; border-color: #26324a; background: #0d1220; } +.vv-why-btn:hover { color: #8ba4ff; border-color: #3a4a6a; } .vv-err-line { color: #888; font-size: 11px; word-break: break-all; line-height: 1.4; } /* The error text opens the log at that line. Underlined on hover only — a permanently decorated line of log output is harder to read, and this block exists to be read first. */ diff --git a/Plugin/unraid/pages/scheduler.php b/Plugin/unraid/pages/scheduler.php index 5afec36..a7e8400 100644 --- a/Plugin/unraid/pages/scheduler.php +++ b/Plugin/unraid/pages/scheduler.php @@ -2877,6 +2877,30 @@ function vvMarkLogLine(pre, display, invert) { return true; } +// Hand one error line to the assistant, scoped to the script it came from. +// +// The scope is what does the work. Pointing the troubleshoot profile at a script is what attaches +// that script's run record and log to the prompt, so the model reads the surrounding lines rather +// than the one sentence quoted here — which is the difference between "that string usually means +// a permissions problem" and "it failed here, after this, because of that". +// +// Deliberately does not acknowledge. Every other control on the row does, because opening the log +// at the line is something you do once you have seen it; asking what it means is something you do +// before deciding anything. Acking here would clear the row out from under the answer. +function vvErrExplain(script, line) { + if (!vvAiDockOn()) return; + const label = script.split('/').pop().replace(/_/g, ' '); + vvAiDockScope('troubleshoot', label, script); + + const inp = document.getElementById('vv-sched-ai-input'); + if (!inp) return; + // The line is quoted into the question rather than left for the model to find: the log may hold + // several errors and this is the one that was clicked. + inp.value = 'This error line came from ' + script + ':\n\n' + line + + '\n\nWhat caused it, and what should I do about it?'; + vvSchedChat.send(); +} + function vvAckError(script, ts, btn) { localStorage.setItem('vv-ack-' + script, ts); const row = btn.closest('.vv-err-row'); @@ -2926,6 +2950,14 @@ function vvUpdateErrors(errors) { + ' onclick="vvErrOpenAtLine(' + scriptJs + ',' + e.ts + ',' + lineJs + ',this)">' + vvEscHtml(label) + '' + '' + vvFmtAge(now - e.ts) + '' + // Only where there is an assistant to ask. Rendered before Ack because it is the + // question you have before you decide the error is dealt with — and unlike every other + // control on this row it deliberately does NOT acknowledge, since wanting to know what + // an error means is the opposite of having finished with it. + + (vvAiDockOn() + ? '' + : '') + '' + '' + '