style: final sidebar UI polish and cache update (2026-05-14)

This commit is contained in:
g1nation
2026-05-14 01:06:27 +09:00
parent 147536fb13
commit 46b4a7bc5d
7 changed files with 106 additions and 38 deletions
+28 -10
View File
@@ -1547,11 +1547,10 @@
li.dataset.agentId = a.id;
// ── Row 1: emoji + name/tagline + controls ──
// CSS handles layout via `.company-agent-head` (flex-wrap,
// gap, etc.) so we don't repeat inline styles here.
const row = document.createElement('div');
row.style.display = 'flex';
row.style.alignItems = 'center';
row.style.gap = '10px';
row.style.width = '100%';
row.className = 'company-agent-head';
const emoji = document.createElement('span');
emoji.className = 'company-agent-emoji';
@@ -1650,24 +1649,37 @@
row.className = 'company-agent-mix-row';
const usingOverride = a.knowledgeMixOverride !== null && a.knowledgeMixOverride !== undefined;
const effective = a.effectiveKnowledgeMixWeight;
// Tight label — "Mix" alone keeps the row narrow. The 🎚 emoji
// signals what it controls without needing the full word.
const label = document.createElement('span');
label.className = 'company-agent-mix-label';
label.textContent = '🎚 Knowledge Mix';
label.textContent = '🎚 Mix';
// Source badge ("GLOBAL" / "OVERRIDE") visually communicates
// *which knob* the value is coming from — clearer than packing
// it into the hint text.
const sourceBadge = document.createElement('span');
sourceBadge.className = 'company-agent-mix-source' + (usingOverride ? ' override' : '');
sourceBadge.textContent = usingOverride ? 'override' : 'global';
const slider = document.createElement('input');
slider.type = 'range';
slider.min = '0'; slider.max = '100'; slider.step = '5';
slider.value = String(effective);
slider.disabled = !usingOverride;
slider.className = 'company-agent-mix-slider';
// Compact hint: "Brain 55%" only — the model% is just 100 -
// brain%, so showing both was redundant noise. Stays narrow
// enough not to push the checkbox off the row.
const hint = document.createElement('span');
hint.className = 'company-agent-mix-hint';
const renderHint = () => {
const w = parseInt(slider.value, 10) || 50;
const tag = usingOverride
? `override · Model ${100 - w}% / Brain ${w}%`
: `global · Model ${100 - effective}% / Brain ${effective}%`;
hint.textContent = tag;
hint.textContent = `Brain ${w}%`;
};
const cb = document.createElement('input');
cb.type = 'checkbox'; cb.checked = !usingOverride;
cb.className = 'company-agent-mix-cb';
@@ -1677,6 +1689,9 @@
// Reset to global.
slider.disabled = true;
slider.value = String(globalWeight ?? 50);
sourceBadge.textContent = 'global';
sourceBadge.classList.remove('override');
renderHint();
vscode.postMessage({
type: 'setCompanyAgentKnowledgeMix',
agentId: a.id, value: null,
@@ -1684,6 +1699,8 @@
} else {
// Take ownership at the current displayed value.
slider.disabled = false;
sourceBadge.textContent = 'override';
sourceBadge.classList.add('override');
const w = parseInt(slider.value, 10) || 50;
vscode.postMessage({
type: 'setCompanyAgentKnowledgeMix',
@@ -1704,8 +1721,9 @@
const cbWrap = document.createElement('label');
cbWrap.className = 'company-agent-mix-cbwrap';
cbWrap.appendChild(cb);
cbWrap.appendChild(document.createTextNode(' use global'));
cbWrap.appendChild(document.createTextNode(' global'));
row.appendChild(label);
row.appendChild(sourceBadge);
row.appendChild(slider);
row.appendChild(hint);
row.appendChild(cbWrap);