diff --git a/diagnostic/index.html b/diagnostic/index.html
index 91e43e4..93790fe 100644
--- a/diagnostic/index.html
+++ b/diagnostic/index.html
@@ -1928,6 +1928,11 @@
const el = document.createElement('div');
el.className = `chat-msg ${m.type}`;
if (m.ts) el.dataset.ts = String(m.ts);
+ // Multi-Threading: Kontext-Zuordnung fuer den Focus-Filter.
+ // Ohne das landete beim Reload JEDE Bubble im Hauptchat
+ // (dataset.projectId undefined → '' → nur bei Hauptchat-Focus
+ // sichtbar), Projekte blieben leer.
+ el.dataset.projectId = m.projectId || '';
el.innerHTML = innerHtml;
b.appendChild(el);
}
@@ -1949,6 +1954,9 @@
}
for (const b of boxes) b.scrollTop = b.scrollHeight;
}
+ // Nach dem Neuaufbau den aktuellen Kontext-Focus anwenden: Bubbles
+ // die nicht zum fokussierten Projekt gehoeren ausblenden.
+ updateChatVisibilityByFocus();
if (errorCount > 0) {
console.warn(`chat_history: ${errorCount} Bubble(s) konnten nicht gerendert werden`);
}
diff --git a/diagnostic/server.js b/diagnostic/server.js
index 69d3915..b989ce0 100644
--- a/diagnostic/server.js
+++ b/diagnostic/server.js
@@ -2746,8 +2746,9 @@ async function handleLoadChatHistory(clientWs) {
if (obj.role !== "user" && obj.role !== "assistant") continue;
const ts = obj.ts || 0;
const text = String(obj.text || "");
+ const projectId = String(obj.project_id || ""); // Multi-Threading: Kontext-Zuordnung
if (obj.role === "user") {
- if (text) messages.push({ type: "sent", text, meta: "Gateway direkt", ts });
+ if (text) messages.push({ type: "sent", text, meta: "Gateway direkt", ts, projectId });
continue;
}
// assistant: nach FILE-Markern scannen, eigene aria_file-Eintraege pro Datei
@@ -2769,9 +2770,10 @@ async function handleLoadChatHistory(clientWs) {
size,
ts,
deleted: wasDeleted || !exists,
+ projectId,
});
}
- if (text) messages.push({ type: "received", text, meta: "chat:final", ts });
+ if (text) messages.push({ type: "received", text, meta: "chat:final", ts, projectId });
}
clientWs.send(JSON.stringify({ type: "chat_history", messages }));