feat(diagnostic): Multi-Threading UI — Kontext-Strip + Focus-Filter + Queue-Polling

Phase 3 vom Multi-Threading-Redesign. Diagnostic zeigt einen scrollbaren
Streifen von Kontext-Karten ueber dem Chat (Hauptchat + Projekte), jede
mit Live-Status-Dot. Tap wechselt den Focus, Chat filtert auf diesen
Kontext, Sende-Input laeuft mit der Focus-ID durch Bridge → Brain-Queue.

index.html:
- Neuer <div id="chat-context-strip"> ueber der Chat-Box, horizontal
  scrollbar.
- JS: focusedContextId (in localStorage gespiegelt), diagQueueStatus,
  diagProjectsCache. renderContextStrip() zeichnet Karten mit Dot
  + Status-Label. switchDiagFocus(id) wechselt Focus + versteckt
  Bubbles anderer Kontexte via data-project-id + style.display.
- Polling: /api/brain/projects/queue-status alle 2s, /projects/list
  alle 15s.
- addChat: nimmt options.projectId → schreibt data-project-id an die
  DOM-Node, versteckt sofort wenn Focus abweicht.
- Chat-Reception-Handler propagiert p.projectId aus dem RVS-Payload.
- testRVS() sendet msg.projectId=focusedContextId mit.

server.js:
- sendToRVS(text, isTrace, projectId): neuer Param, wird in
  payload.projectId gesetzt → Bridge routet an /chat body.project_id.
- test_rvs-Handler reicht msg.projectId durch.

Bewusst nicht drin (Follow-up wenn Stefan mag):
- Voller Dashboard-Stack mit stacked Karten die eigene Message-Listen +
  Input-Felder haben. Aktuelle Variante ist „Kontext-Strip fuer schnellen
  Wechsel + Focus-One-Rendering" — ~90% des UX-Werts mit ~10% des Aufwands.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-07-02 20:56:30 +02:00
co-authored by Claude Opus 4.7
parent 06316da36f
commit 21eac63723
2 changed files with 116 additions and 5 deletions
+11 -3
View File
@@ -1001,18 +1001,26 @@ function sendToRVS_raw(msgObj) {
freshWs.on("error", () => {});
}
function sendToRVS(text, isTrace) {
function sendToRVS(text, isTrace, projectId) {
// Brain-Pipeline: Diagnostic → RVS → Bridge → Brain (HTTP). OpenClaw-
// Gateway-Pfad ist abgeschaltet. Sender 'diagnostic' damit die Bridge
// den Text als User-Nachricht ans Brain weiterleitet und die App +
// Diagnostic die Bubble live spiegeln koennen.
//
// projectId (Multi-Threading 06/2026): optional — leerer/undefined String
// = Hauptchat, sonst project_id. Bridge liest payload.projectId und routet
// an /chat body.project_id — Brain queued per Kontext.
if (!rvsWs || rvsWs.readyState !== WebSocket.OPEN) {
if (isTrace) traceEnd(false, "RVS nicht verbunden");
return false;
}
sendToRVS_raw({
type: "chat",
payload: { text, sender: "diagnostic" },
payload: {
text,
sender: "diagnostic",
projectId: projectId || "",
},
timestamp: Date.now(),
});
return true;
@@ -2285,7 +2293,7 @@ wss.on("connection", (ws) => {
sendToRVS(msg.text || "aria lebst du noch?", true);
} else if (msg.action === "test_rvs") {
traceStart("RVS", msg.text || "aria lebst du noch?");
sendToRVS(msg.text || "aria lebst du noch?", true);
sendToRVS(msg.text || "aria lebst du noch?", true, msg.projectId || "");
} else if (msg.action === "reconnect_gateway") {
connectGateway();
} else if (msg.action === "reconnect_rvs") {