fix(diagnostic): Verstecken im Kontext-Streifen (Main-Tab) statt nur Settings
Das Auge/Toggle war faelschlich nur in der vertikalen Projektliste unter Einstellungen — Stefan managed Projekte aber ueber die Ordner-Bubbles im Kontext-Streifen auf dem Main-Tab, und der filterte hidden gar nicht (verstecktes Projekt blieb sichtbar, kein Auge). renderContextStrip: versteckte Projekte standardmaessig raus, 🙈/👁-Auge pro Bubble (eigenes onclick + stopPropagation, wechselt nicht den Kontext), "versteckte anzeigen (N)"-Toggle-Chip am Ende; setStripProjectHidden patcht + raeumt Focus wenn noetig. project_changed refresht jetzt Streifen UND Liste. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+66
-4
@@ -1424,6 +1424,7 @@
|
||||
let focusedContextId = localStorage.getItem('diag_focused_context_id') || '';
|
||||
let diagQueueStatus = {};
|
||||
let diagProjectsCache = [];
|
||||
let diagShowHiddenStrip = false; // versteckte Projekte im Streifen zeigen?
|
||||
|
||||
function updateChatVisibilityByFocus() {
|
||||
for (const box of [chatBox, document.getElementById('chat-box-fs')]) {
|
||||
@@ -1464,20 +1465,79 @@
|
||||
if (s.queue_size > 0) return { color: '#FFD60A', label: `Queue: ${s.queue_size}` };
|
||||
return { color: '#34C759', label: 'idle' };
|
||||
};
|
||||
// Projekt-Chip MIT Auge (verstecken/sichtbar). Auge hat eigenes onclick
|
||||
// + stopPropagation, damit der Klick nicht den Kontext wechselt.
|
||||
const projChip = (p, isFocus, dotColor, subline) => {
|
||||
const hidden = !!p.hidden;
|
||||
const bg = isFocus ? 'rgba(52,199,89,0.15)' : '#1E1E2E';
|
||||
const border = isFocus ? '#34C759' : '#2A2A3E';
|
||||
const eye = hidden ? '👁' : '🙈';
|
||||
const eyeTitle = hidden ? 'Wieder dauerhaft sichtbar machen' : 'Verstecken (aus dem Streifen ausblenden)';
|
||||
return `<div style="flex:0 0 auto;padding:6px 10px;background:${bg};border:1px solid ${border};border-radius:6px;display:flex;align-items:center;gap:6px;min-width:120px;${hidden ? 'opacity:0.5;' : ''}">
|
||||
<div onclick="switchDiagFocus('${p.id}')" style="cursor:pointer;display:flex;align-items:center;gap:6px;min-width:0;">
|
||||
<div style="width:8px;height:8px;border-radius:4px;background:${dotColor};"></div>
|
||||
<div style="display:flex;flex-direction:column;min-width:0;">
|
||||
<div style="color:${isFocus?'#34C759':'#E0E0F0'};font-size:12px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:200px;">📁 ${escapeHtml(p.name)}${hidden ? ' <span style="color:#B392F0;font-size:9px;font-weight:700;">versteckt</span>' : ''}</div>
|
||||
<div style="color:#8888AA;font-size:10px;">${subline}</div>
|
||||
</div>
|
||||
</div>
|
||||
<span onclick="event.stopPropagation();setStripProjectHidden('${p.id}',${!hidden})" title="${eyeTitle}" style="cursor:pointer;font-size:14px;padding:2px 4px;user-select:none;">${eye}</span>
|
||||
</div>`;
|
||||
};
|
||||
const cards = [];
|
||||
// Hauptchat
|
||||
const mainDot = dotFor('__main__');
|
||||
cards.push(chip('', '💬 Hauptchat', focusedContextId === '', mainDot.color, mainDot.label || 'idle'));
|
||||
// Projekte — nur active/ended, sortiert nach letzter Aktivitaet
|
||||
// Projekte — nur active/ended, sortiert nach letzter Aktivitaet.
|
||||
// Versteckte standardmaessig raus; per Toggle-Chip einblendbar.
|
||||
let hiddenCount = 0;
|
||||
for (const p of diagProjectsCache) {
|
||||
if (p.status === 'archived') continue;
|
||||
if (p.hidden) {
|
||||
hiddenCount++;
|
||||
if (!diagShowHiddenStrip) continue;
|
||||
}
|
||||
const d = dotFor(p.id);
|
||||
const sub = d.label || `${p.turn_count} Turns`;
|
||||
cards.push(chip(p.id, `📁 ${p.name}`, focusedContextId === p.id, d.color, sub));
|
||||
cards.push(projChip(p, focusedContextId === p.id, d.color, sub));
|
||||
}
|
||||
// Toggle-Chip am Ende (nur wenn es versteckte gibt oder gerade gezeigt werden)
|
||||
if (hiddenCount > 0 || diagShowHiddenStrip) {
|
||||
const tLabel = diagShowHiddenStrip
|
||||
? `🙈 versteckte ausblenden (${hiddenCount})`
|
||||
: `👁 versteckte anzeigen (${hiddenCount})`;
|
||||
cards.push(`<div onclick="toggleDiagHiddenStrip()" title="Versteckte Projekte ein-/ausblenden" style="cursor:pointer;flex:0 0 auto;padding:6px 10px;background:#0D0D18;border:1px dashed #3A3A50;border-radius:6px;display:flex;align-items:center;color:#B392F0;font-size:11px;font-weight:600;white-space:nowrap;">${tLabel}</div>`);
|
||||
}
|
||||
strip.innerHTML = cards.join('');
|
||||
}
|
||||
|
||||
function toggleDiagHiddenStrip() {
|
||||
diagShowHiddenStrip = !diagShowHiddenStrip;
|
||||
renderContextStrip();
|
||||
}
|
||||
|
||||
async function setStripProjectHidden(id, hidden) {
|
||||
try {
|
||||
const r = await fetch(`/api/brain/projects/${encodeURIComponent(id)}`, {
|
||||
method: 'PATCH',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ hidden: !!hidden }),
|
||||
});
|
||||
if (!r.ok) throw new Error('HTTP ' + r.status);
|
||||
// Wenn wir das gerade fokussierte Projekt verstecken (und Versteckte nicht
|
||||
// eingeblendet sind), zurueck auf Hauptchat — sonst haengt der Focus an
|
||||
// einem unsichtbaren Chip.
|
||||
if (hidden && id === focusedContextId && !diagShowHiddenStrip) {
|
||||
switchDiagFocus('');
|
||||
}
|
||||
// Lokal sofort aktualisieren (der /api/brain-Proxy broadcastet zusaetzlich
|
||||
// project_changed an App + andere Tabs).
|
||||
await refreshDiagProjectsCache();
|
||||
} catch (e) {
|
||||
alert('Verstecken/Anzeigen fehlgeschlagen: ' + e.message);
|
||||
}
|
||||
}
|
||||
|
||||
async function refreshDiagQueueStatus() {
|
||||
try {
|
||||
const r = await fetch('/api/brain/projects/queue-status');
|
||||
@@ -1775,8 +1835,10 @@
|
||||
}
|
||||
|
||||
if (msg.type === 'project_changed') {
|
||||
// ARIA hat in einem Tool-Call ein Projekt erstellt/betreten/verlassen/beendet.
|
||||
// Liste neu laden falls sichtbar.
|
||||
// Projekt geaendert (ARIA-Tool, App/Diagnostic-Verstecken, …) →
|
||||
// BEIDE Projekt-UIs live aktualisieren: den Kontext-Streifen (Main)
|
||||
// und die vertikale Liste (Einstellungen).
|
||||
refreshDiagProjectsCache();
|
||||
loadProjects();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user