Add a troubleshooting profile with the scoped log, and a deterministic conf-key lookup
This commit is contained in:
@@ -1243,7 +1243,9 @@ window.addEventListener('resize', vvFitRight);
|
||||
new ResizeObserver(vvFitRight).observe(document.getElementById('vv-sched-left'));
|
||||
|
||||
function vvShowLogMode(id) {
|
||||
vvAiDockScope('varaverk', String(id).replace(/\.sh$/, '') + ' log');
|
||||
vvAiDockScope('troubleshoot',
|
||||
String(id).replace(/\.sh$/, '').split('/').pop() + ' log',
|
||||
String(id).replace(/\.sh$/, ''));
|
||||
document.getElementById('vv-suggestions').style.display = 'none';
|
||||
document.getElementById('vv-editor').style.display = 'none';
|
||||
document.getElementById('vv-si-view').style.display = 'none';
|
||||
@@ -2298,15 +2300,19 @@ function vvAiDockOn() { return !!document.getElementById('vv-ai-dock'); }
|
||||
// Called by every view switch. Profile and scope are derived from what is open and shown on the
|
||||
// chip — never chosen, never hidden. If the user can see what it thinks it is looking at, a
|
||||
// wrong inference costs a glance instead of a confidently wrong answer.
|
||||
function vvAiDockScope(profile, label) {
|
||||
// label is what the chip shows; target is what the worker resolves. They differ for logs, where
|
||||
// the chip wants "daily_sync_maintenance log" and the worker needs the script id it can turn
|
||||
// into a path under LOG_DIR.
|
||||
function vvAiDockScope(profile, label, target) {
|
||||
if (!vvAiDockOn()) return;
|
||||
if (profile === vvAiProfile && label === vvAiScope) return;
|
||||
target = target || label;
|
||||
if (profile === vvAiProfile && target === vvAiScope) return;
|
||||
|
||||
const had = vvAiHist.length > 0;
|
||||
vvAiProfile = profile;
|
||||
vvAiScope = label;
|
||||
vvAiScope = target;
|
||||
document.getElementById('vv-ai-dock-chip').textContent =
|
||||
(profile === 'code' ? 'Code' : 'Assistant') + ' · ' + label;
|
||||
({ code: 'Code', troubleshoot: 'Troubleshoot' }[profile] || 'Assistant') + ' · ' + label;
|
||||
|
||||
// Transcript stays, history sent to the model resets — the same rule the AI tab's profile
|
||||
// buttons already use. A troubleshooting thread carrying log excerpts must not bleed into a
|
||||
|
||||
Reference in New Issue
Block a user